12

Should I merge the two lines, or keep them as is?

Comments
  • 14
    Please split them in more then two linesπŸ˜‚
  • 0
    Depends on if you want to do logging/debugging the function or not.
  • 1
    @irene A height generator.
  • 17
    That's unmaintainable write-only code.
  • 2
    I don't know if this is applicable to an IDE as I'm a designer and not a a dev.
    In print design/typography the rule of thumb is that the optimal reading length is around 68-75 characters per line. (Or about 9-13 words). Font size is determined by text width. So if you have a text width of 120mm and you want 12 words per line, your font size should be choosen accordingly.
    But this is not strict rule.
  • 2
    Plz use more memory to improve readability
  • 3
    @leduyquang753 exactly. The very fact that @irene had to ask indicates serious problems
  • 0
    @irene why the owl? Problems are not with you. With the code.
  • 3
    @irene because you couldn't tell what the code does by just looking at it, w/o diving into implementation and analysing it
  • 3
    Psh, could have written it as a single line... what a waste
  • 1
    @heyheni yes, I do a blue vertical column at 75. I try to not go past it.
  • 0
    @bkwilliams cool, good to know! πŸ™‚
  • 0
    @Froot 31337 πŸ˜ŽπŸ˜„
  • 4
    I have some issues with this method:
    - getters should always only return their values and not compute them
    - magic numbers are the devil (32, 70, 1024... where do they come from and why?)
    - The return value computes even more, the computed return value should be a single variable here

    All in all what I would change is to cap the different operations into smaller, well defined methods and to extract all seemingly random numbers to constants which have a descriptive name. Also instead of getHeight it should be computeHeight or similar.
  • 1
    How should someone understand these calculations when working from home for example? Not just one comment explaining a bit, random numbers, and long two lines.
  • 1
    Do just a simple split.

    Split this lines into 4 classes. :P
  • 0
    Join it, make it waaaay longer, cut it at 80 characters and add whitespaces so you can make ascii art.

    *someone with an autoformatter edits the file*
Add Comment