News for hackers. Stuff that matters.
Re:Why was Pinball removed from Windows Vista? by mgkimsal on Tuesday December 18, 2012 @01:23PM (#4938750)
"I've never seen any programmer seriously suggest that code should be deliberately made difficult to understand."

Then you've not worked with some of the people I've worked with. The clever "it was hard to write, it should be hard to read" mantra has been thrown out by a few ex-colleagues trying to be clever, and a couple of them really meant it. Whether it was a hatred for others, or a misguided attempt at "job security", I'll never know, but some of these people do exist.

Often, however, the same effect is had under the guise of "clever hacks" - look how clever and awesome I am! What? Of course everyone else can read and understand this (they just have to understand that I compiled this with my own custom-built compiler I rolled myself on gentoo so I could squeeze out an extra .0001% improvement!)

Re:Why was Pinball removed from Windows Vista? by com2kid on Tuesday December 18, 2012 @04:26PM (#4939686)
"Often, however, the same effect is had under the guise of "clever hacks" - look how clever and awesome I am!"

Sometimes I write code like that. Then I delete it and write it the proper way.

Clever code is code you will not be able to understand in the morning.

There is Kernighan's adage

"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it."

Indeed I fear I wrote code like that yesterday (a particular problem that, after talking to 3 other engineers, everyone agreed did not have a simple solution) that I am going to have to debug today. I am not looking forward to it!

Re:Why was Pinball removed from Windows Vista? by mgkimsal on Tuesday December 18, 2012 @04:32PM (#4939702)
useful thoughts. it reinforces my view that it's really the intent that bugs me. I've dealt with crap code, littered with comments like "I'm sorry, didn't know what I was doing, etc". The person/people knew they were in a tough spot. In other cases I've dealt with crap code with random comments like "Java sucks. Sun sucks. Everyone using Java sucks and is stupid - Ruby is the only true language, and it sucks that this is in Java" and "if you're too stupid to understand this, quit right now and tell so-and-so to go hire a real programmer".

Just... garbage attitude oozing through the code at every line - difficult to work with.

Re:Why was Pinball removed from Windows Vista? by goostavos on Wednesday December 19, 2012 @01:04AM (#4941401)
This ranting was in a professional environment, or some kind of open source project..?
Re:Why was Pinball removed from Windows Vista? by mgkimsal on Wednesday December 19, 2012 @07:33AM (#4942279)
"professional" env.
Re:Why was Pinball removed from Windows Vista? by bunderbunder on Tuesday December 18, 2012 @01:58PM (#4938919)
One guy I worked with would do it to protect his bailiwick. He was intensely territorial, and knew that writing code so ugly that nobody wanted to even look at it, much less take the time to understand it, was an effective way to make sure that nobody else on the team would ever touch anything he wrote.
Re:Why was Pinball removed from Windows Vista? by damian2000 on Tuesday December 18, 2012 @09:37PM (#4940875)
Sounds like "mortgage code"... code that is intentionally so complex that noone in the company other than yourself can maintain it, hence you end up with a job for life that pays your mortgage.
Re:Why was Pinball removed from Windows Vista? by bunderbunder on Wednesday December 19, 2012 @10:46AM (#4943055)
Ha. Unfortunately for him, it became clear that most of his code was all sound and fury, calculating nothing. Well, that and he took forever to fix bugs because he couldn't really understand it either.

He was soon out on the street, and the rest of the team's policy of just rewriting bits instead of debugging them (it never took very long, and frequently resulted in 1/10 as many lines of code doing twice as much) had soon swept away most of his footprints.

Re:Why was Pinball removed from Windows Vista? by mikeash on Tuesday December 18, 2012 @01:47PM (#4938851)
Maybe some awful programmers do advocate for it, but that doesn't really change my overall point. There is no serious argument in the community, at least, over whether code should be readable. The argument is merely about how to make it readable, and this story does not argue for any particular approach there.