Anonymous 01/22/25(Wed)13:28:35 | 56 comments | 5 images
Is your code reviewer super anal about spaces between functions, tabs vs spaces, etc.?
My new boss is and I hate it.
My new boss is and I hate it.
Anonymous 01/22/25(Wed)13:30:49 No.103996553
its 2026-1 anon there are extensions that make this literally transparent to you and you never have to care about it.
>desired behavior: x
>desired output: y
>desired behavior: x
>desired output: y
Anonymous 01/22/25(Wed)13:35:32 No.103996616
Space fags always gave me the ick. There is a key for this exact purpose and you have to go full autismo on the world because your terminal from 1963 converts it strangely(It will works).
Anonymous 01/22/25(Wed)13:37:11 No.103996635
4 spaces is the sanest option
my boss forced me to go through entire codebase and rename all C++ source files to .cxx and headers to .h, and rename everything snake_case - global and local variables, types, classes, functions, methods, member variables. few exceptions being CONSTANTS and template Types.
His argument was that C++ stdlib does this naming and that .cpp has collision with C preprocessor files.
My objection that C++ stdlib is the most disgusting project I've ever seen and not worth to be inspired by and that C++ core guidelines recommend .cpp was dismissed.
my boss forced me to go through entire codebase and rename all C++ source files to .cxx and headers to .h, and rename everything snake_case - global and local variables, types, classes, functions, methods, member variables. few exceptions being CONSTANTS and template Types.
His argument was that C++ stdlib does this naming and that .cpp has collision with C preprocessor files.
My objection that C++ stdlib is the most disgusting project I've ever seen and not worth to be inspired by and that C++ core guidelines recommend .cpp was dismissed.
Anonymous 01/22/25(Wed)13:39:08 No.103996659
only indians dont indent properly and miss spaces
Anonymous 01/22/25(Wed)13:40:52 No.103996677
I always hated 2 spaces, such as the standard for Ruby. Come on dude.
Anonymous 01/22/25(Wed)13:49:31 No.103996777
>>103996635
>rename everything snake_case - global and local variables, types, classes, functions, methods, member variables. few exceptions being CONSTANTS and template Types.
Holy based.
>rename everything snake_case - global and local variables, types, classes, functions, methods, member variables. few exceptions being CONSTANTS and template Types.
Holy based.
Anonymous 01/22/25(Wed)13:56:49 No.103996902
>>103996523
I use prettier's default so it's 2 spaces everywhere. Works for me.
I use prettier's default so it's 2 spaces everywhere. Works for me.
Anonymous 01/22/25(Wed)14:00:17 No.103996957
>>103996523
Anyone using tabs is simply a retard like >>103996553 who thinks there's no issue with tabs and formatting.
Anyone using tabs is simply a retard like >>103996553 who thinks there's no issue with tabs and formatting.
Anonymous 01/22/25(Wed)14:04:12 No.103997019
>>103996523
anything discussion about formatting is retarded. use clang tidy to format what you want when developing, then use clang tidy to format what your org requires.
all that being said, there is only one correct answer and it is allman
anything discussion about formatting is retarded. use clang tidy to format what you want when developing, then use clang tidy to format what your org requires.
all that being said, there is only one correct answer and it is allman
Anonymous 01/22/25(Wed)14:07:20 No.103997061
>>103996523
Python: IndentationError on line xyz
Python: IndentationError on line xyz
Anonymous 01/22/25(Wed)14:08:14 No.103997075
>>103997061
shoo bootcampanon
shoo bootcampanon
Anonymous 01/22/25(Wed)14:09:17 No.103997091
>>103996957
Many shit on tabs, yet literally every space codebase I have ever seen has mangled indentation. With spaces is very difficult to keep the indentation consistent as spaces allow the cursor to misaligned, I have seen many examples of indentation that is off by one space.
Many shit on tabs, yet literally every space codebase I have ever seen has mangled indentation. With spaces is very difficult to keep the indentation consistent as spaces allow the cursor to misaligned, I have seen many examples of indentation that is off by one space.
Anonymous 01/22/25(Wed)14:10:00 No.103997104
Anonymous 01/22/25(Wed)14:10:45 No.103997115
>>103996523
What clown company are you working on that you dont have this standardized and automated as a pre commit hook? What the fuck.
What clown company are you working on that you dont have this standardized and automated as a pre commit hook? What the fuck.
Anonymous 01/22/25(Wed)14:15:35 No.103997174
>>103997091
>With spaces is very difficult to keep the indentation consistent as spaces allow the cursor to misaligned, I have seen many examples of indentation that is off by one space.
Don't use a shit editor.
Regardless you're still a fucking retard if you think tabs is good for formatting. Tabs do not translate to a fix number of spaces. You're braindead if you think everyone will have 1 tab = 4 spaces or whatever value of spaces you use to match your formatting.
>With spaces is very difficult to keep the indentation consistent as spaces allow the cursor to misaligned, I have seen many examples of indentation that is off by one space.
Don't use a shit editor.
Regardless you're still a fucking retard if you think tabs is good for formatting. Tabs do not translate to a fix number of spaces. You're braindead if you think everyone will have 1 tab = 4 spaces or whatever value of spaces you use to match your formatting.
Anonymous 01/22/25(Wed)14:23:49 No.103997274
>>103997091
clang tidy
clang tidy
Anonymous 01/22/25(Wed)14:29:01 No.103997340
>>103997174
> Don't use a shit editor
I am not aware of editor that can do it properly. Not sure its even possible.
> Tabs do not translate to a fix number of spaces
This is an advantage, not everyone likes the same indent width, tabs prevent formatting wars.
> Don't use a shit editor
I am not aware of editor that can do it properly. Not sure its even possible.
> Tabs do not translate to a fix number of spaces
This is an advantage, not everyone likes the same indent width, tabs prevent formatting wars.
Anonymous 01/22/25(Wed)14:31:21 No.103997376
Anonymous 01/22/25(Wed)14:32:25 No.103997387
Set your tab stops to two and then tab four times to indent.
Anonymous 01/22/25(Wed)14:32:29 No.103997390
>>103996523
Doesn't matter fuck all when any inconsistencies are fixed by pre-commit or a linter
Doesn't matter fuck all when any inconsistencies are fixed by pre-commit or a linter
Anonymous 01/22/25(Wed)14:33:59 No.103997411
I use spaces because it's the PSR-12 standard, but I don't like it and think tabs are better
Anonymous 01/22/25(Wed)14:47:37 No.103997598
>>103997019
this but kerninghan & ricthie belonging to mental illnesses
this but kerninghan & ricthie belonging to mental illnesses
Anonymous 01/22/25(Wed)14:51:20 No.103997641
>>103996523
Your text editor/IDE should fix that automatically.
Your text editor/IDE should fix that automatically.
Anonymous 01/22/25(Wed)14:53:43 No.103997660
I don't care, you can do either as long as it's a single key stroke. If you press space repeatedly to achieve a single level indent in 2024, then you a retarded gorilla and deserve to be shot on sight.
Anonymous 01/22/25(Wed)14:58:08 No.103997705
>>103997174
>You're braindead if you think everyone will have 1 tab = 4 spaces or whatever value of spaces you use to match your formatting.
It should be set by the project's style guide, not by the developers.
It's important because you don't want every line to change every time someone auto-indents a file.
>You're braindead if you think everyone will have 1 tab = 4 spaces or whatever value of spaces you use to match your formatting.
It should be set by the project's style guide, not by the developers.
It's important because you don't want every line to change every time someone auto-indents a file.
Anonymous 01/22/25(Wed)15:00:27 No.103997734
What kind of 2-bit operation do you fags work at? Every FAGMAN has a style guide and auto-linter for this shit.
Anonymous 01/22/25(Wed)15:55:37 No.103998485
>>103997115
>came up with their own formatting, less readable than the standard
>no automatic formatter
>no linting
>half the devs push to prod without testing
yep, that's my company
>came up with their own formatting, less readable than the standard
>no automatic formatter
>no linting
>half the devs push to prod without testing
yep, that's my company
Anonymous 01/22/25(Wed)15:58:49 No.103998533
the longer I've done this shit the less I care about code style and especially consistency.
Consistency of code style/formatting is so worthless that I immediately think lesser of anyone who gives it so much time and attention.
i.e. this dude's boss >>103996635 and people like him are the biggest brainlets on the planet.
Consistency of code style/formatting is so worthless that I immediately think lesser of anyone who gives it so much time and attention.
i.e. this dude's boss >>103996635 and people like him are the biggest brainlets on the planet.
Anonymous 01/22/25(Wed)16:11:31 No.103998661
Anonymous 01/22/25(Wed)16:26:55 No.103998855
>>103997061
This only happens when Python can't make heads or tails of your indentation; it will try it's hardest to interpret your mess of tabs and spaces, but if your code is something like
it can't, since it can't tell if
would still be wrong, since it can't, at that stage, know this either. By contrast, the following is valid:
This only happens when Python can't make heads or tails of your indentation; it will try it's hardest to interpret your mess of tabs and spaces, but if your code is something like
<tab>if some_condition:
<tab><tab>do_something()
<spaces>do_something_else()
it can't, since it can't tell if
do_something_else()is in the if block or not. Also, this happens at the lexer level, so
<tab>if some_condition:
<tab><tab>do_something()
<tab><spaces>do_something_else()
would still be wrong, since it can't, at that stage, know this either. By contrast, the following is valid:
<tab>if some_condition:
<tab><n spaces>do_something()
<tab><n spaces>do_something_else()
Anonymous 01/22/25(Wed)16:39:00 No.103999028
>>103998485
Damn brother, my condolences. Where I work you can use whatever you want, and when pushing, the pre-commit hooks will auto format it to the company standard.
Damn brother, my condolences. Where I work you can use whatever you want, and when pushing, the pre-commit hooks will auto format it to the company standard.
Anonymous 01/22/25(Wed)17:02:47 No.103999330
Anonymous 01/22/25(Wed)17:07:19 No.103999385
I create Pull Requests, approve them myself and merge because I work basically by myself.
Anonymous 01/22/25(Wed)17:11:45 No.103999429
>>103999330
if you need comments you aren't naming shit appropriately.
num_primes += is_prime(i); /* jfc don't be retarded */
if you need comments you aren't naming shit appropriately.
num_primes += is_prime(i); /* jfc don't be retarded */
Anonymous 01/22/25(Wed)17:12:00 No.103999431
>>103997019
Never seen Haskell style in the wild,
Never seen Haskell style in the wild,
Anonymous 01/22/25(Wed)17:38:41 No.103999786
Anonymous 01/22/25(Wed)17:40:20 No.103999810
talking about code formatting in code reviews is a clear sign of low IQ and incompetence. Code should be automatically formatted before ending up in the repo.
Anonymous 01/22/25(Wed)17:43:05 No.103999839
>>103996523
Yes, he is insanely anal about it and I don't care. I'm not submitting another PR because his autism doesn't align with my formatting. He can do it himself if he cares that much about it. And he often does. My variables are always camelCase unless they're constants, in which case they are SNAKE_CASE. Tabs only, never spaces. K&R style for bracketed statements.
Yes, he is insanely anal about it and I don't care. I'm not submitting another PR because his autism doesn't align with my formatting. He can do it himself if he cares that much about it. And he often does. My variables are always camelCase unless they're constants, in which case they are SNAKE_CASE. Tabs only, never spaces. K&R style for bracketed statements.
Anonymous 01/22/25(Wed)18:53:53 No.104000721
>>103996523
imagine having a code reviewer
imagine having a code reviewer
Anonymous 01/22/25(Wed)19:08:58 No.104000922
>>103996523
If your boss is that anal about it, they should probably have an .eslintrc or .prettierrc or whatever equivalent for the language they're using and enforce the style with a pre-commit hook. Formatting basically does not matter if you have a linter or a pre-commit hook that'll automatically take care of managing it for you, it is a solved problem
If your boss is that anal about it, they should probably have an .eslintrc or .prettierrc or whatever equivalent for the language they're using and enforce the style with a pre-commit hook. Formatting basically does not matter if you have a linter or a pre-commit hook that'll automatically take care of managing it for you, it is a solved problem
Anonymous 01/22/25(Wed)19:10:09 No.104000934
>>104000721
imagine being unemployed, couldn't be me
imagine being unemployed, couldn't be me
Anonymous 01/22/25(Wed)19:12:13 No.104000968
>>104000934
imagine getting paid to read other peoples code
imagine being such a useless incompetent corporate drone that all you do is watch other people work
couldn't be me
imagine getting paid to read other peoples code
imagine being such a useless incompetent corporate drone that all you do is watch other people work
couldn't be me
Anonymous 01/22/25(Wed)19:13:09 No.104000983
>>103999429
nice jeetcode
nice jeetcode
Anonymous 01/22/25(Wed)19:14:36 No.104001002
>>103996523
Who gives a fucking shit? Your IDE can auto format it between one or the other anyways.
Who gives a fucking shit? Your IDE can auto format it between one or the other anyways.
Anonymous 01/22/25(Wed)19:16:53 No.104001028
OP here.
I'm now using Prettier.
Complaining wins again.
I'm now using Prettier.
Complaining wins again.
Anonymous 01/22/25(Wed)19:17:03 No.104001031
>>103997598
k&r is the one and only correct way
k&r is the one and only correct way
Anonymous 01/22/25(Wed)19:23:16 No.104001093
>>103996553
A new kid tried to make a big deal out of this at my job in like 2014 and my director just looked at him dumbfounded after he finished his 5 minute rant and told him "just configure how it displays in your IDE" and then he moved on to the next thing.
A new kid tried to make a big deal out of this at my job in like 2014 and my director just looked at him dumbfounded after he finished his 5 minute rant and told him "just configure how it displays in your IDE" and then he moved on to the next thing.
Anonymous 01/22/25(Wed)19:37:56 No.104001236
>>104000983
its not jeetcode, its branchless counting. go back to yoyr bootcamp
its not jeetcode, its branchless counting. go back to yoyr bootcamp
Anonymous 01/22/25(Wed)19:46:37 No.104001323
>>103997174
>Tabs do not translate to a fix number of spaces
They don't, and that's the best part. It can be 2 spaces, 4 spaces, or whatever you want because there's gonna be assmad faggots like you who think the most important part of the code is the white space to the left of it.
>Tabs do not translate to a fix number of spaces
They don't, and that's the best part. It can be 2 spaces, 4 spaces, or whatever you want because there's gonna be assmad faggots like you who think the most important part of the code is the white space to the left of it.
Anonymous 01/22/25(Wed)19:52:26 No.104001383
>>103996523
tabs for indentation, spaces for aligning
tabs for indentation, spaces for aligning
Anonymous 01/22/25(Wed)19:55:11 No.104001412
>>103996523
The only good language is Perl because whether you like tabs or spaces you can "clean it up" using perltidy with your preferred flags. You can then use your friends perltidy flags before sending it back to them if they prefer their code looks like ASCII bewbies.
No other language is nearly as Diverse, Enjoyable and Inclusive.
The only good language is Perl because whether you like tabs or spaces you can "clean it up" using perltidy with your preferred flags. You can then use your friends perltidy flags before sending it back to them if they prefer their code looks like ASCII bewbies.
No other language is nearly as Diverse, Enjoyable and Inclusive.
Anonymous 01/22/25(Wed)19:58:03 No.104001440
>>104001412
I don't trust a language made by and for witches.
I don't trust a language made by and for witches.
Anonymous 01/22/25(Wed)20:04:19 No.104001520
>>104001440
You're a wizard Harry.
You're a wizard Harry.
Anonymous 01/22/25(Wed)20:05:17 No.104001532
>>103996635
Bruh, just write a script to do that exactly.
Bruh, just write a script to do that exactly.
Anonymous 01/22/25(Wed)21:46:31 No.104002653
I just get sick of some of my coworkers putting extra spaces at the end of the line and other small stuff like that. No clue how they get it past the lint, but I never configured that stuff.
It really just shows a lack of attention to detail, what else did they miss? (a lot)
It really just shows a lack of attention to detail, what else did they miss? (a lot)
Anonymous 01/22/25(Wed)21:56:17 No.104002772
>>103997019
Lisp style should be
anyway Lisp style is actually much better when actually used with Lisp parentheses
Lisp style should be
while (x == y)
{func1();
func2();}
anyway Lisp style is actually much better when actually used with Lisp parentheses