Live data from Hacker News

Art of writing unmaintainable code.

thc.org

31–39 of 39 posts

Re: Art of writing unmaintainable code.

#31

" 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…

I've done this a couple of times just through sheer stupidity. Then I forget about it.

It always makes me laugh when my colleague ends up going through it to add another method and can't get his head around the fact one of mine has a hidden dependency obscured by an autoloader, with irreverent comments like `// lets get some validation up in this bitch` littered all over it.

PHP autoloaders and magic methods are a great source of such frustration when pulled off right.

Re: Art of writing unmaintainable code.

#32
post #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 na…

I think the rule is that very short variable names are a lot more usable in very short scopes (so you don't have time to forget what they denote). I use a lot more short scopes in Haskell than in less-functional languages, though I'm not quite sure why.

Re: Art of writing unmaintainable code.

#34

Earlier quoted context omitted.

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…

Was this an electro-mechanical typewriter or a purely mechanical one?

Re: Art of writing unmaintainable code.

#36
>> "People paid no attention when I harped about how to write __maintainable code. I found people were more receptive hearing all the goofy things people often do to muck it up."

- when we're told to write maintainable code :: MY CODE IS GOOD !! I'm sure Bob/Igor/Venkatachalapathy (coworkers) understand it just fine

- when we're told - these are the tricks of unmaintainable code .. :: HOLY COW !!! so THIS is what Bob/Igor/Venkatachalapathy has been using against me !! no wonder my promotion's been slow

Re: Art of writing unmaintainable code.

#37
Over engineer a 100,000 line program like it's 100,000,000. (In my classes, we were graded on a curve on how short our programs were. That's how essays, websites and programs should be graded.)

What? Someone doesn't think a 1,000 line demo application program should use globals? Retard.

It's a cheap shot to criticise Windows for 16-bit legacy issues. Should they have over-engineered it? It's possible an over-engineered project would have failed. (Win 16) I thought of many features after the start -- I did not spec them. Before you criticize a project that has aged, humble yourself because it's long-lived. (Stupid punks criticizing Microsoft.) Only stupid academics don't respect success in the market.

http://wiki.osdev.org/Projects

http://lmgtfy.com/?q=64-bit+operating+system

I worked at Ticketmaster -- think about the cost of entry, the huge amount of competition in the sector and that they rose until they were sued for being a monopoly.

http://www.wired.com/magazine/2010/11/mf_ticketmaster/all/1

-------------------

Some people have small minds. I wanted to start absolutely with a fresh slate. Source code can have graphics. Once I explained that it has links like html and soon roared with laughter at small minds trying to make sense of that. Imagine a Microsoft Word document as source code. I'm cracking-up knowing that concept will not be understood.

I didn't really set-out to keep people from walking-off with my code, but laugh when I see the ways I suceeded... and maybe extended them. A major selling point is my compiler -- that separates me from amateurs... like the Linux kernel, that lacks a compiler. How depressing it would be to make a product who's only advantage is cost and that does no innovation.

Anyway, I want to highlight my compiler's existence and the fact source code is not limited to ASCII -- that it can even have superscripts and subscripts in names... so I very intentionally and deviously made a point of using pi and inf symbols. Helps prevent people walking-off too.

----------------------

God says... C:\TEXT\QUIX.TXT

ur and less justice the writings of others. It is my earnest hope that Your Excellency's good counsel in regard to my honourable purpose, will not disdain the littleness of so humble a service.

Miguel de Cervantes

VOLUME I.

CHAPTER I.

WHICH TREATS OF THE CHARACTER AND PURSUITS OF THE FAMOUS GENTLEMAN DON QUIXOTE OF LA MANCHA

In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the

-----------------------

That's not spam to me. "Lance" was the name of our grader in my class at ASU which was graded by code size. Actually, I only had one class graded on a curve based on code size and I got an A. It's was hardly competition -- I had been and was employed at Ticketmaster working on their VAX operating system in ASM. (My classmates were simply not in my league. That was my undergrad stuff, though.)

-------------------

I love Jesus!

36 He told them this parable: “No one tears a piece out of a new garment to patch an old one. Otherwise, they will have torn the new garment, and the patch from the new will not match the old. 37 And no one pours new wine into old wineskins. Otherwise, the new wine will burst the skins; the wine will run out and the wineskins will be ruined. 38 No, new wine must be poured into new wineskins. 39 And no one after drinking old wine wants the new, for they say, ‘The old is better.’”

--------------------

I win a hundred lottery grand prizes a day. I'm not worried about justice. I laugh at my enemies because they typically worry more about public opinion than God. Seek first the kingdom of God... and God will give you patent ideas faster than your enemies can... Eye has not seen and ear has not heard what God has in store for those who love Him. Crazy-ass shit. It's hard to forget money, though... and respect from men. Really hard.

God says... C:\TEXT\QUIX.TXT

squat figure of the new governor astonished all those who were not in the secret, and even all who were, and they were not a few. Finally, leading him out of the church they carried him to the judgment seat and seated him on it, and the duke's majordomo said to him, "It is an ancient custom in this island, senor governor, that he who comes to take possession of this famous island is bound to answer a question which shall be put to him, and which must be a somewhat knotty and difficult one; and by hi

God says...

Re: Art of writing unmaintainable code.

#38
post #22

Earlier quoted context omitted.

I agree -- I hate these "negative" lists because there's an infinite number of ways to screw something up. Enumerating them isn't helpful.

Enumerating some of the ways to screw things up may be helpful in that it allows a reasonably intelligent reader to intuit the underlying connections and apply that intuition to a broader set of coding circumstances.

sure, i agree. i just think things like weak names, hungarian notation, brace preferences and lispy one-liners have no objective impact on the complexity of a system.

Re: Art of writing unmaintainable code.

#39

Earlier quoted context omitted.

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…

Was this an electro-mechanical typewriter or a purely mechanical one?

I started on a purely mechanical, but then, as the course progressed, changed to an electro-mechanical one.
Post reply on HN