troony thread (trannies making threads LARPing as /C/hads to incite controversy and drama).
Reminder that trannies need the drama and attention, otherwise their language goes unnoticed and forgotten into oblivionfrick.
Don't argue with the troony.
Don't reply to the troony thread.
I won't respond to any reply. Have a good day.
Out.
There are also formatting conventions you could look into, like the ones included with clang-format.
This is one of the things I appreciate about Rust. My autistic brain doesn't have to worry about bumping into multiple styles when I include a library or two.
in white countries we don't have standards unless you mean those 37 competing ones with 38th on the way that will definitely unify them all, only brownoids have standards, they all are uniformly moronic and worthless, for example romanians follow standard of being beggsrs and thieves attracted by copper, a very big problem in my white country that's diverse and has people who do multiple non-standard jobs
Just pick something and stick with it, C++ doesn't particularly care.
Ideally don't be a total moron and pick something normal like LLVM or Google's style as a base, avoid changing things unless you're truly seething about a rule. Bonus points that most formatters will support auto-linting if you use something normal.
last time I used a formatter it fricked everything up and there wasn't even an option for things I wanted to do so I had to reformat everything by hand, midwit tool for soulless wagies, I format everything by hand and it's still more consistent
It's on per-project basis. Don't copy STL, especially the __part. For your personal projects consider
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#S-naming
https://google.github.io/styleguide/cppguide.html#Naming
Whatever you choose, keep it consistent within a project or file(whichever works best for you).
Keep the names descriptive and the formatting consistent.
If you cant make a descriptive name, write a comment near the function prototype or function/variable declaration with a description of what it does/what it is.
Stick to using a single type of case (e.g., camelcase).
The end goal of naming your variables should be that you can go back to, or share, your code and understand what each named thing, be it an object/var/func, is without having to read the entire implementation.
Don't get hung up on the names though, if it impedes your ability to just get shit done just keep writing code and come back to that later.
snake_case for everything, including types. I.e. std::unique_ptr.
Yes it is awful and almost nobody uses it. Use snake_case for functions and variables and PascalCase for types if you are white or camelCase for functions and variables if you believe in magic cow dung.
actually, Ive recently been starting to switch to the new function style, so its more like
class MyClass {
public:
auto myFunction(uint32_t my_varriable) -> void
{
if (...) {
}
else {
}
}
troony thread (trannies making threads LARPing as /C/hads to incite controversy and drama).
Reminder that trannies need the drama and attention, otherwise their language goes unnoticed and forgotten into oblivionfrick.
Don't argue with the troony.
Don't reply to the troony thread.
I won't respond to any reply. Have a good day.
Out.
This is a genuine question
/sqt/ or /dpt/
No. Like C, people make up their own naming conventions for their projects.
>Should I just follow whatever naming convention std uses?
That's always a good bet.
It doesn’t, it’s typically dependent on the project. A good baseline is to use Googles coding standards and tweak from there.
Why do you brainlet sk brainlet questions?
There are also formatting conventions you could look into, like the ones included with clang-format.
This is one of the things I appreciate about Rust. My autistic brain doesn't have to worry about bumping into multiple styles when I include a library or two.
How old are you.
It's your project, use your own naming convemtuons
STLs naming conventions are the dumbest things I've seen since Rust's syntax.
>Use snake_case
>Compiles
>Use pascalCase
>Compiles
>Use CapitalCass
>Compiles
I guess not.
>I need a parental figure to tell me what to do
OP, I...
This is called standardization. You know, the thing that happens in white countries
in white countries we don't have standards unless you mean those 37 competing ones with 38th on the way that will definitely unify them all, only brownoids have standards, they all are uniformly moronic and worthless, for example romanians follow standard of being beggsrs and thieves attracted by copper, a very big problem in my white country that's diverse and has people who do multiple non-standard jobs
Rust doesn't have a specification, let alone a standard, and it doesn't stop it from being used. So it turns out you don't always need standards.
Just pick something and stick with it, C++ doesn't particularly care.
Ideally don't be a total moron and pick something normal like LLVM or Google's style as a base, avoid changing things unless you're truly seething about a rule. Bonus points that most formatters will support auto-linting if you use something normal.
last time I used a formatter it fricked everything up and there wasn't even an option for things I wanted to do so I had to reformat everything by hand, midwit tool for soulless wagies, I format everything by hand and it's still more consistent
try again with clang-format
>Does C++ even have a naming convention?
No. Bjarne (PBUH) recommends snake_case, but you can use something else if you want.
It's on per-project basis. Don't copy STL, especially the __part. For your personal projects consider
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#S-naming
https://google.github.io/styleguide/cppguide.html#Naming
I like Qt's
ClassName objectName;
objectName.methodName()
test
test
Whatever you choose, keep it consistent within a project or file(whichever works best for you).
Keep the names descriptive and the formatting consistent.
If you cant make a descriptive name, write a comment near the function prototype or function/variable declaration with a description of what it does/what it is.
Stick to using a single type of case (e.g., camelcase).
The end goal of naming your variables should be that you can go back to, or share, your code and understand what each named thing, be it an object/var/func, is without having to read the entire implementation.
Don't get hung up on the names though, if it impedes your ability to just get shit done just keep writing code and come back to that later.
snake_case for everything, including types. I.e. std::unique_ptr.
Yes it is awful and almost nobody uses it. Use snake_case for functions and variables and PascalCase for types if you are white or camelCase for functions and variables if you believe in magic cow dung.
I am the ultimate contrarian, this is my C++ style
class MyClass {
public:
void myFunction(uint32_t my_varriable)
{
if (...) {
}
else {
}
}
private:
uint32_t m_some_number { 0 };
};
actually, Ive recently been starting to switch to the new function style, so its more like
class MyClass {
public:
auto myFunction(uint32_t my_varriable) -> void
{
if (...) {
}
else {
}
}
private:
uint32_t m_some_number { 0 };
};