Earlier quoted context omitted.
It's an argument for clear code that's readily understandable by other people. It's not an argument for any particular technique for achieving that goal. I've never seen any programmer seriously suggest that code should be deliberately made difficult to understand.
I can't agree with you emphatically enough about this. Cargo cult commenting is one of the easiest ways to damage the readability of a codebase. Comments should be an edge-case solution for explaining unusual quirks, not the go-to approach for explaining the entire codebase. Using comments to explain what the code is up to is like using exceptions for flow of control. A large proportion of the comments I see should a…
Why was Pinball removed from Windows Vista?
141–149 of 149 posts
Re: Why was Pinball removed from Windows Vista?
#142Earlier quoted context omitted.
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 thi…
This ranting was in a professional environment, or some kind of open source project..?
Re: Why was Pinball removed from Windows Vista?
#143Earlier quoted context omitted.
This point gets brought up a lot, but I'm not going to complain at all. In fact, just 5-6 months ago I used to be one of those programmers who would do # gets the xml def get_xml(): It took comments like this to help me realize just how silly the whole thing was. Now I write as much self-documenting code as I can, but comment as needed.
Sure. Comment should be "why I did this", and code should be "how I did this", some people just write in "what did I do" and walk away thought they have comment Code took from a project I'm working with: #End of package
the problem starts when the 'why' doesn't match the 'how'...which one is "correct"?
Re: Why was Pinball removed from Windows Vista?
#144> nobody at Microsoft ever understood how the code worked (much less still understood it), and that most of the code was completely uncommented, we simply couldn't figure out why the collision detector was not working. Heck, we couldn't even find the collision detector! This continues to be one of my pet peeves, particularly with code samples and a lot of what is posted on Github, even major libraries. Almost no comm…
> // Bounds-check velocities
No, that is an example of a comment of a region that should have been a separate method/function.
Re: Why was Pinball removed from Windows Vista?
#145Earlier quoted context omitted.
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.
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.
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?
#146> nobody at Microsoft ever understood how the code worked (much less still understood it), and that most of the code was completely uncommented, we simply couldn't figure out why the collision detector was not working. Heck, we couldn't even find the collision detector! This continues to be one of my pet peeves, particularly with code samples and a lot of what is posted on Github, even major libraries. Almost no comm…
>That's ridiculous. However, something like this is useful: > // Bounds-check velocities No, that is an example of a comment of a region that should have been a separate method/function.
If you throw methods and functions at everything all you are doing is adding the processing overhead of the entry and exit from the method or function. These are not magical entities. There's a time, a place and cost to using them.
Having come up from assembly and, in general, low level coding, one becomes very aware of what is being created behind the scenes. Unless something like this contrived bounds-check test will be used multiple times across a module or modules there's no reason whatsoever to add the overhead of entering and exiting a function for a simple couple of if/else-if/else statements.
I see this all the time. Everything has to be an object and everything has to be a class with a pile of properties and methods. No it doesn't. Massive projects --critical projects-- have been done over the years without any of that. Be careful not to engage in creating a monument to a coding paradigm rather than a tight, fast, practical and sensible solution to a problem.
Re: Why was Pinball removed from Windows Vista?
#147Earlier quoted context omitted.
>That's ridiculous. However, something like this is useful: > // Bounds-check velocities No, that is an example of a comment of a region that should have been a separate method/function.
Not really. If you throw methods and functions at everything all you are doing is adding the processing overhead of the entry and exit from the method or function. These are not magical entities. There's a time, a place and cost to using them. Having come up from assembly and, in general, low level coding, one becomes very aware of what is being created behind the scenes. Unless something like this contrived bounds-c…
That doesn't mean to abstract for the sake of abstraction but to choose the right abstraction. Writing code so that it is easy to reach the right abstraction helps a lot.
Re: Why was Pinball removed from Windows Vista?
#148What ever you do DO NOT press F4 for fullscreen, it botches dual-monitors on Gnome. Took me 20 min. to get back up and running again.
BUT, Pinball works :)
Re: Why was Pinball removed from Windows Vista?
#149Earlier quoted context omitted.
Nah I didn't think that at all, it was clear from the way you said "minimal commenting". I just have an axe to grind when it comes to comments of the form // assign the integer value 10 to the variable x x = 10
What's really annoying is that most of the time you see this kind of comment there is no explanation why 10 was chosen.