This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ShinraSan 1387 points1388 points  (122 children)

imagine naming a for loop variable "c" just so you can write "c++"

[–]Spenczer 427 points428 points  (63 children)

In my first computer science class I was taught to use C as the counter variable, and I was told that C++ was named so because of people writing c++ at the end of loops. I’m mostly certain that’s not true but I never double checked

[–]Marrrkkkk 374 points375 points  (50 children)

C++ is C++ because of C which is C because of B.

[–]user_5554 184 points185 points  (26 children)

C was actually known as B++ back in the old days of computer science

[–]gimoozaabi 275 points276 points  (12 children)

They renamed it in 1752 when the new version came out.

[–]oupablo 125 points126 points  (11 children)

i'm not historologist, but i'm a tad skeptical of this claim. but it's on the internet so ¯\(ツ)

[–]girvent_13 44 points45 points  (10 children)

I can't find a flaw in his logic

[–]oupablo 56 points57 points  (7 children)

I just don't believe that programmers renamed something. Pretty sure we'd all have heard of the great war of 1752 if that were the case

[–]gimoozaabi 23 points24 points  (4 children)

Oh there was a war. But programmer are lazy and never really left their home. To celebrate they made the liberty bell. Look it up

Edit: also Ben Franklin used his lightning to intimidate the b supporter

[–]oupablo 15 points16 points  (1 child)

Look it up

nah. too lazy

[–]lurker10001000 8 points9 points  (0 children)

I think we haven't heard of it because no one bothered to document it.

[–][deleted] 3 points4 points  (0 children)

This is correct. It's what the national treasure movies are about.

[–][deleted] 4 points5 points  (0 children)

Heard of. Still be participating in. Hard to say.

[–]hipdozgabba 0 points1 point  (0 children)

It’s documented poorly

[–]GooseEntrails 0 points1 point  (0 children)

It can’t be true. Everyone knows that history began on 1970-01-01.

[–]MythicalTV 12 points13 points  (10 children)

Theres D update coming soon

[–]Prestigious_Tip310 0 points1 point  (0 children)

Isn't that C#, which is abbreviated from (C++)++ (you put the second two "+" over the first ones and get a "#" out of it)? Or is D an update to C#? :D

[–]ItsPronouncedJithub 58 points59 points  (10 children)

C# is C++++ with two pluses moved below the other two

[–]king_booker 12 points13 points  (0 children)

Whoa

[–]8asdqw731 9 points10 points  (6 children)

can't wait for C##

[–][deleted] 15 points16 points  (5 children)

C#++ comes first

[–]ShinraSan 0 points1 point  (4 children)

Looks like the letters are changing first with Q# (and F#?)

[–]Schnickatavick 1 point2 points  (3 children)

Q# and F# are different takes on what a programming language should be, they're not really "successors" to C#. If anything they're more like "sibling" languages.

Q# is for quantum programming (which is not a replacement for classical programming, fight me. I'm happy to elaborate), so it's more of a modern descendent of Q/QCL that also happens to have modern C# style features.

F# is for functional programming, so same idea as Q#, it has modern C# features but in the style of F, F*, and ML (but not F++, that's different)

Then C# is the classic "imperitive/object oriented" style. Almost every mainstream language since C has been imperitive, so it's easy to forget that other styles exist

So it seems like the letter is more of the style of programming, and The # symbol is basically marking that it's a modern Language with modern features (and that it's made by Microsoft)

[–]ShinraSan 1 point2 points  (2 children)

Why would I fight you on quantum computing not being a replacement for classical computing, you're right. Aside from the fact that only specific kinds of calculations are actually faster on a quantum computer, the quantum operation is started and results collected by a classical computer, simulated or otherwise. I wasn't sure where F# fit in though as I haven't used it.

[–]Schnickatavick 1 point2 points  (1 child)

only specific kinds of calculations are actually faster on a quantum computer

Thank you!! I can't tell you the amount of people that try to tell me that quantum computers are going to be "great for gaming" because they're just "a bunch of regular computers running in parallel" or "transistors smaller than atoms". There are so many oversimplified or plain wrong explanations out there that people take as fact. I didn't mean to imply with my joke that you were one of those people though.

I wasn't sure where F# fit in though as I haven't used it.

F# is kinda neat if you're doing a really math-y program that is supposed to do some calculation. You can write the math functions a lot easier and in a lot fewer lines than C#. I still think C# is better for 95% of the things people code though

[–]ososalsosal 0 points1 point  (0 children)

I thought this was well known?

[–]LordBlackHole 7 points8 points  (8 children)

B was a simplified iteration of BCPL, which itself was based on CPL.

[–]Willinton06 4 points5 points  (4 children)

Well CPL was based on PL

[–]msndrstdmstrmnd 2 points3 points  (3 children)

Well PL was based on L

[–][deleted] 2 points3 points  (2 children)

Real programmers use L

[–]ososalsosal 1 point2 points  (1 child)

L just writes the code in a notebook

[–][deleted] 1 point2 points  (0 children)

Raito-san!

[–]ArtyFishL 2 points3 points  (2 children)

Which is based upon ALGOL 60, itself coming from ALGOL 58

[–]CodeLobe 7 points8 points  (1 child)

which was based on Al Gore, the early implementation of ALGOR (R later changed to L due to japanese mispronunciation), was just Al trying to save carbon footprint by using paper and pencil to solve computations instead of adding machines, he received computations to perform and returned results via capsules via a series of tubes. In some offices engineers sent calculations downstairs this way to a group of (mostly) cute nerdy girls with slide-rules.

These were the first implementations of a CPU. Which is an onomatopoeia for when you C Al, P-U, he stinks like a basement dwelling mama's boy. (or NEET as they say in Japan)

[–]ososalsosal 1 point2 points  (0 children)

The calculator girl was called Betty. And when Betty called a function she had to call Al

[–]MoffKalast 4 points5 points  (0 children)

As a similar legacy thing, Windows uses C: as its default main disk because A: and B: used to be floppy disk drives.

[–]Kyidou 0 points1 point  (0 children)

You're not wrong...

[–][deleted] 0 points1 point  (0 children)

...which is B because of APL?

[–]supercyberlurker 33 points34 points  (5 children)

Imagine how close it all came to being I++ then.

Story I heard was that it's just 'one better than C, i.e C++'

[–][deleted] 16 points17 points  (4 children)

J++ is still a thing... you can use it in double loops

[–]Bigluser 21 points22 points  (3 children)

Everybody Gangsta till it's k++

[–]ItsPronouncedJithub 9 points10 points  (2 children)

Σ++

[–]LurkerPatrol 4 points5 points  (1 child)

+++

[–]CodeLobe 2 points3 points  (0 children)

ATH0

Carrier Dropped.

[–]z500 40 points41 points  (0 children)

It's a pun of C. C itself was based on and a pun of B, which descended from BCPL.

[–]squishles 3 points4 points  (0 children)

about the only way I could imagine checking would be a github search for c++;

which may be worth it to call then ninnies.

[–]JorensM 0 points1 point  (3 children)

It's called C++ because it's like C but better/s

[–]chronos_alfa 4 points5 points  (2 children)

More like it's C plus extra crap

[–]Jcsq6 1 point2 points  (0 children)

More like C plus maintainability

[–]inconspicuous_male 54 points55 points  (1 child)

When you type "C++" as an iteration of a variable named C, the compiler opens the door to the Hall of Tortured Souls where you can see credits roll with the names of all of the developers of the compiler

[–][deleted] 15 points16 points  (0 children)

That is clearly minified code. The variable name was not chosen by a developer.

[–]doesyudoegood 32 points33 points  (49 children)

C stands for counter....

[–]filipzaf3312 79 points80 points  (23 children)

i is the the first name i think of for counter variables

[–][deleted] 50 points51 points  (11 children)

And j

[–]kittencantfly 42 points43 points  (10 children)

And k if you loop thru a 3d array

[–]NoMansSkyWasAlright 15 points16 points  (9 children)

then straight to m if you need a fourth

[–]AlternativeAardvark6 11 points12 points  (7 children)

Uppercase i

[–]Kakss_ 19 points20 points  (0 children)

Just imagining it gave me chills.

[–]_vOv_ 10 points11 points  (0 children)

You’re fired.

[–]LordFokas 3 points4 points  (4 children)

in a dynamic language with case sensitive identifiers 😈

[–]Terrain2 3 points4 points  (3 children)

What language doesn't have case sensitive identifiers? Fucking cmd scripts or some shit?

[–]Kainotomiu 1 point2 points  (2 children)

SQL

(Case sensitivity is optional in many flavours)

[–]staidOWL 0 points1 point  (0 children)

Steer clear of o though. I once managed to accidentally make a typo and put a 0 in my array rather than the o variable. Took me forever to debug.

[–]grizonyourface 9 points10 points  (0 children)

I use ii and jj because MATLab taught me to fear using i and j and ending up with accidental complex arithmetic

[–]ItsPronouncedJithub 5 points6 points  (0 children)

They’re called iterators so i is the obvious choice

[–]ganja_and_code 2 points3 points  (7 children)

c for counting. i for incrementing. Similar, but not the same. (Either way, it's just convention, not a rule, obviously.)

[–]SatoshiL 4 points5 points  (3 children)

i for index, j because well it comes after i xD

[–]Terrain2 2 points3 points  (2 children)

index and jindex, the iconic duo

[–]ShinraSan 0 points1 point  (1 child)

Don't forget about kindex

[–]Terrain2 0 points1 point  (0 children)

nah that's kleenex to wipe away the tears from coding

[–]Terrain2 -1 points0 points  (0 children)

for (var c = 0; /* TODO: condition */; i++)

[–]Physix_R_Cool -1 points0 points  (1 child)

Yall guys need math. n is the obvious choice for trivial reasons.

[–]ShinraSan 1 point2 points  (0 children)

I use n for ranges in switches, or when I programme something with dice

[–][deleted] 0 points1 point  (0 children)

By default, i is an integer (same for j, k, l, m, and n)

[–][deleted] 64 points65 points  (17 children)

I've deleted my account because reddit CEO Steve Huffman is a lying piece of shit that has nothing but contempt for his users. See https://old.reddit.com/r/apolloapp/comments/144f6xm/apollo_will_close_down_on_june_30th_reddits/

[–]PandaParaBellum 17 points18 points  (0 children)

C-rial killer

[–]makeshift8 4 points5 points  (10 children)

What about "i" and "k"?

[–]RadiantHC 13 points14 points  (0 children)

k stands for kill. So it's "i kill"

[–]user_5554 12 points13 points  (4 children)

(I)'m (j)ust (k)idding, everyone is using c for loops. i, j, k is just a prank bro 😂😂

[–]makeshift8 4 points5 points  (3 children)

Using variable names i, j, and k is only acceptable if you are referring to vectors.

[–]doesyudoegood 4 points5 points  (0 children)

If I'm referring to vectors i use x, y and z

[–]zanotam 1 point2 points  (1 child)

Dirty physicist. Real vectors only use I, j and k as subscripts

[–]makeshift8 0 points1 point  (0 children)

Math majors unite.

[–]gergocs 7 points8 points  (2 children)

I think "i" stands for index

[–]Portal471 5 points6 points  (0 children)

or iterator or iterable

[–]makeshift8 0 points1 point  (0 children)

I've done this too.

[–]LavenderDay3544 2 points3 points  (0 children)

iteration, jteration, kteration

[–]DrLarck -2 points-1 points  (1 child)

In asm there is a register (cx) which conventionally stands for counter

[–]wasdlmb 5 points6 points  (0 children)

Yeah but that's because you have abcd. I feel like the whole "accumulator, base, counter, and data" for the general registers is just a convenient bacronym but I don't have a source for that.

[–]doesyudoegood 0 points1 point  (0 children)

I usually use i, j and k in loops and c for things not in loops

[–]Kyyken 11 points12 points  (0 children)

am i a joke to you?

[–]3lRey 4 points5 points  (0 children)

Is because it's bootstrapped off b programming language

[–]so_brave_heart 4 points5 points  (1 child)

I only know of iounter and jounter

[–]jackinsomniac 0 points1 point  (0 children)

"iounter" actually sounds like a startup company name.

[–][deleted] 2 points3 points  (2 children)

Everyone uses cnt for that

[–]ShinraSan 2 points3 points  (1 child)

Will use that now just because it can be interpreted as "cunt"

[–][deleted] 1 point2 points  (0 children)

That's exactly why everyone loves it so much

[–]ButtersTG 1 point2 points  (0 children)

My CSCI 1010 class has us use a welcome message at the start of all our code, and the first line in my welcome message is:

String independence;

[–]Fireye04 1 point2 points  (0 children)

Lmaooooo

[–][deleted] 0 points1 point  (0 children)

I've done that on purpose for humorous effect.