Linked by snydeq on Mon 6th Dec 2010 23:52 UTC
General Development InfoWorld's Peter Wayner outlines the 12 most common programming mistakes, and how to avoid them. "Certain programming practices send the majority of developers reaching for their hair upon opening a file that has been exhibiting too much 'character'. Spend some time in a bar near any tech company, and you'll hear the howls: Why did the programmer use that antiquated structure? Where was the mechanism for defending against attacks from the Web? Wasn't any thought given to what a noob would do with the program?" Wayner writes. From playing it fast and loose, to delegating too much to frameworks, to relying too heavily on magic boxes, to overdetermining the user experience - each programming pitfall is accompanied by its opposing pair, lending further proof that "programming may in fact be transforming into an art, one that requires a skilled hand and a creative mind to achieve a happy medium between problematic extremes".
Thread beginning with comment 452465
To read all comments associated with this story, please click here.
import this
by renhoek on Tue 7th Dec 2010 11:44 UTC
Member since:

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

And from personal experience :

Tunnel vision, NIH syndrome, "look this generator generated 100K lines of code, what a timesaver!", Let's cut corners so we can finish on time, too much code already depends on the quirks, foreign keys make my live hard, i'll remove and cleanup after we ship.

It made me quit programming and starting to enjoy live again ;)

Reply Score: 6

RE: import this
by Verenkeitin on Tue 7th Dec 2010 15:18 in reply to "import this"
Verenkeitin Member since:

Shame on you for not linking to the source of this wisdom. :-)

I looked into Ruby on Rails and Groovy&Grails hated both for being too implicit. Struts2 is explicit but fails everything else on that list (and then some).

The only nice web framework I have encountered is Django. If you already know about http request&response, urls and databases you will easily understand Django.

Reply Parent Score: 1