Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
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. -
@leduyquang753 exactly. The very fact that @irene had to ask indicates serious problems
-
@irene because you couldn't tell what the code does by just looking at it, w/o diving into implementation and analysing it
-
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. -
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.
-
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*
Related Rants
Should I merge the two lines, or keep them as is?
rant
formula
long
java