Live data from Hacker News

Art of writing unmaintainable code.

thc.org

11–20 of 39 posts

Re: Art of writing unmaintainable code.

#12
Most of this is true, but I hate to have people continue to give hungarian notation a bad name when idiomatic use of it is quite a lot better than the naïve use of it decried here.

As an aside, do any other Haskell hackers find that single letter variable names are a lot more usable than in other languages? x:xs, y' and their ilk seem more readable than in other languages and often more readable than long variable names in Haskell.

Re: Art of writing unmaintainable code.

#13

The Drupal developers must have used this as a coding bible when they came up with the idea of shoving absolutely everything in multi-dimensional arrays.

I love it when the output of print_r is larger than the html of a fully rendered page, by virtue of the html being included in the array you are printing.

Re: Art of writing unmaintainable code.

#17
"Randomly capitalize the first letter of a syllable in the middle of a word. For example ComputeRasterHistoGram()."

I do this by accident all the time.

And this is the funniest thing I've read on the internet all year:

"Make sure that every method does a little bit more (or less) than its name suggests. As a simple example, a method named isValid(x) should as a side effect convert x to binary and store the result in a database."

Re: Art of writing unmaintainable code.

#19
Most of the "tips" in this article seem to suggest choosing a bad naming scheme or intentionally misnaming variables / functions. I can't imagine it would be that hard to put the code into an AST and work with that. That would make it easy to see where variables are used (despite losing their names). I realize that would take extra time, but I don't suspect it would be quite as bad.

I'm more afraid of the "Use threads With Abandon" tip.

Re: Art of writing unmaintainable code.

#20

While true, the article feeds an odious appetite for righteous superiority all too common among technical people. http://www.youtube.com/watch?v=5TzHbcXYwI4

Agreed - and while most of this is obvious, and some insightful, some of it is just baseless opinion: "Never underestimate how much havoc you can create by indenting with tabs instead of spaces..." Conversely, never underestimate how much havoc you can create by using spaces for indentation. With tabs, the level of indentation is clear and atomic. With spaces, it is arbitrary, and, wait for it... hard to maintain

As someone who, despite being 24 years old, learned to type on a (mechanical!) typewriter, I don't like tab for indentation on the basis that, for me, tabs have a very specific meaning:

Carriage (or cursor, if you prefer), go to the next tab stop. [2]

For typewriters it means to go "literally" to where the next stop is. For text editors (at least for emacs)[1], it means to insert as many spaces as needed so the next column on the current line matches with the last non-space column on the previous line.

So, in the same way I use the table tag for tabular data in markup, I use the tab key for tabular text.

[1] http://www.jwz.org/doc/tabs-vs-spaces.html [2] http://en.wikipedia.org/wiki/Tab_key#Origin

Post reply on HN