Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > For Counter Variable

Reply
Thread Tools

For Counter Variable

 
 
Dwight Hutto
Guest
Posts: n/a
 
      09-24-2012
> *How* would one implement this better, more simply (for the user, not the
> implementator) or in a more readable manner? Chose *any* one of those.


Well if you're learning then the builtin might be more like how we
answer students questions here, than those doing work.

Write out the algorithmic function, and if you find one you can stuff
a few parameters in fine, but you still now how to do it by yourself
algorithmically.


--
Best Regards,
David Hutto
CEO: http://www.hitwebdevelopment.com
 
Reply With Quote
 
 
 
 
alex23
Guest
Posts: n/a
 
      09-24-2012
On Sep 25, 8:58*am, Dwight Hutto <(E-Mail Removed)> wrote:
> Well if you're learning then the builtin might be more like how we
> answer students questions here, than those doing work.


STOP SAYING THIS NONSENSE.

Using a pre-defined function is _not_ the "student" approach. Rolling
your own version of an existing function from scratch is _not_ the
"professional" approach.

If you're unable to realise this, then please stop dispensing advice
here like you know something.


 
Reply With Quote
 
 
 
 
Dwight Hutto
Guest
Posts: n/a
 
      09-24-2012
On Sep 25, 8:26 am, Dwight Hutto <(E-Mail Removed)> wrote:
> It's a function usage. Not to be too serious, there are usually
> simpler solutions, and built in functions.


`enumerate` _is_ a built-in function. Please provide an example of a
"simpler solution".

It's not the simpler solution I'm referring to, it's the fact that if
you're learning, then you should be able to design the built-in, not
just use it.

You don't always know all the built-ins, so the builtin is simpler,
but knowing how to code it yourself is the priority of learning to
code in a higher level language, which should be simpler to the user
of python.

--
Best Regards,
David Hutto
CEO: http://www.hitwebdevelopment.com
 
Reply With Quote
 
alex23
Guest
Posts: n/a
 
      09-24-2012
On Sep 25, 9:39*am, Dwight Hutto <(E-Mail Removed)> wrote:
> It's not the simpler solution I'm referring to, it's the fact that if
> you're learning, then you should be able to design the built-in, not
> just use it.


Garbage. I don't need to be able to build a SQLAlchemy to use it. I
don't need to be able to build an XML parser to use one. The whole
goddamn point of abstractions is to _ease the cognitive load_ in
building a complex system.

> You don't always know all the built-ins, so the builtin is simpler,
> but knowing how to code it yourself is the priority of learning to
> code in a higher level language, which should be simpler to the user
> of python.


"Higher level" means, in part, not _having to give a ****_ about the
sort of low level coding you're obsessed with. If it rocks your world
to declare your own index pointer and increment it on each pass of a
loop, knock yourself out. Just accept that others will criticise your
code for being "unpythonic". Why even use the language if you're not
prepared to _use_ the language...and that means _more than the
syntax_. It extends to the standard library and through to the entire
ecosystem that has developed around it.

People are drawn to Python to get **** done, not to spend pointless
time in recreating every wheel.
 
Reply With Quote
 
Dwight Hutto
Guest
Posts: n/a
 
      09-24-2012
>> Well if you're learning then the builtin might be more like how we
>> answer students questions here, than those doing work.

>
> STOP SAYING THIS NONSENSE.
>
> Using a pre-defined function is _not_ the "student" approach.

What are talking about, I suggested they roll there own in several
responses this week.

Rolling
> your own version of an existing function from scratch is _not_ the
> "professional" approach.

Yes it is, if you don't know the builtin, and everyone has memory flaws.
> If you're unable to realise this, then please stop dispensing advice
> here like you know something.


Dude, you know jack ****, so go shovel this bullshit somewhere else,
where people aren't intelligent enough to read the rest of my posts


--
Best Regards,
David Hutto
CEO: http://www.hitwebdevelopment.com
 
Reply With Quote
 
Dwight Hutto
Guest
Posts: n/a
 
      09-24-2012
Propaganda over...

--
Best Regards,
David Hutto
CEO: http://www.hitwebdevelopment.com
 
Reply With Quote
 
alex23
Guest
Posts: n/a
 
      09-24-2012
On Sep 25, 9:49*am, Dwight Hutto <(E-Mail Removed)> wrote:
> Rolling> your own version of an existing function from scratch is _not_ the
> > "professional" approach.

>
> Yes it is, if you don't know the builtin, and everyone has memory flaws.


Let me break this down for you in simple terms.

Code represents experience. Code that is considered important enough
to be in the standard library or as a built-in is something that
encapsulates a _lot_ of experience over time. You in your naive
approach to re-implement will _never capture that experience_. You'll
miss the edge cases that were already addressed. You'll over- or under-
extend the metaphor in ways the original doesn't.

And the first thing any experienced programmer would do when they
encountered your code is _refactor it to use the built-in_.

> Dude, you know jack ****, so go shovel this bullshit somewhere else,
> where people aren't intelligent enough to read the rest of my posts
> CEO: http://www.hitwebdevelopment.com


Is the animated GIF on your website under 60MB yet?
 
Reply With Quote
 
alex23
Guest
Posts: n/a
 
      09-25-2012
On Sep 25, 10:18*am, Dwight Hutto <(E-Mail Removed)> wrote:
> what's the ****ing point of that question


To highlight the vast gulf between what you think you are and what you
actually produce.


 
Reply With Quote
 
Dwight Hutto
Guest
Posts: n/a
 
      09-25-2012
> To highlight the vast gulf between what you think you are and what you
> actually produce.


I produce working code, and if it works, then I don't just think...I know.



--
Best Regards,
David Hutto
CEO: http://www.hitwebdevelopment.com
 
Reply With Quote
 
Littlefield, Tyler
Guest
Posts: n/a
 
      09-25-2012
On 9/24/2012 6:25 PM, Dwight Hutto wrote:
>> To highlight the vast gulf between what you think you are and what you
>> actually produce.

> I produce working code, and if it works, then I don't just think...I know.
>
> Working code != good code. Just an observation. Also, I've noticed a vast differences between someone who can explain their answers as Alix has done on multiple threads you've replied to in the last 5 minutes, and someone who cobbles something together with "your variable isn't being shown right because there's no self.a," which actually really makes no sense at all. Just my $0.02.


--
Take care,
Ty
http://tds-solutions.net
The aspen project: a barebones light-weight mud engine:
http://code.google.com/p/aspenmud
He that will not reason is a bigot; he that cannot reason is a fool; he that dares not reason is a slave.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
divide by n counter (with n as variable) rnpatil Hardware 0 04-27-2009 11:42 AM
Problem in using unsigned variable as a counter Sumit Nathany C Programming 2 10-24-2008 06:28 PM
Page File counter and Private Bytes Counter George2 C++ 1 01-31-2008 09:27 AM
Use XML to read/write a counter variable gce ASP .Net 2 03-17-2005 05:51 PM
Session("counter") vs. ViewState("counter")...a newbie question The Eeediot ASP .Net 3 12-22-2004 09:31 PM



Advertisments