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
-
C0D4669443yWait what?
You mean something like;
soSomeMethod {
}
Instead of
someMethod {
}
or even
someMethod
{
} -
Use proper indentation and syntax highlighting then. Every decent editor can highlight indentation/scopes and bracket pairs obvious enough to see them from the next room through the wall.
-
@molaram Because the build one block. If you have this:
int function(void)
{
return 0;
}
You "see" a imaginary line between the { and } and all the code belonging to that block is right to that line. In comparison if you have:
int function(void) {
return 0;
}
This imaginary line is diagonal and goes over the other text. This makes it annoying to read, ugly and no, just no. -
@deadlyRants The problem is not the editor. The problem is the formatting, there is nothing syntax highlighting or indentation highlight like that can change. If you can't look at the code but need some extra indication from the editor to see the indentation, the indentation style is bad. A picture to illustrate the problem (editor syntax highlighting removed):
-
@happygimp0 Why are you going on about imaginary lines when every decent fucking editor can literally show such lines automatically? Just turn that on and you've got all the straight lines you need.
Use whatever makes you happy, just know that syntax highlighting made this weird coding style obsolete for everyone else. -
I don't have an issue with this either way (i.e. both straight and diagonal are about equally readable for me) even when using an editor that doesn't show scope. It's pretty easy to imagine the line from the first character of the first line to the ending brace on the last line in a "plain" editor too.
I only care that a project is consistent about using them.
Related Rants
We have 4k Monitors and SSDs with more than 120 GB, why there are still new projects that use a formatting style that doesn't have a clear relation of the opening { and corresponding closing }. i.e. put them either on the same line or column?
Please don't write code where the imaginary line between the { and } goes diagonally over other parts of the code. It makes it unreadable and my brain hurts from looking at it. Its better to have readable code and "waste" some lines and bytes for code that is easier to read.
rant
formating
indentation