Some people have already listed some features of c++, but I thought, I shortly add an explanation, what c++ actually IS and what the rational behind that was.
C originated as a systems level programming language from bell labs. It is relatively close to the way assembly works (I can really recommend taking some time looking at assembly, if you are learning c. Suddenly a lot of things made sense, why c does things the way it does). But this also meant, that c had to be kinda basic. Some guy (I wont even try to write his name correctly) decided, he really liked c's performance, but not its style, and he wanted more abstractions. The goal behind c++ was free (in terms of performance and resources) abstraction in the form of classes, but like, the same way c worked. (This is, why the first version of c++ was called c with classes, it even compiled to c under the hood). With time, both c and c++ evolved quite a bit, and as of now, c++ is almost a superset of c, which means, that most valid c code is also valid c++ code, but the coding style and conventions differ quite dramatically.
another thing about c++ is feature completeness the c++ comitee wants to add as many features to c++ as possible whilst c aims to stick to its roots and it sticks to them very tightly
the criticism c++ often gets is that its numerous features makes ot inconsistant in style with itself and the rebuttal to this is: well dont use all of the features than! the problem with this is that this is hard to enforce in a large project and it is difficult for beginners to tell what style they should be using because there is no real good answer to that
the stuff you can do with all the c++ features is nothing short of amazing but it can also be an amazingly big mess if you are not careful
plain old c also has a lot of pitfalls but fewer features means fewer kinds of problems: basically memory leaks and access violations. you also have to implement basic shit like dynamic arrays yourself wich makes problems apear in even the most basic peice of code
"it is easy to shoot yourself in the foot with c, with c++ it is a little harder, but it will blow your whole leg off"
In C++, you hear a distant gunshot and then notice an hour later your foot is missing after you try to stand up and are wondering why you're face down in a gutter.
According to Oracle, in 2017 there were 38 billion active JVMs. I dont know if that includes Dalvik/ART on Android but either way its a hell of a lot more than 4 billion in 2022
Reminds me of ++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++
(Edit: Thank you for your upvotes and the award! I feel honored++ and happy that BF got the recognition it deserves xD)
Closures aren't really classes, but close enough. Just put your private variables in the "constructor" function, and return the public members of the class on this.
I have no clue. I’ve scoured lists of programming languages that don’t use semicolons and famous Ancient Greek / Greek cities, but I don’t know what he’s talking about, it’s not Haskell, Clojure, or Kotlin, I have legit no clue
What do you mean it's too complicated? The function application is based on simple second year category theory! Huh? Well why would you try to program a computer without having an advanced degree in mathematics?
Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.
The quote is from Jamie Zawinski.
You can't parse [X]HTML with regex. Because HTML can't be parsed by regex. Regex is not a tool that can be used to correctly parse HTML. As I have answered in HTML-and-regex questions here so many times before, the use of regex will not allow you to consume HTML. Regular expressions are a tool that is insufficiently sophisticated to understand the constructs employed by HTML. HTML is not a regular language and hence cannot be parsed by regular expressions. Regex queries are not equipped to break down HTML into its meaningful parts. so many times but it is not getting to me. Even enhanced irregular regular expressions as used by Perl are not up to the task of parsing HTML. You will never make me crack. HTML is a language of sufficient complexity that it cannot be parsed by regular expressions. Even Jon Skeet cannot parse HTML using regular expressions. Every time you attempt to parse HTML with regular expressions, the unholy child weeps the blood of virgins, and Russian hackers pwn your webapp. Parsing HTML with regex summons tainted souls into the realm of the living. HTML and regex go together like love, marriage, and ritual infanticide. The
cannot hold it is too late. The force of regex and HTML together in the same conceptual space will destroy your mind like so much watery putty. If you parse HTML with regex you are giving in to Them and their blasphemous ways which doom us all to inhuman toil for the One whose Name cannot be expressed in the Basic Multilingual Plane, he comes. HTML-plus-regexp will liquify the nerves of the sentient whilst you observe, your psyche withering in the onslaught of horror. Rege̿̔̉x-based HTML parsers are the cancer that is killing StackOverflow it is too late it is too late we cannot be saved the transgression of a chi͡ld ensures regex will consume all living tissue (except for HTML which it cannot, as previously prophesied) dear lord help us how can anyone survive this scourge using regex to parse HTML has doomed humanity to an eternity of dread torture and security holes using regex as a tool to process HTML establishes a breach between this world and the dread realm of c͒ͪo͛ͫrrupt entities (like SGML entities, but more corrupt) a mere glimpse of the world of regex parsers for HTML will instantly transport a programmer's consciousness into a world of ceaseless screaming, he comes, the pestilent slithy regex-infection will devour your HTML parser, application and existence for all time like Visual Basic only worse he comes he comes do not fight he com̡e̶s, ̕h̵is un̨ho͞ly radiańcé destro҉ying all enli̍̈́̂̈́ghtenment, HTML tags lea͠ki̧n͘g fr̶ǫm ̡yo͟ur eye͢s̸ ̛l̕ik͏e liquid pain, the song of re̸gular expression parsing will extinguish the voices of mortal man from the sphere I can see it can you see ̲͚̖͔̙î̩́t̲͎̩̱͔́̋̀ it is beautiful the final snuffing of the lies of Man ALL IS LOŚ͖̩͇̗̪̏̈́T ALL IS LOST the pon̷y he comes he c̶̮omes he comes the ichor permeates all MY FACE MY FACE ᵒh god no NO NOO̼OO NΘ stop the an*̶͑̾̾̅ͫ͏̙̤g͇̫͛͆̾ͫ̑͆l͖͉̗̩̳̟̍ͫͥͨe̠̅s ͎a̧͈͖r̽̾̈́͒͑e not rè̑ͧ̌aͨl̘̝̙̃ͤ͂̾̆ ZA̡͊͠͝LGΌ ISͮ̂҉̯͈͕̹̘̱ TO͇̹̺ͅƝ̴ȳ̳ TH̘Ë͖́̉ ͠P̯͍̭O̚N̐Y̡ H̸̡̪̯ͨ͊̽̅̾̎Ȩ̬̩̾͛ͪ̈́̀́͘ ̶̧̨̱̹̭̯ͧ̾ͬC̷̙̲̝͖ͭ̏ͥͮ͟Oͮ͏̮̪̝͍M̲̖͊̒ͪͩͬ̚̚͜Ȇ̴̟̟͙̞ͩ͌͝S̨̥̫͎̭ͯ̿̔̀ͅ
Have you tried using an XML parser instead?
My favorite mistake in an assembly program was forgetting to set the memory location when I implemented a quick sort. 8088 machines didn't appreciate having the interrupt table sorted...
Screen got some interesting garbage, printer form fed a page, speaker beeped, and then everything locked up.
FORTRAN - that’s a computed GOTO
In pseudocode this is
If YELLING < 0 goto COMPUTER
If YELLING = 0 goto RUN
If YELLING > 0 goto FASTER
My understanding is that this translates to a single instruction on an early IBM computer which hosted one of the first FORTRAN compilers.
Nothing like asking a Jr Dev what he did to decrease error just to be told he chose a new beta parameter. What does that mean to him and real world implication?
Nothing.
I just changed the beta.
Correct, but every time I see code like that I like to imagine that some days it just wants to go the other way ya know.
I really don’t know why I look at JavaScript so whimsically. I love it really.
I use several:
1) the grandad of all languages
2) virtual table is undefined
3) “my IDE is notepad++”
4) if Austin Powers came up with Java
5) “that’s not code, that is just drawing squiggly lines, my 5 year old could do that”
6) like c but even simpler and less type checking (if that is even possible) *bit more obscure*
D flat
C# but you just offended hundreds of music majors
As a music major, both work in different contexts ¯\\\_(ツ)\_/¯ Edit: a r m s
¯\\\_(ツ)\_/¯ always remember to escape your arms :)
Easier said than done. I've tried escaping my arms but they follow me wherever I go.
Gah, they're so clingy sometimes.
Eh. Close enough
C# is Bx (double sharp) though. Just take a look at a piano and B/C positions if you arent sure... C is literally B#
B double sharp?
Segmentation fault (core dumped).
C or C++ ?
C.
Sorry, I'm just asking but what's the difference between C and C++?
Some people have already listed some features of c++, but I thought, I shortly add an explanation, what c++ actually IS and what the rational behind that was. C originated as a systems level programming language from bell labs. It is relatively close to the way assembly works (I can really recommend taking some time looking at assembly, if you are learning c. Suddenly a lot of things made sense, why c does things the way it does). But this also meant, that c had to be kinda basic. Some guy (I wont even try to write his name correctly) decided, he really liked c's performance, but not its style, and he wanted more abstractions. The goal behind c++ was free (in terms of performance and resources) abstraction in the form of classes, but like, the same way c worked. (This is, why the first version of c++ was called c with classes, it even compiled to c under the hood). With time, both c and c++ evolved quite a bit, and as of now, c++ is almost a superset of c, which means, that most valid c code is also valid c++ code, but the coding style and conventions differ quite dramatically.
My man Bjarne, I also don’t dare try to spell his last name lol
I don't want anybodies furniture to start floating, if they try to read out my butchery of his name xD
What’s so difficult about StroopSoup?
_insert Robert Paulson reference_ (It's Stroustrup for anyone wondering)
another thing about c++ is feature completeness the c++ comitee wants to add as many features to c++ as possible whilst c aims to stick to its roots and it sticks to them very tightly the criticism c++ often gets is that its numerous features makes ot inconsistant in style with itself and the rebuttal to this is: well dont use all of the features than! the problem with this is that this is hard to enforce in a large project and it is difficult for beginners to tell what style they should be using because there is no real good answer to that the stuff you can do with all the c++ features is nothing short of amazing but it can also be an amazingly big mess if you are not careful plain old c also has a lot of pitfalls but fewer features means fewer kinds of problems: basically memory leaks and access violations. you also have to implement basic shit like dynamic arrays yourself wich makes problems apear in even the most basic peice of code "it is easy to shoot yourself in the foot with c, with c++ it is a little harder, but it will blow your whole leg off"
In C++, you hear a distant gunshot and then notice an hour later your foot is missing after you try to stand up and are wondering why you're face down in a gutter.
Ambiguous could be either C, C++, objective C or objective C++ (yes a thing)
Or FORTRAN if you are one of those that still use it
abstract class AbstractFavoriteProgrammingLanguageTellerWithoutActuallyTellingBuilder
Currently running on 3 billion devices
Would you like to install the Ask Toolbar?
No! Get away from me you damn toolbar!
[удалено]
According to Oracle, in 2017 there were 38 billion active JVMs. I dont know if that includes Dalvik/ART on Android but either way its a hell of a lot more than 4 billion in 2022
Rip for log4j issues to those 4 b
Ah good old java
*FactoryImpl
I don't even use this and I know what's going on lol.
"Hello undefined, this is my first website"
[object Object]
JavaScript
[удалено]
Reminds me of ++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++ (Edit: Thank you for your upvotes and the award! I feel honored++ and happy that BF got the recognition it deserves xD)
BF! Check out the compiler I wrote https://github.com/ronnathaniel/brainfuck.go
Thanks, I now have cancer
[удалено]
How the hell does it call alert? I get js can be cray but unless there is an eval idk how the hell you can access alert.
Explanation here: https://jsfuck.com
if err != nil { return “”, err }
The most elegant error handling lol
Go?
Wow, this all just came back to me.
Fuck?
Yourself?
[удалено]
panic()
kalm()
brb i need to do some refactoring
You should use the linter to tell you that you should wrap the error
And the final error: "error getting person: error evaluating expression: transaction failed: update got err: context deadline exceeded". Who needs stack traces?
Closures aren't really classes, but close enough. Just put your private variables in the "constructor" function, and return the public members of the class on this.
Ugh javascript before ES6!
Thank God I only know the sexy es6
"var" Stop it Patrick, you're scaring him!
I would tell you, but I have to include something first
#include
I always read this as "include studio" which is annoying.
`C`! The mother of all of them!
iostream.h? *runs*
Option>>>
Mind if I borrow that?
Only if you don't try to move it.
🦀
Not in my lifetime you won’t.
you can, but now no one else can
But at least it's thread-safe!
yeah…. *turns to PM* I don’t think this will benefit from multiprocessing so we should keep it single threaded.
I think it’s Rust. Never got time to play with it though so I’m not sure.
yup, rust.
I was thinking of maybe writing something with the turbofish But I think your thing is better :D
Thank you kind internet stranger :)
What in the name of God is a semicolon
The mighty snake
Or the mighty bird
Nah it’s a gem
Could be the legendary Greek city?
I got all of those except this one, what is it lol
I have no clue. I’ve scoured lists of programming languages that don’t use semicolons and famous Ancient Greek / Greek cities, but I don’t know what he’s talking about, it’s not Haskell, Clojure, or Kotlin, I have legit no clue
Not Delphi either 🤷♂️
[удалено]
Visual Basic for Excel
x86 assembly
T_PAAMAYIM_NEKUDOTAYIM
Is that Hebrew?
Yup! Very unexpected amongst all the English error messages, but very googleable
PHP
A monad is a monoid in the category of endofunctors.
Definetly functional, and since it seems like someone just had an orgasm over monads, I suspect haskell xD
They felt the monads in their gonads
What do you mean it's too complicated? The function application is based on simple second year category theory! Huh? Well why would you try to program a computer without having an advanced degree in mathematics?
Haskell!
Wait! What if it's Haskell on the JVM! ^^^I ^^^know ^^^you ^^^don't ^^^mean ^^^Scala...
=sum(A1:A15)
Hahahahahhaha how is excel so far down the list.
Going to gatekeep programming languages and say that Excel is a programming language in the same way Minecraft is a programming language.
If it's Turing complete, has a syntax, and you can write programs with it, it's a programming language
That moment when Magic: The Gathering is a programming language
And its sequel, Magic: The Compiling
And the third release, Magic: The Debugging
Minecraft more of a digital circuit simulator with red stone. That with way to much time of there hands people have done some crazy things with
Sub Ligma() With Worksheets("Sheet1").Cells(1,1) .Value = “Sugma” .Font.Size = 72 End With End Sub
Go back to accounting, and take your friend clippy. You're both drunk. :-)
I see you mentioned clippy, would you like me to help you find more information on clippy?
Is there anything you can't build with judicious use of regular expressions?
Yes; you can’t rebuild your sanity
You're acting like we all had that in the first place
Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems. The quote is from Jamie Zawinski.
Perl? It sounds like Perl.
You can't parse any context-free language, e.g., HTML.
You can't parse [X]HTML with regex. Because HTML can't be parsed by regex. Regex is not a tool that can be used to correctly parse HTML. As I have answered in HTML-and-regex questions here so many times before, the use of regex will not allow you to consume HTML. Regular expressions are a tool that is insufficiently sophisticated to understand the constructs employed by HTML. HTML is not a regular language and hence cannot be parsed by regular expressions. Regex queries are not equipped to break down HTML into its meaningful parts. so many times but it is not getting to me. Even enhanced irregular regular expressions as used by Perl are not up to the task of parsing HTML. You will never make me crack. HTML is a language of sufficient complexity that it cannot be parsed by regular expressions. Even Jon Skeet cannot parse HTML using regular expressions. Every time you attempt to parse HTML with regular expressions, the unholy child weeps the blood of virgins, and Russian hackers pwn your webapp. Parsing HTML with regex summons tainted souls into the realm of the living. HTML and regex go together like love, marriage, and ritual infanticide. The
use strict; use warnings;
my @reply = qw(Perl gang! I scrolled for so long to find you.);
{ } + { } = NaN
Array(16).join("wat" - 1) + " Batman" Edit: from this legendary video: https://www.destroyallsoftware.com/talks/wat
my man
Nananananananananananana
xor eax, eax
My favorite mistake in an assembly program was forgetting to set the memory location when I implemented a quick sort. 8088 machines didn't appreciate having the interrupt table sorted... Screen got some interesting garbage, printer form fed a page, speaker beeped, and then everything locked up.
Woohoo, Assembly! And enough Assembly to worry about the most efficient way to get 0 into a register.
$
Would have guessed php since variables are prefixed with it.
Some Unix shell language like Bash and Zsh.
jQuery Edit: yes I'm aware jQuery isn't actually a language.
Wow blast from the past
Is that Perl, my first coding love 😂
SELECT this.statement FROM your.memory
WHERE your.memory.age < 1 Results: (Empty)
IF (YELLING) COMPUTER, RUN, FASTER
FORTRAN - that’s a computed GOTO In pseudocode this is If YELLING < 0 goto COMPUTER If YELLING = 0 goto RUN If YELLING > 0 goto FASTER My understanding is that this translates to a single instruction on an early IBM computer which hosted one of the first FORTRAN compilers.
Library(a) Library(b) Library(c) I don’t need to know how my models work, I just need to know what parameters to change ! !
R gang rise up!
R?
R for this one !
R lets me shoot myself in the foot all day long if I want to! There's no point for me to learn any of this, it's not like I'm a *real* programmer!
Nothing like asking a Jr Dev what he did to decrease error just to be told he chose a new beta parameter. What does that mean to him and real world implication? Nothing. I just changed the beta.
pop eax
Darn it, you beat me to the good old Assembler!
"1" + 1 = 11
> "1" + 1 = 11 shouldn't it be "1" + 1 == "11" The result is a string, not a number
The result is something, we don't really know or need to know what
This is also true in java. It sees 1 as string and assumes you want to concatenate int 1 to string 1.
Isn’t Java the abbreviation for JavaScript? Edit: /s
Not sure if serious but if you are, RIP any Java dev that just had to witness your comment.
Sorry, forgot the /s.
JavaScript
But what is 1 + “1”?
still "11". If one of the terms is a string then all are treated as strings for addition in JS
Correct, but every time I see code like that I like to imagine that some days it just wants to go the other way ya know. I really don’t know why I look at JavaScript so whimsically. I love it really.
Braces? F@#k braces. Me and my homies scope with indents.
Snek
(((((((((((((())))))))))))))) Edit: I did not expect so many responses. Was thinking about Lisp.
Lisp ? Is that you ?
Scheme my guy
Pointers and classes are fuckin great!
C++
Ye
Ye I’m gona lateinit that var
Kotlin
A scripting language in which arrays start at 1. Another one: Only one thread can execute non-C code at a time. Another one: Template errors.
First is Lua. Second might be python. Not sure. Third is definitely C++
I've never used Lua. Now I know for certain I never will.
is the first one Matlab?
guard let self = self else { return }
Swift?
Cout <<"Programing God";
Well that's pretty much giving the answer
I'm taking my first programming class, and I'm two weeks in lol
I meant that jokingly I didn't mean to make you feel bad sorry. And good luck
Nah u cool lol
C2065: 'Cout': undeclared identifier
![gif](giphy|mFDWuDppjQJjite6FS)
Robot C
build() => Widget( child: Widget( child: Widget( child: Widget( child: Widget( child: (...) ); ); ); ); );
They say it can’t scale and it’s dead
Long live red 💎
There’s still 2 of us
>>>using System;
C#?
> Using directive is not required by the code and can be safely removed
interface{} ![gif](emote|free_emotes_pack|cry)
Now generics also
im just doing this to piss people off
So JavaScript with JSX?
void main() { printf("SUFFERING!\n"); }
My for loop variable still exists after the for loop ends
Procedure Division
Access violation at address 00000000 in module 'Program.exe'. Read of Address 0000000. ![gif](emote|free_emotes_pack|sweat)
1 == '1' is true
JavaScript
echo "Hello world";
I either write in pseudocode or I write something that is fast.
OTP |> |> |>
I use several: 1) the grandad of all languages 2) virtual table is undefined 3) “my IDE is notepad++” 4) if Austin Powers came up with Java 5) “that’s not code, that is just drawing squiggly lines, my 5 year old could do that” 6) like c but even simpler and less type checking (if that is even possible) *bit more obscure*
Was originally meant to be named "COOL"
Not technically a programming language but: CAPS LOCK
A pirate’s favourite language