4 ms·
Ask HN: How much do you use uppercase vs. lowercase characters in your code?
some programmers use lowercase exclusively. SOME USE UPPERCASE EXCLUSIVELY. Some only capitalize the initial of variable names. What's your preference?
- JAA1337 4y agoI would respectfully ask for someone to show me EXCLUSIVE UPPERCASE code which was not assembler, fortran 77, nor cobol.
- adamrezich 4y agoI EXCLUSIVE UPPERCASE SQL, not really sure why, just find it more readable
- treeface9000 4y ago
- marssaxman 4y agoYour list omits BASIC, much of which looked like this: https://github.com/coding-horror/basic-computer-games/blob/main/10_Blackjack/blackjack.bas https://github.com/coding-horror/basic-computer-games/blob/m...
- simonblack 4y agoUp until about the 80s, lowercase capability was a very expensive optional-extra in I/O computer equipment. So any language/program/data-entry used in the 30 years before about that era will be (almost) exclusively UPPER-CASE.
- theGeatZhopa 4y agoThere's something what's called a naming convention. ALL CAPS are usually constant All other use of CAPS is dependent on the language and it's naming convention. One does not simply write like preferred. Why you ask?
- Jtsummers 4y agoWhatever the language community and the team I'm in do. Anything that goes strongly against the grain is you choosing to be hard to work with. Especially when there's already a convention in place. A variable like this in C would communicate that the value is meant to be a constant (maybe is a constant via a macro definition): int CONTACT_ID = 10; // weird if it's meant to be reassigned later // elsewhere int x = CONTACT_ID; If I saw this after the initial definition: CONTACT_ID = 20; I'd be very confused as to why they chose to shout the name when that, by convention, marks it as a constant but are now assigning to it. Choose to communicate poorly at your own peril. Naming conventions (including these typographical elements like capitalization and case style) are how you communicate with other people.
- retrac 4y agoC is a bit of a free-for-all with case, but some languages have well-established conventions for this. E.g. type names are almost always CamelCase in Haskell, and the compiler requires the first letter be a capital. If there's a convention already, I mostly just try to follow it.