Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • 6
    This is bad. Even beginner level textbooks don't do this atrocity. "Code is read 10 times more than it's written"... all the more reason not to waste the reader's time with this code cruft. Commented Apr 4, 2012 at 20:20
  • @trinithis What if you have 20-case switch statement? Sometimes you need to support 20 different options, and it's better to have them gathered in one place than "refactored" into some multi-level decision-making scheme. Commented Apr 5, 2012 at 10:07
  • i believe this is a practice by coders who underestimate peers :) that others are not smarter enough to read the code unless. gnerally i am against this practice, but okay if someone does it coz there is a jungle of }s that makes it hardly readable. i dont do that anyways! Commented Apr 5, 2012 at 11:15
  • 1
    @trinithis It's not about whether it's bad or not, it's about effective ways to help people get better so they grow through it. Being effective > being right. It's also a perfectly sensible thing to do if, say, you're refactoring legacy code that's even more of a mess. Sometimes bad things can make better interim steps and lead to something even better than that. Commented Apr 5, 2012 at 11:35
  • 1
    @trinithis Sorry, I can't work out what you mean when it's all on one line like that. I think I mentioned that there are also other ways of refactoring code that devs doing this could learn. Commented Apr 5, 2012 at 17:34