3 ms·
"Everybody's code should look the same. Ideally, there should be no way to look at lines of code and recognize it as "Fred's code" by its style." This is how o
by brudgers 14y ago
"Everybody's code should look the same. Ideally, there should be no way to look at lines of code and recognize it as "Fred's code" by its style."
This is how one endeavors for mediocrity within a creative pursuit. Crap gets polished to a bronze sheen.
- Kaali 14y agoI would prefer that the creativity in software development does not come from where you put your parenthesis or spaces. The creativity is in the solutions.
- mikeash 14y agoThe key words here are "by its style". There's still plenty of room for creativity in how you structure the code, how you approach solutions, etc., which is where the creativity belongs. Mediocrity is not overcome with creative spacing.
- Aykroyd 14y agoThat argument doesn't make sense. My outlet for creativity is the content of my code not when new lines happen or how I indent. On the other hand, if everything in the codebase is formatted uniformly it's a lot easier to scan through and you don't end up with diffs filled with reformatting kruft as each team member walks over the others' formatting style. If you're feeling extra creative, you could always change your font, font size, and syntax highlighting scheme. ;)
- pmelendez 14y agoHe could quote a better example, but I think the document goes deeper than just formatting style. From the article's excerpt "Principles": * Don't be "clever" — do the simplest thing that could possibly work properly. * Be precise. * Be concise. * KISS — Keep It Simple, Stupid. * Use the smallest hammer for the job. --- They are indeed asking for uniformity against creativity. Which is not a bad thing for corporations (IBM have very strong guidelines for years) but definitely takes away that "hacker" aura that we gave to Google a few years ago. Any googler that can put this in context?
- columbo 14y ago> They are indeed asking for uniformity against creativity Well, I mean you could argue that this is clever, creative and beautiful ( http://thedailywtf.com/Articles/Confessions-rachetingDateObject.aspx http://thedailywtf.com/Articles/Confessions-rachetingDateObj... ). To quote one of the comments "If I lean close enough to the PC's speaker, I can hear the tiny clicks of all those wheels spinning round - 'sbeautiful." I don't think google is really arguing against creativity, rather saying "don't be creative for creativity's sake". I remember having to install Quartz Scheduler so it would hit a single servlet every night at 1am. That's _ALL_ Quartz was used for. When I asked about using cron the response was "well that wont scale"... this application had been around for fifteen years and during that time there was only one batch process... clever indeed!
- pmelendez 14y agoThere always would be anecdotal cases and interpretations. That's why I asked an open question to a googler who could set the document into a context. I also have cases of people doing a lot of ad-hoc code because it was easier (small hammer to the job) and then resulted in a pain code to read that could be prevented with a clever system. But I am agreed with you that the whole thing is arguable and subjective
- jimbokun 14y agoWhich of those principles is at odds with creativity? Is verbose code positively correlated with creativity? Code more complex than required? Ambiguous code?
- pmelendez 14y agoI already told in another reply that it is subjective. But when they say "KISS Keep it simple stupid" one programmer could interpreter that as "OK for this messages management system what is more simple than a huge list of if statements" and another one could interpreted the same principle as "Hmm OK, I will have a list of closures to reduce verbosity"
- 14y ago