Autistic Rant

I just fucking hate camelCase and m_hungarianNotation in C++. What kind of dumbass thought it would be a good idea? I know there is no official style guide but what the fuck are you thinking with? Are you Pajeet? You want to Poo Poo Java in C++ Code?

Look at some samples from the standard library.

std::vector
push_back
pop_back
std::shared_ptr
std::unordered_map
etc.

The same goes for boost, the most popular library used in C++.

The same goes for the fucking creator of C++. The only thing he does differently is having a uppercase on custom types e.g. Unordered_map instead of unordered_map.

Now why in the fuck would you prefix and suffix your class members? m_foo, zot_, myBar etc. So you can continue with your 100000-line functions where you can't even figure out what is a class member and what is something local? Even if you don't have a modern IDE you can figure this out. You are probably the same idiots that think Singletons is a good solution, you lazy incompetent fucks.

Another thing that I hate is when you try to golf code. Mashing everything together without spaces or new lines like this: for(int foo=0;foo

Other urls found in this thread:

en.wikipedia.org/wiki/Indent_style#Allman_style
en.wikipedia.org/wiki/Tcl
emsps.com/oldtools/msbasv.htm
twitter.com/NSFWRedditVideo

CamelCase save one character per word, but snake_case has better spacing between words. I think they are both fine. Hungarian notation on the other hand really is shit and unnecessary.
faggot.faggotry; // can only be a member variablefaggot.has_aids(); // can only be a member function (and is always true)
There is zero reason to prefix those two with m_. Some people use Hungarian notation to annotate the type of variables:
std::string s_name;int i_age;boolean bHasAids;const int kBirthYear;
But even those are shit when you can use tools to get the type of the variable instead of relying on annotation that may or may not be correct.

You are missing the point. It is more or less established that snake_case should be used in C++, with camelCase you end up with code mixed with different styles which looks horrible and unreadable.

QtBar qtBar = fizz.foo_bar_zot();

Disgusting.

Using m_ is Hungarian notation, you are annotating that it is a class member.

snake_case is arguably the best
some people do int member_ which i find acceptable

kebab-case-here

snake case is a faggot

say that to my face and not online, see what happens!

GodsHolyCaseHere
snaake, kebab and hungarian notation is for CIAniggers.

I use snake_case more and more, but only because I prefer a single standard in code than because it's my choice, because can't say I like it. CamelCase sucks too, but at least it's easier to type. The underscore character will give me carpel tunnel/rsi or whatever in the long run. Maybe if it was shift+space I wouldn't mind.

That said, that's as much of a concession I'm willing to make. I will never switch to nextline { notation, no matter how many screeching autists surround my table.


I always assumed this would not be an option because of the minus sign being an operator. How will this parse then?
result = first-number-second-number;
Where the middle minus is an operator.

That's called Allman style:
en.wikipedia.org/wiki/Indent_style#Allman_style

I hate it as well, it wasted vertical space without conveying any information. Take any normally sized file and remove the newline, it will shrink considerably. Some people are really autistic about wanting the braces to align horizontally for some reason.

The only language where I know that style is the Lisp family and shell scripting. In Lisp there is no infix notation, instead the syntax is (operator operand-1 operand-2 ...)
(- 2 my-value) ;; is the same as my_value - 2
Names are separated by whitespace and the minus operator is really just another function. Because it uses whitespace for separation Lisp is very liberal in what makes a valid name:
(let ((-_*+/ 2)) ;; assign 2 to the variable -_*+/ (+ -_*+/ 5)) ;; returns 7

The trick with Lisp is that it doesn't really have a syntax, instead what you are writing is the AST itself. If you were to draw the infix expression '(2 + 3) / (5 * (4 + 1))' it would look something like this:
+---(/)---+ | | | | +-(+)-+ +-(*)-+ | | | |(2) (3) (5) +-(+)-+ | | (4) (1)
In Lisp's prefix notation that would be
(/ (+ 2 3) (* 5 (+ 4 1)))
For this example we wouldn't even need the parentheses to make it unambiguous (that would be called Polish notation), but in Lisp many functions (like + or * or - or /) can take an arbitrary number of arguments.

I remember that notation from those old HP calculators, although they ended with the operator, instead of starting with it. It took some getting used to, but it actually made more sense.

...

You mean not so autistic he's going to look into the history of a fucking bracket location choice.

Some things can have different labels, rain man. Everyone with a correct amount of chromosomes understands this.

You use Shift+_ in snake_case vs Shift+ with CamelCase. How is that MORE prone to carpel tunnel/rsi? That is bullshit and you know it.

If the operator follows after the operands it is called reverse Polish notation. I really like RPN hen typing into a calculator, much more comfy than infix notation.

...

do you have a space key or something for seperating numbers? because could be 35 1 + or 1 51 +

out of curiosity where is the _ key on your keyboard and what layout do you use? On a german keyboard layout _ is shift+(starting from the L key, one key to the right and then one diagonally down+right). The L is in the standard position for QWERTY/QWERTZ

Fortran and Algol can use spaces to separate words because spaces are ignored by the compiler. Algol 68 has identifiers with spaces like "char in string" but you can write them without the spaces.

Any variable name that requires you to hold shift to type is unacceptable. itsnotthatdifficulttoreadshortsentanceswithoutspaces
Adding m before members makes things more readable so I don't know why people hate that.

...

Cut the crap, the _ key is in a shit location, unlike ordinary letters. Using shift with regular keys doesn't strain the hand, because those are meant to be used often in combination with shift a lot. By everyone, not just programmers. You can't tell me that fact hadn't cross your mind even for a second there. So, no, I have no reason to bullshit about it. The _ is crossing the edge of comfort if you have to type it constantly all day through. The less I need to use it, the better. That's all there is to it. I'm sorry if the looks of camelCase trigger your autism, but denying that it's more comfortable (and faster) to type, now THAT would be deliberate bullshitting.

it's certainly more comfortable to type, it's an additional shift press vs an extra key and possibly shift as well.

It depends on the calculator obviously. I never had a physical RPN calculator, but the calculator program I'm using makes it so that you have to terminate every symbol by pressing enter, and entering an operator like + computes the result. So if you want to compute 7 * (23 + 51) you enter
72351
and then press + followed by *. The calculator displays the input like a stack with the oldest element on top. Entering an operator will pop off a number of operands according to the operator's arity and push the result on the stack. So with the above input if I press + the 23 and 51 are popped off and 74 is pushed on the stack:
774
Now I press * and the two numbers are popped off and 518 is pushed.

Fuck, I made a mistake:
It should obviously be the other way around:
(- my-value 2) ;; is the same as my_value - 2

And while I'm at it:
(/ (+ 2 3) (* 5 (+ 4 1)))
This infix notation is a flattened representation of the above graph, the two-dimensional drawing has been squashed into a one-dimensional expression without losing any information.

What I mean by this is that if we suppose that + is always a binary operator we don't need parentheses. This is why an RPN calculator always knows that it has to pop exactly two values off the stack. But in Lisp the arity is not always fixed, + can take zero or any other number of arguments, so we use parentheses to delimit expressions.
(+) ;; returns 0(+ 1) ;; returns 1(+ 1 2) ;; returns 3(+ 1 2 3) ;; returns 6
It also makes everything easier to read.

if i ever have to fix your code I will find you and kill you
tho I prefer inserting underlines instead of camel case


TRUTH: lemme tell you a story, kid

Back in the days of win 3.1 and early-windows 95, there was a market for smaller programs written in quickbasic.
for most of the years that quickbasic was available, the source file was directly readable; there was no compiled version.
so to keep users from altering your software (enabling features they hadn't paid for) you would run a variable-renaming program on the source code file
,,,,
in quickbasic, a variable name could be up to 127 characters long.
what these renaming programs did was they would run through the source file and change every variable name to a random 127-char string of "ones" and the capital letter I, and zeros and the capital letter "O"

the last couple years that quickbasic was maintained, there was a "pro" version that could compile the source files into machine code.
by then tho there was already much better languages and IDEs around, so everyone abandoned quickbasic, even Microsoft

also: I learned to program first on quickbasic, in grade school. because back then it came included with Win95, and was very simple to use.

There is literally nothing wrong with Apps Hungarian.

I'm sure any programmer could modify their key layout to put - in a better position.

Real programmers use their ring-fingers.

Same as yours.


Nice bait, but I will bite one finally time. Quit your bullshit, the _ is no worse than most other keys. In fact there are keys in the alphabet that are in worse position than _. And even if it was in the most inconvenient position it would still be worth it to avoid that ugly shitty camelcase style, Pajeet.

It's more than just autism, friend. It's good sense. When in Rome, do as the Romans do. Preet Pajeets who program like it's Java or C# in C++ need to be removed.

The only place where you should use PascalCase in C++ is for template parameters, just like how it's done in the C++ Standard Library.

...

Add Tcl to the list
It has only prefix notation and allows usage of almost every character in names
Names are separated by whitespace
Instead of using parentheses for substitution you can use square brackets or $.
It also allows delayed substitution with curly brackets

...

I looked it up on Wikipedia: en.wikipedia.org/wiki/Tcl

It looks a lot like shell scripting. Shell scripting is also basically prefix notation where commands are terminated by newlines and nested using backticks.

Much more sense, because you don't have to reply on all the mem functions.

It's a weird language.
Its main function is as an embedded scripting language. It's the industry standard in the chip industry.
There's something about the syntax which reminds of of lisp sometimes. They also started integrating some functional programming features (lmap, lcomp, foldl, etc.)
I've been working with it for almost three years and still hadn't decided if I like it.

Most of the shit I code are single letter variables, and sometimes a few, almost never more than 5. When I need to have it be descriptive, though, I use snake_case.
It feels good to be on top of it all.
If you don't understand, start reading from main()

I thought TCL was mostly for GUI automation similiar to AutoHotKey on Windows?

reeeeeeeeeeeeeeeeeeeee

That's Tcl/Tk
They're so frequently shipped together that people don't usually make the distinction but as far as I know, its main and original purpose is as an embedded scripting language for C programs.
Tk is a bonus in this regard as it allows you to easily create a GUI interface and even allow it to be dynamically configurable.
I haven't seen yet in the industry an explicit use of Tk, but I'm pretty new. Ive mostly seen it used from inside python or perl.
As far as VLSI tools and programs are concerned, tcl is the go-to embedding and scripting language.

Yeah, Tcl is just an embedable scripting language. Was often used for IRC bots, and various tools like Expect were written with it.
Tk works best with Tcl. There are bindings for other languages, but they're not as well tested. I've had to fix some stupid/obvious bugs in Perl/Tk modules.

RPN calculators. yeah. It's also the way Forth works.

You have confused the commercial QuickBASIC and QBasic, which was a subset of QuickBASIC 4.5 sold with MS-DOS 5 onwards (and contained on the Windows 95 CD) that replaced the former GW-BASIC and acted as a kinda-universal scripting environment under MS-DOS.
In fact QuickBASIC only contained a compiler and linker up until version 4.0 when an interpreter was introduced into the IDE for faster development. It was only abandoned in 1990 for Visual Basic on DOS and later on Windows.
Only amateur programmers and cheap-ass companies that didn't purchase or pirate QuickBASIC sold BASIC code like this.

You might be interested in the history of MS-BASIC:
emsps.com/oldtools/msbasv.htm

Hungarian notation makes perfect sense in the original form, where it denotes the type of data rather than the type of variable, e.g. x_offset rather than i_offset. The point is to make mistakes look more obvious, e.g. someone adding variables containing x and y coordinates.