Hacker News new | ask | show | jobs
by fournm 4467 days ago
This isn't always possible in every case--it's not too hard to imagine a lot of trivial assignment all going on at once, that isn't immediately obvious what it is or why on earth it exists.

  //really bad example, just something really repetitive
  function main()
    // set up month boundaries
    janStart = blah;
    janEnd = blah;
    // ...
    decStart = blah;
    decEnd = blah;
  end
where it's not too hard to imagine many languages without great pointers needing to keep that inline to avoid making all of those variables global. In some (hopefully most) cases just better design in general can get around it, but I wouldn't always count it out immediately.

edit: oops, formatting fail.

1 comments

Return an array or hash?
Or just write a comment...
In comparison to refactoring into functions, adding comments offers:

-similar level of abstraction -much worse readability -much worse modularity