[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: 21513.png (17 KB, 1200x800)
17 KB
17 KB PNG
What do you use and where?

For me it's:
>PascalCase
Classes, interfaces, types, objects and structs
>camelCase
functions, local / member variables
>snake_case
Global variables / environment variables
>UPPER_CASE
Constants
>kebab-case
Keys, files and directories
>>
Snake case everywhere is obviously the correct choice. We figured out as English speakers that spaces between words is more readable than scriptio continua by the middle ages.
>>
>>108607633
class some_class {
};

Anon, Please tell me you don't do this
>>
I have embraced Go's formatting style even in other languages.
Pascal for public symbols, camel for private. And all the bracing rules and shit too.

Anything non-code like directories etc. use full proper English. Programmers who do not account for whitespace or non-ASCII can die.
>>
A thread died for this.
>>
Whatever this is
https://github.com/id-Software/Quake/blob/master/WinQuake/cmd.c#L614
>>
>>108607534
I like to switch it up from time to time or from file to file depending on what I feel like. Not letting some autists on the internet limit my creativity.
>>
>>108607534
Whichever style the project is currently using
Ideally, it should follow the language's preferred styling guide
>>
>>108607534
>kebab - case + sauces + hiv - whites
huh?
>>
>>108607534
whatever is the default of the language I'm using
>>
>>108607680
> I have embraced Go's formatting style even in other languages. Pascal for public symbols, camel for private.

Same. I used to have Go style, but now actually prefer it. I write D and use this convention there. Would still use snake_case in Ruby though because it's a strong convention.

> Anything non-code like directories etc. use full proper English. Programmers who do not account for whitespace or non-ASCII can die.

fuck you if you want me to always type quotes in paths just because you decided it's okay to have spaces in directory names because you never used terminal in your entire life and write code in VSCode like a total codemonkey. I would literally fire your ass the moment I saw this shit.
>>
>>108607534
What is the shit URLs use with + for spaces?
>>
>>108607534
Whatever AI gives me. Im not a codetrans luddite
>>
>>108607534
I don't use snake_case or UPPER_CASE anywhere in programming.
>>
>>108607534
the ultimate nodev thread
>>
>>108608842
>you never used terminal in your entire life
I practically live in my terminal. I also live in 2026 and use a shell that has tab completion that inserts quotes automatically. I think this has been the case since the 80s.
>>
>>108607534
Hungarian Notation (Systems) is the one and only right one.
>>
>>108607534
It depends on the language I'm using. I generally prefer camelCase and PascalCase for most things, and reserve snake_case/UPPER_CASE for special symbols like constants.
>>
>>108608842
just use a backslash dude
>>
>>108607534
I use whatever is common at my current workplace and don't really care that much. I have one large personal open source project that is entirely Hungarian notation because that's what my work at the time did. My current personal project is a decomp/port project in which there were original engineers that used camel case, snake case, pascal case, and that one motherfucker who just tries to use as few characters as possible. So I just don't give a shit what the other contributors use.
>>
functionname, variablename
CONSTANTNAME
TypeName
>>
PublicMethods()
StructOrClass
privateMethod()
local_variable
CONSTANT

regardless of the language, unless that language has very very strong bias (like Ruby naming methods in snake_case)

I probably annoyed everyone with this, but this is very sane if you think about it. People who name their variables in camelCase don't understand ergonomics and that it's important to be able to quickly scan code visually without reading it.
>>
>>108607534
>snake_case
everything but
>PascalCase
Types
>Snaked_Pascal_Case
constants

that's it
>>
>>108607534
Pascal case for types, camel case for everything else.
>>
>>108607633
Unironically this
>>
depends on what i'm using

although i do like kebab case for folder names regardless of language



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.