← Home ← Back to /g/

Thread 106302748

108 posts 24 images /g/
Anonymous No.106302748 >>106303322 >>106305000 >>106305407 >>106305459 >>106305607 >>106305654 >>106305824 >>106306694 >>106307482 >>106308175 >>106317492 >>106317721 >>106317825 >>106318462
Why do people name their structs/classes in snake_case? No other language does this and no one likes confusing functions for classes.
Anonymous No.106302763
most cniles have brainworms and inertia between c++ users being mostly cniles. thank god java, c#, and rust did away with this snake_case class brainrot
Anonymous No.106302769
Rust doesn't have this problem.
Anonymous No.106302839
midwits love shitting on java being a jeet language yet even they managed to get this right
c++ has the most fragmented style and naming conventions and it is fucking awful
you can barely write any program with external dependencies without having to use their weird naming conventions in your code
that or spend hours writing a wrapper over their library so you can follow your own conventions, and then have to update it every time that library updates
this language is a clusterfuck and you should just use rust which at least standardises everything unlike the fake standardisation the committee has
also snake_case for structs and classes is gay
Anonymous No.106302854
Honestly, I don't know. All the C++ style guides and clang-format suck too.
Anonymous No.106302872 >>106306643
Bjarne doesn't even use snake_case class names in his books. He literally names all his classes in PascalCase. Does the committee just all have brain parasites?
Anonymous No.106302929 >>106302949 >>106302951 >>106305274
very organic pointing out a non-issue then telling people to use rust instead you got there
Anonymous No.106302931 >>106302949
there is nothing wrong with writing using statements in c++
if you still use headers in 2025 then thats your problem too
Anonymous No.106302949 >>106302972
>>106302929
It is a major issue though.
>>106302931
I don't even think internal M$ wage cucks use modules though and msvc is probably the only working implementation.
Anonymous No.106302951 >>106302981 >>106302982
>>106302929
OP did not mention Rust once, take your schizo meds.
>muh three people replied shilling rust
The simplest fix is to get everyone to stop being retarded with naming conventions, not migrate to another language.
Anonymous No.106302972 >>106302992
>>106302949
i use modules with clang
msvc sucks jeet cow dung
and headers unironically suck, modules are poorly designed but they are 100x better than using headers
Anonymous No.106302981
>>106302951
You never will. Unless it's made a standard that's a default warning on every compiler, this shit will keep happening. I just copy Rust naming idioms now. Still fighting with my clang format config too.
Anonymous No.106302982 >>106303013
>>106302951
>ignoring the fact there's barely more than a minute between posts
uh huh, I'm the schizo, sure.
Anonymous No.106302984 >>106303011
no one uses microjeet compilers in 2025 bro
MSVC hasnt been updated since, like, ages ago
they still dont even implement c++23
Anonymous No.106302992 >>106303037
>>106302972
Extreme levels of doubt, but if so, good luck to you.
Anonymous No.106303011 >>106308144
>>106302984
Anyone on windows is at least using the msvc linker unless you're a mingw tard.
Anonymous No.106303013
>>106302982
>all posts made between 1-3 minutes of each other are samefagging
yeah im starting to suspect youre a glowie committeenigger trying to derail threads criticizing c++
Anonymous No.106303037
>>106302992
https://arewemodulesyet.org/tools/
Modules on Clang are in a usable state apparently. Not sure what they mean by "partial" but Clang seems to be able to compile module projects now.
Anonymous No.106303067 >>106303186
snake_case in classes is correlated with either transgenderism or sub-70 IQ.
Anonymous No.106303152
do any of you even use c++ or are you just looking for an excuse to whine and shill rust
Anonymous No.106303186 >>106303195
>>106303067
Caring about code style at all is low-IQ. There, i said it. As long as it's consistent, who the hell cares. When working on a project, you should either adopt the style of the project or create your own and stick with it.
Anonymous No.106303195 >>106303342
>>106303186
It does matter if you include external dependencies which have their own autistic style guides that you have to either accept or write a wrapper over to conform to your own.
Anonymous No.106303322 >>106303353
>>106302748 (OP)
I don't so why would I care about projects I don't work on? camel case = master race
Anonymous No.106303342
>>106303195
It doesn't matter if you only need to use things from that library a few times.
If you're really that autistic about how pretty your code looks instead of writing code that does it's job then you do the wrapper thing, but you're just wasting time for something that won't affect your final product at all, so it's 100% on you and you're just a whining manchild.
Anonymous No.106303353
>>106303322
camelCase for functions and PascalCase for classes.
Anonymous No.106303425
indians
Anonymous No.106303654
Cniles are cancer
Anonymous No.106304977
What irritates me is devs who write class names in PascalCase in other languages, but for some reason decide to use snake_case in C++. What the fuck, why?
Anonymous No.106305000 >>106305169
>>106302748 (OP)
Agreed. I prefer camel case
Anonymous No.106305169 >>106305199
>>106305000
camelCase makes sense for functions but classes ought to be PascalCase
Anonymous No.106305199 >>106305226
>>106305169
Oh yeah I do that too. PascalCase for classes, camelCase for functions.
Anonymous No.106305226 >>106305274
>>106305199
Java got things right, I hate snake_case but I put up with it because you can't alias functions with using like you can with classes
Anonymous No.106305274
>>106305226
Why do you guys even use it? I work at a company that writes only using camelCase and PascalCase.
>>106302929
I fail to see the issue too. Just write code whoever you want, I don't see why people feel the need to use snake_case
Anonymous No.106305350 >>106305541 >>106305663 >>106308382
>Vector
now I have to press shift
>vector_t
even worse
>vec
too short, unless you are doing vec2, vec3, and so on.
>vector
perfect

>but muh Vector vector
unreadable jeetshit, use vector v, w, x, y, z etc.
Anonymous No.106305407 >>106305549 >>106305554
>>106302748 (OP)
Anything other than snake_case is for soulless zoomer and millenial bugmen trying to find meaning in life by capitalizing things. It's readable and easily typeable retards.
Anonymous No.106305459
>>106302748 (OP)
type Ada_Supremecy is record
Updoots : Integer range 1 .. 999;
end record;
Anonymous No.106305541 >>106305789
>>106305350
>vector better than Vector
kys jeet
Anonymous No.106305549
>>106305407
holy shit fucking kill yourself subhuman
Anonymous No.106305554
>>106305407
holy shit fucking kill yourself subhuman
Anonymous No.106305607
>>106302748 (OP)
I don't an the Qt framwork doesn't
Anonymous No.106305617 >>106306038
what the fuck is the appeal of naming your classes the same way as your functions
it looks ugly and no one can tell it is a struct and not a function
why do people do it
Anonymous No.106305649
CamelCase is for people who also need syntax highlighting with more than 3 colors a.k.a. retards.
Anonymous No.106305654 >>106305677 >>106305683 >>106306564 >>106310963
>>106302748 (OP)
PascalCase for structs/classes/typedefs. (snake_case allowed here only for library data types (time_t, pthread_t, uint8_t, etc.)).
snake_case for variables and functions.
UPPERCASE for const/macros.

Simple as.
Anonymous No.106305663 >>106305789
>>106305350
>no TObject
You are a disappointment for then human race
Anonymous No.106305677
>>106305654
>(snake_case allowed here only for library data types
That is not "snake_case" it's just a suffix "_t", I mean it's not p_thread_t. C stdlib is very spartan in that regard
Anonymous No.106305683 >>106305815
>>106305654
>_t
>at all
kys
Anonymous No.106305789 >>106305881
>>106305541
only jeets use java which has that syntax jeet
C is snake_case

>>106305663
another salty jeet
Anonymous No.106305815 >>106305905
>>106305683
_t suffix is reserved in posix to allow future extensions without colliding with standard-compliant app code. its a natural extension of c standard's _t type usage. thats why posix types use it.
i hope that cleared it up. i understand, standards are something only white men care about.
Anonymous No.106305824 >>106305862
>>106302748 (OP)
>Why do people name their structs/classes in snake_case?
because the C++ committee in their infinite wisdom decided to do it that way, and they don't want to have their code base littered with a mixture of two different naming conventions.
Anonymous No.106305862 >>106305895
>>106305824
then they should undo it and change it
use the preprocessor for macros to re-enable aliases for the old types, simple as
Anonymous No.106305881 >>106305951 >>106306579 >>106308412
>>106305789
>C is snake_case
java is made by and for white men
OOP is the objectively superior way to organise code
proceduraltrannies are 90% of the time jeets pretending to be le h4x0rs by using muh kali and writing in muh low level C
using malloc and free doesnt make you smarter than anyone else fag
C is just an objectively inferior language in all measures
Anonymous No.106305895
>>106305862
kek. good one. the c++ committee never re-visits anything. you get what you get, and it's for life.
Anonymous No.106305905
>>106305815
>its a natural extension of c standard's _t type usage. thats why posix types use it.
The C++ standard library is littered with _t nonsense. Look at any header and you will find _t symbols.
Anonymous No.106305951 >>106306595
>>106305881
>OOP is the objectively superior way to organise code
i really should leave /g/
Anonymous No.106305992
Rust won by making these all compilation warnings.
Anonymous No.106306038 >>106306595 >>106311566
>>106305617
Function names describe actions.
Class names describe objects.
If you can't tell which is which then the only language you should be learning is English.
Anonymous No.106306564 >>106310963
>>106305654
>UPPERCASE for const/macros.
snake_case enjoyer here, but I still do this. Old school cheers, friendo. zoomzooms will never understand.
Anonymous No.106306579 >>106306615
>>106305881
>OOP is the objectively superior way to organise code

If there was ever a reason to unironically kys, this is it.
Anonymous No.106306595 >>106306606
>>106305951
Yes, go back to India gojeet proceduraltranny.

>>106306038
>saar, you should not be able to instantly distinguish between functions and classes, saar, me english very good because i wasting 1 or 2 seconds parsing the context of the code in brain, saar
Kill yourself ESL streetshitter.
Anonymous No.106306606 >>106306615 >>106306624
>>106306595
Give one (1) reason why code should not be aggregated between common properties and common behaviours, and have objects inheriting behaviours and properties from other aggregations.
You probably have no argument besides "reddit told me java is the durgasoft language and only high schoolers use java as an intro language, me very smart for being a proceduraltranny"
Anonymous No.106306615
>>106306606 (me)
meant for >>106306579
Anonymous No.106306624 >>106306674
>>106306606
This is the plea of a programmer who has never worked on a codebase of any significance. A beginner who can understand the most rudimentary ideas behind inheritance, but doesn't have the experience or talent to see how quickly it falls apart at even modest scale.
Anonymous No.106306643
>>106302872
> Does the committee just all have brain parasites?
That's a rhetorical question, amirite?
Anonymous No.106306674 >>106306701
>>106306624
>avoiding the question
I accept your concession proceduraltranny
Anonymous No.106306694
>>106302748 (OP)
>no one likes confusing functions for classes.
yes, which is why I do
PascalClassCase
functionCamelCase
variable_snake_case
Anonymous No.106306701 >>106306734
>>106306674
> Conceding to the hyperchad who retired at 50.

Good luck, my little level 4. I'm sure you'll do fine.
Anonymous No.106306734 >>106307244
>>106306701
Sure, whatever helps you sleep at night Prajesh
Anonymous No.106307081 >>106307224 >>106313857
because snake case looks the best, capital letters are ugly and annoying to type
Anonymous No.106307224
>>106307081
lower case letters are fucking ugly
Anonymous No.106307244 >>106307253
>>106306734
What makes me sleep at night is my 40 years of uninterrupted retirement lil zoom.
Anonymous No.106307253 >>106307285
>>106307244
you probably live in the slums of mumbai and shit near a train track
Anonymous No.106307285 >>106307372
>>106307253
> I love OOP based languages!
Anonymous No.106307335
My default in any language is

camelCase for variables.
PascalCase for functions.
CONSTANTS

Pretty much it. In C++, I heard the reason for camelcase functions was to keep things consistent with what's a function and what isn't. It doesnt bother me to use camelCase for functions in C or C++. I can change my style between languages. I don't know why it's hard for others to do. High iq and all.
Anonymous No.106307372
>>106307285
>muh durgasoft
Notice how any time you point out the retardation of constricting yourself to using only procedural programming gojeets come out of the slums of Mumbai to start spamming
>saar! actually you are the pajeet not me! look at this durgasoft ad! you probably went to durgasoft, saar!
Pathetic
Anonymous No.106307455 >>106308394
This whole thread is jeets accusing other jeets of being jeets.
Just call each other dalits or benchods or whatever at this point.
Anonymous No.106307482 >>106307921 >>106308430 >>106316179
>>106302748 (OP)
there was a study done that revealed it is easier to read camel case over other notations.
hello_this_is_a_world();
HelloThisIsAWorld();
HELLOTHISISAWORLD();
hellothisisaworld();

which one is easier for you to read?
Anonymous No.106307921 >>106308115
>>106307482
Snake case is the easiest.

There's no camel case there
Anonymous No.106308115
>>106307921
hello_this_is_a_world();
helloThisIsAWorld();
HELLOTHISISAWORLD();
hellothisisaworld();
Anonymous No.106308144 >>106312207
>>106303011
I use llvm linker these days.
Anonymous No.106308155
A real brother uses Hungarian Notation.
Anonymous No.106308175 >>106308424
>>106302748 (OP)
i hate capitalized letters
Anonymous No.106308230
I type whatever I feel like to get the code out, then refactor to make things look consistent.
Anonymous No.106308382 >>106308408
Imagine every 5th character you type being an underscore. Pathetic!

>>106305350
You have to press shift to type an underscore, retard.
Anonymous No.106308394
>>106307455
Anonymous No.106308408 >>106308434
>>106308382
thus the
>even worse
, you inbred camelrapist
Anonymous No.106308412
>>106305881
>java is made by and for white men
>OOP is the objectively superior way to organise code
the best kind of trolling combines being both objectively and spiritually correct with generating immense butthurt
Anonymous No.106308424
>>106308175
I HATE MINISCULES
Anonymous No.106308430 >>106308976
>>106307482
i'm sure there was. should i link a study that shows that the covid vaccine is good for you?
Anonymous No.106308434 >>106308454
>>106308408
Yet you snake_niggers name shit like const_iterator, benchod_pajeet, instead of just constiterator and benchodpajeet as you would imply. Fucking kill yourself dishonest snake.
Anonymous No.106308454
>>106308434
barking up the wrong tree, faggot retard
Anonymous No.106308976 >>106309864
>>106308430
thisIsVeryEasyAndFastAndFuriousToReadZeroEffortRequired

pretend_space_is_for_normies_this_is_extremely_hard_to_read
Anonymous No.106309864
>>106308976
this but unironically
PascalCaseAryans beat snake_case_jeets
Anonymous No.106310963 >>106310972 >>106317058
>>106305654
>UPPERCASE for const/macros.
objectively false, constants are the least interesting part of code, they should no be the most attention grabbing parts.
It only sticks around because of C macro inertia. something like name_of_constant_c or googles kConstant is much better.
>>106306564
or just snake case, indeed. read-only variables are normally snake case, too
Anonymous No.106310972
>>106310963
oh yeah. and as for macros, I prefer to have some explicit sigil that invokes macros.
so prefix $, suffix !, whichever
Anonymous No.106311566 >>106312967
>>106306038
functions are for much more than just verbs and actions

there's queries
bool isEmpty() const;


constructors and destructors
Device();
~Device();


callbacks
void onError();
void onDataReceived();


converters:
json asJSON();


operators:
std::ostream& operator<<(std::ostream& os, const Other& o)
Anonymous No.106312207
>>106308144
if you can show me how to do a MSVC free windows install of clang/llvm, I will kneel. I doubt you can so I don't believe you.
Anonymous No.106312967
>>106311566
I think
Json toJson();
String toString();
TreeMap deserializeAsMap();

is better
Anonymous No.106313075
i liek snek case
Anonymous No.106313857
>>106307081
>annoying to type
you_still_have_to_press_shift_my_friend
Anonymous No.106316142
I use snake_case for functions and PascalCase for types. Also SCREAMING_SNAKE for constants. It is the norm in C and Rust. I've been using Go recently and like the language, but I hate that the first letter determines visibility.

Anyone know the reason for that? Is it really to avoid putting one more keyword, or does it help speed up parsing or something? Either way, it sucks ass.
Anonymous No.106316179 >>106316510
>>106307482
for an empty function call it works but increases the odds a function with arguments may take up two lines which takes longer to process when reading. the more info you can convey in less space is ideal for brevity
Anonymous No.106316510
>>106316179
Thing is, if labels become multi-line verbose, it means the scope has grown too big. Any compact form of description is eventually going to hide a problem.
Anonymous No.106317058
>>106310963
>objectively false, constants are the least interesting part of code, they should no be the most attention grabbing parts.
the point is to clearly mark them as constructs that occur before code is even compiled, constants are written in by the compiler and macros expand by the preprocessor
Anonymous No.106317492
>>106302748 (OP)
I'll use as many different styles in the same program as I feel like, AND YOU CAN'T STOP ME! BWAHAHAHAHAHAHA!
Anonymous No.106317721
>>106302748 (OP)
snake_case should be used for everything. the industry is riddled with acronyms and that isn't going away any time soon.
>ADCToDAC
looks retarded
>ADC_to_DAC
is much clearer

this especially becomes apparent when the logical way to write a variable is a chain of acronyms
>ADDCDCFGNHMultiplexer
what are the individual words in that huh?
Anonymous No.106317825 >>106318455
>>106302748 (OP)
I use Hungarian notation. Troons hate it.
Anonymous No.106318455
>>106317825
hungarian notation is for poor men
Anonymous No.106318462
>>106302748 (OP)
closest thing to a space in the restricted variable name charset. CamelCase does separate words but i still want extra horizontal space between them.