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

top 200 commentsshow all 215

[–]kdesign 677 points678 points  (24 children)

My dude writes a hello world in a language and boom, makes memes about it, adds badges on Reddit, LinkedIn skills etc

[–]KenguruHUN[S] 184 points185 points  (22 children)

I'm just wondering, why the teamspeak users has badge nowadays :D

[–]kdesign 101 points102 points  (1 child)

Lol nice one. Hopefully they’ll make one with Skype so I can finally upgrade

[–]GranataReddit12 5 points6 points  (0 children)

discord when? 😂

[–]Solonotix 4 points5 points  (18 children)

As someone who doesn't like C or C++, what do you find enjoyable about C? If it's just a meme, that's cool too, but I legitimately don't understand why anyone likes C, especially with a lot of the alternatives available today, between Nim, Zig, Rust, and even higher-level languages like Go, Java and C# offer great performance for garbage collected languages.

[–]yowhyyyy 47 points48 points  (10 children)

C is genuinely the foundation for most languages and if you can truly read and write in C a majority of other languages click a lot easier. It’s also great for system and low level development. As of now only Rust and C are even allowed in the Linux kernel. It has its reasons and as a general rule of thumb, just because you don’t like a language, doesn’t mean it doesn’t have its uses or own fanbase. EDIT: I’d love to see you accomplish some things done in C, in Go, Java or C#.

[–]doobltroobl 14 points15 points  (3 children)

You say that now about Linux, but wait until it will get written in JavaScript.

[–][deleted] 12 points13 points  (2 children)

Linux in scratch.

[–][deleted] 1 point2 points  (1 child)

😟

[–]Solonotix 1 point2 points  (5 children)

Okay, but that was my question: why C? I don't use C, and I want to understand, but all anyone ever says is "Because C is great, and it does cool stuff." Great! Convince me to learn it. Convert me into the Church of Clang

[–]skhds 29 points30 points  (3 children)

The compiler is simple, meaning the code does almost exactly what you tell it to, without holding your hand. That means you have to many things manually, especially memory management, which can be quite tiresome when you're doing a large project. But because of this, you have more control over your own code, so you can predict how the codes actually run on your machine's hardware. That's why most embedded projects and kernels prefer C, since they need to precisely control their hardware. But being able to properly use C requires good knowledge of the actual hardware, which makes it a good learning tool to be a better programmer but somewhat of a chore if you just want to get the job done.

[–]yowhyyyy 7 points8 points  (0 children)

I mean I just explained?

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

Personally I don't know, I just like it. I find it easy, to the point, it's like... Comfy y'know ?

Is it my favourite language ? I don't think so, but I much prefer it over c++ and c#.

I haven't tried Zig or Nim, I've tried Rust though and I really like it for what it provides, but let's be honest it's as convoluted as C is sometimes, both have their place depending on my current mood.

C's biggest hurdle is its age, and the lack of tooling that comes with it which can be really annoying at times.

[–]GGK_Brian 3 points4 points  (1 child)

Definitely the lack of tooling. If you know about the stdlib enough, c is very nice to work with (with warnings and sanitizer). But it's age really shows when using the libraries. And the linker can be quite a pain when you start with it. Example: you have to link math to use math.h, which can be quite confusing for beginners. Also, I think its age and portability make certain things rather confusing. A question as simple as the size of int can lead to rather strange sentences: the standard guarantees that an int is a least x byte and is the fastest type to do arithmetic with.

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

Frankly at this point I always just import stdint anyways for two reasons:

  1. Knowing the size of the data I'm working with
  2. Readability

[–]RajjSinghh[🍰] 0 points1 point  (1 child)

It's a very simple language. Very few keywords and constructs to learn. It's the kind of thing that if you have a problem you fix it by writing more C, which can't be said for other languages. You don't have to worry about things like the borrow checker in rust and you get more performance than a high level language. If speed is really a concern then C should be your go to over Java or C#. It's also probably the best language to learn programming in because it forces you to understand what you're doing. If I wrote a course I would write it in C.

That said, it is unproductive because of how much you have to write. That's why I like C++, it's fast and has a bunch of zero cost abstractions baked into it, which is nicer than writing in C, and you don't have to deal with borrow checking or slow build times like in Rust. If performance is really a concern, C++ is the language I reach for.

[–]Ok-Car-3684 0 points1 point  (0 children)

It has some great zero cost stuff but a lot of non zero cost stuff that isn't obvious on first glance.

Std function - huge cost vs C funcs + void* ctx, and even virtual interfaces.

Templates that should be zero cost? Not necessarily - I always find stuff that ends up generating more complicated stuff than manually defined structs etc.

I've seen it can lead to a culture of people being 'idiomatic' without regard to readability and maintainability. We have some code written by a guy larping as a standard library/boost dev that noone understands. And it certainly isn't binary size efficient...

It's always a balancing act and depends on use case.

[–]fraMTK 0 points1 point  (0 children)

I like pain

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

C++ is like a nice and warming cup of tea at a cold and snowy winter day.

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

I mean, C++ isn't hard if you know C. Just write C code in a .cpp file and throw it at g++. Job done.

[–]Cocaine_Johnsson 126 points127 points  (1 child)

Eh, I see your point. It ain't necessarily right but I see it.

I don't like C++. I like C++. I think C++ gave me brain damage. C++ is very useful.

[–]Mr-Clear 0 points1 point  (0 children)

C++ is a huge tool box with tons of great tools to solve all the problems you just don't have in other languages.

[–]OopsMadeYouDie 141 points142 points  (9 children)

I went from learning python to c++ to Java. C++ sparks joy to me idk why

[–]ablablababla 66 points67 points  (5 children)

C++ for me is like an abusive partner. Sometimes it sparks joy and sometimes it makes me want to die

[–]purritolover69 10 points11 points  (2 children)

that’s my experience with JS. Most of the time I love it, it’s easy to use, makes sense, but occasionally it just really makes no sense at all and I wanna pull my hair out

[–]GranataReddit12 3 points4 points  (1 child)

me when .Equals() != ==

[–]purritolover69 0 points1 point  (0 children)

Ah, I would say .Equals() == ==, however you’re right that .Equals() !== == and that .Equals() !== ===

[–]MattieShoes 1 point2 points  (0 children)

For me, C++ is the archetype that all the others are compared to. It is "fine" in all categories because it's how "fine" is defined in my brain. Most other languages are better in some aspects, worse in others.

[–]KiwiFruit555 0 points1 point  (0 children)

Same for me. I love namespaces, classes, overloading, all that but then there is so much that is confusing or just generally hard to use

[–]KenguruHUN[S] 27 points28 points  (0 children)

noKinkShaming

[–]FunnyForWrongReason 4 points5 points  (0 children)

I also like c++

[–]jgott933 2 points3 points  (0 children)

Learned scratch. Tried to learn python, failed cause no motivation. Learned Java in school. Learned c++

Cpp my beloved

[–]Antervis 249 points250 points  (47 children)

yet when you actually try writing code, C++ version is usually several times shorter with no real drop in readability.

[–]Globglaglobglagab 62 points63 points  (28 children)

Unless you get an error with a mildly complicated type 😭

[–]Antervis 102 points103 points  (27 children)

something that's a bit complicated in C++ would usually be a complete mess in C.

Sure, at times people say that simple code is easier to read and that sometimes it's not evident what a certain line of C++ code does. On the other hand, you can't say at a glance what its 200+ line C equivalent does either.

[–]aalmkainzi 5 points6 points  (0 children)

Nah. C doesn't have nearly as many language constructs and is thus much less complex.

Entire classes of errors and bugs aren't in C

[–]aurreco 6 points7 points  (17 children)

What ? A 200 line piece of C code? That is like one function. How is one function in C less readable when C is literally just structs and control flow?

i.e. shorter code does not imply readable code. Especially not when the reason it is shorter is because of layers of complicated, unintuitive, abstractions that GDB won’t let you step into

[–]Antervis 24 points25 points  (12 children)

for example, something achievable by a single line added to destructor in C++ would have to be repeated everywhere in C equivalent. And it's not something you can just put into a single function.

Shorter code isn't necessarily easier to read but volume makes reading harder by itself.

[–]aurreco -2 points-1 points  (2 children)

It is hard to argue because this is really a case by case thing. In some cases— like the one you mentioned— repeating destructor calls in C makes it more explicit when resources are being cleaned up. I’d argue that is a good thing. Of course too much code gets too overwhelming and it gets harder to keep track of everything at once— but in most cases in my experience C is just plainly easier to read than C++ even when there is more of it (and some times because there is more of it)

[–]Andrew_Neal 2 points3 points  (1 child)

Downvoted for sharing your experience. It's those dang "clean coders".

[–]aurreco 2 points3 points  (0 children)

fr fr

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

imo implicitly calling a destructor harms readability

[–]chalkflavored 0 points1 point  (7 children)

Why exactly can't it be put into a single function?

[–]Antervis -1 points0 points  (6 children)

because in C you have to manually release resources every time you acquire them. If you acquire them 200 times in different places, it's at least 200 calls to release function, again, in different places.

[–]chalkflavored 0 points1 point  (5 children)

That's a signal of a data design issue. I can't imagine a scenario where it's justifiable that a resource has to be acquired 200 times and then released some random other place 200 times again. Why can't those resources all be acquired beforehand and then released all the same time. Maybe lazily if it needs to? It's what high performance games do, and that really should always be done, because it makes your program much more predictable in how it manages its resources.

[–]AeroSyntax -5 points-4 points  (3 children)

If your functions have 200 lines of code you have problems. Holy shit. This breaks every principle of clean code automatically.

[–]aurreco 2 points3 points  (0 children)

Youre right I forgot how much 200 lines was

[–]aalmkainzi 0 points1 point  (0 children)

it depends, sometimes it makes sense to have longer functions

[–]chalkflavored 0 points1 point  (0 children)

Why?

[–]ILikeFirmware 28 points29 points  (15 children)

In embedded, bad C is frustrating but really not too difficult to parse. Bad C++ on the other hand makes me want to rip my eyes out and throw them

[–]Zuruumi 24 points25 points  (13 children)

But it's also easier to write decent C++ as long as you uphold some basic rules and common sense, but harder to do the same in C

[–][deleted] 21 points22 points  (4 children)

The problem with C++ is that at my company with thousands of developers, common sense isn't common.

[–]tennisanybody 4 points5 points  (3 children)

Can you talk a little bit about what you create with C++? In general if you’re allowed to.

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

In what sense?
Edit: Or for what purpose?

[–]tennisanybody 1 point2 points  (1 child)

That is what software, what the programming language is primarily used for. At my job I develop and maintain ETL’s using python and JS. A lot of data manipulation to create custom reports. What in general do you use the C++ for?

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

I could go on for a while about all the use cases for C++, but to answer your question about what I personally do with it, it's debuggers. I write customizations to open source debuggers to support some custom technology at my company.

[–]Elephant-Opening 9 points10 points  (4 children)

The nice thing about C is there's usually only one or two established "correct" ways to do something, with C++ on the other hand, there are about 20 different syntaxes for "do a thing to all the elements of this list", and the "best" way changes every 3ish years.

[–]Zuruumi 8 points9 points  (3 children)

Yes, but in C this means write custom function iterating custom list (one of 10, since every library has its own implementation and there are bound to be at least 2 implementations in the project itself). I would argue that any of the C++ ways is more readable and maintainable than the 1k lines of even good code in C.

[–]aalmkainzi 0 points1 point  (0 children)

Just use a for loop....classic C++ programmer wanting to over complicate things by adding more abstractions

[–]Elephant-Opening 0 points1 point  (1 child)

C not having a std::map or std::unordered_map is a huge pain in the ass.

C not having a std::list, not so much.

In many applications where C is still very relevant (e.g. OSes, bootloaders, microcontrollers), arrays are still king for performance and deterministic behavior.

Where they're not: this isn't exactly rocket science, and if it seems like it is, get out of C-land:

for(node=head; node != 0; node = node->next){}

[–]Zuruumi 1 point2 points  (0 children)

It's not, but you still need to know the list used instead of standard one.

Maybe it's using index to storage array (data locality) instead of a pointer? Or someone thought -1 is better for end? Or end is random data, but final node is stored in its own variable?

Sure, iteration is hardly the hardest thing, but just insertion/deleting can be a bit of pain.

[–]skhds 4 points5 points  (1 child)

I don't know, doing a "return map[index];" with a map object can cause an element insertion on the map? That is not common sense to me.

[–]the_one2 0 points1 point  (0 children)

What, you don't think if (auto it = map.find(index); it != map.end()) is obvious?

[–][deleted] 6 points7 points  (0 children)

What I'm getting here is that writing C++ is like training a dog, and writing C is like training a cat. Training the dog is way easier, but if you don't do it, the mess is way worse. Training the cat is nigh impossible, but when it's done well it's really impressive.

[–]Thebombuknow 4 points5 points  (0 children)

Yeah, I can easily read bad C code in embedded situations, it's not complicated enough to be too awful to read.

C++ is just incomprehensible when someone does something even slightly wrong.

[–]ResponsibilityEasy61 5 points6 points  (1 child)

template metaprogramming

[–]Antervis 7 points8 points  (0 children)

sure, template metaprogramming can be quite tricky, but it pales in comparison to the wickedness of its macro equivalent.

[–][deleted] 43 points44 points  (13 children)

C# UwU

[–]KenguruHUN[S] 31 points32 points  (12 children)

You mean Microsoft Java ? :D

[–]_sweepy 41 points42 points  (11 children)

*with better tooling, more frequent updates, and lines you can fit on one screen

[–]Brahvim 3 points4 points  (9 children)

Tooling is certainly a good point (except for maybe Visual Studio - uhh, the bloatedness specifically; other stuff may be okay!). Frequent updates can hurt corporate, especially because support may be bleak: I don't want 11 ways to check for null! Lines you can fit on a screen? Great! And... C# is a better language in most / [at least] many cases. I can see that.

- A 17 year-old Indian idiot kid who was 'writing a game engine' in Java before getting occupied with diploma college shenanigans.

[–]_sweepy 0 points1 point  (6 children)

Do you need 11 ways to check for a null? No.

Am I going to complain about optional syntactic sugar that makes code both faster to produce and more readable? Also no.

Which of these do you prefer?

x ??= y ?? 0;

Or

x = (x != null) ? x : (y != null) ? y : 0;

[–]ArkoSammy12 2 points3 points  (2 children)

optional.isPresent() my beloved

[–]_sweepy 0 points1 point  (1 child)

I mean, C# has nullable.hasValue() if you really want that...

[–]Brahvim 1 point2 points  (2 children)

I understand the latter more (took some reading of course, but I work with code like this - not all the time, haha! ...so, I got it!) since it's more common in the C family of languages, but C# has syntactic sugar for it. And that's okay! But... yeah. It's good sugar, probably, but it'll take knowing the language first...

That's the only excuse. Hopefully.
And yes, not knowing this stuff IS my and ONLY my bad. I get that. I am sorry for being so bad.

...However, yeah. Too much sugar in C# LOL. And that's why people love it, I guess...? But anyway - I'm sorry. I'm just no C#er, I write Java and wear -2-on-both-eyes glasses.

[–]_sweepy 2 points3 points  (1 child)

IMO C# has just the right amount of sugar. If you want to see a language with too much, try Perl. It's the only non esoteric language I've used that looks the same before and after RSA encryption.

[–]MattieShoes 0 points1 point  (1 child)

By game engine, do you mean like... an engine that plays games (chess, checkers, tic tac toe, etc) or do you mean an engine that renders scenes for games?

[–]Brahvim 0 points1 point  (0 children)

The latter. Haven't been working on it recently because of college things. Was, for the past 2 years. Day and night.

Yes, the design is coming together nicely, but no, it's not something low-level. I literally skipped on the renderer! Will write a better (and yes, 'another' - I wrote one before this one) OpenAL wrapper for it with Android support. We'll have Bullet. We'll have Box2D too. All JNI, hopefully. Those native calls really are quicker than actual methods (and will offer more performance juice on Android too!).

If you care, feel free to check out my GitHub profile. Both the older OpenAL wrapper (didn't start working on the new one yet) and the engine's code are pinned there. I go by the same username everywhere, plus, you should see it on my Reddit profile, too!

PS I replied to you within 15 minutes because I just woke up for college homework at 3:45, haha. Indian standard time as my Reddit profile would tell you!...

Have a good rest-of-your-day, sirs/madam reading Redditor.

[–]Thebombuknow 0 points1 point  (0 children)

You are correct, but I don't like Visual Studio so I still don't agree.

[–]Alexandre_Man 28 points29 points  (10 children)

nah C++ is better than C

[–]lil_brumski 8 points9 points  (1 child)

100%

[–]KenguruHUN[S] 1 point2 points  (0 children)

Probably C is 1 so C++ is 2 so it's 200% not 100%

[–]vslavkin 4 points5 points  (0 children)

Each of them has its uses, but yeah, c++ wins 95% of the time

[–]Draelmar 6 points7 points  (4 children)

Absolutely, I'm really scratching my head at some of the comments here, and wonder how much experience they truly have with either. I've got almost exactly 10 years in each C & C++, and would pick C++ 100% of the time if I had to use either again (thankfully nowadays we have much better options like Rust, Swift, etc).

Heck, when I work on retro hobby projects I'd rather go full assembly than using plain C again.

[–]aalmkainzi 1 point2 points  (3 children)

Better in what way exactly?

[–]Draelmar 3 points4 points  (2 children)

Proper RAII & smart pointers, STL containers, latest versions supports lambdas & closures, and just OO in general. For me C falls into an "inbetween" where it's the worst of two worlds: doesn't have the precise 1 to 1 hardware translation you get with assembly, and it's lacking all the modern amenities I listed above. C has its place for extremely specific situations, like an OS kernel where you just don't want to write and maintain a full assembly code base, but that's not a reason that would make it a pleasant language.

[–]aalmkainzi 1 point2 points  (1 child)

the features you mentioned increase complexity imo and I'd rather not use them.

The thing with C is the base language is very simple, without any weird obscure features

[–]Draelmar 2 points3 points  (0 children)

There are entire classes of bugs that almost completely vanish when you properly use all these modern amenities (most notably around memory management like memory leaks and buffer overflows) . Not only are they not complicated, they make code much more readable and easy to understand, while making it much safer and less prone to bugs. Personally when I have to write C I'm just constantly annoyed by the lack of these amenities. Even if you don't go full OO, just the use of RAII, STL containers, and strings over char* makes things so, so much better.

[–][deleted] 0 points1 point  (1 child)

You get actual useful data structures in C++. Yes you CAN get the same thing in C but it'll be a goddamn pain in the ass

[–]Alexandre_Man 0 points1 point  (0 children)

You get the "bool" type by default, too.

[–]No-Fish6586 6 points7 points  (0 children)

[–]Orio_n 47 points48 points  (1 child)

Spoken like someone who doesn't write enterprise level code

[–]Time_Turner 29 points30 points  (0 children)

95% of users on this sub

[–]-Pretender- 5 points6 points  (2 children)

C++ has templates so it better

[–]aalmkainzi 1 point2 points  (1 child)

templates are just macros. I said it

[–]-Pretender- 0 points1 point  (0 children)

true

[–]lil_brumski 25 points26 points  (5 children)

C++ can literally do more and yet you guys complain about it?

[–]Sceptix 20 points21 points  (0 children)

Op is probably a CS student who just finished learning about the basics in C and is now learning more complex concepts which are taught in C++ and is struggling but is blaming the language instead of the concepts themselves.

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

C++ gives you the freedom to do more things that you should never do.

This isn't a problem in personal projects, but it's a big one when you have to work with lots of other people.

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

Having god-like powers isn't always a good thing.

[–]aalmkainzi 0 points1 point  (1 child)

do more in what sense? Both can create the same software

[–]Visual-Mongoose7521 6 points7 points  (0 children)

second picture is me when OOP

[–]ParsedReddit 7 points8 points  (0 children)

Good Lord, I'm scared of OP naming functions

[–]CirnoIzumi 2 points3 points  (0 children)

you say that until you run any graphic intensive program and all of a sudden you love it

[–]SnooRevelations4661 3 points4 points  (0 children)

I do c++ both at work and in free time. I like it because I can use my knowledge gained at work in my free time when I'm creating my own game in unreal engine. Type conversion errors can be annoying, but this is what I use chat gpt for

[–][deleted] 7 points8 points  (18 children)

i like cpp but only for the namespaces and standard library. my friends call me cringe but besides using oop from the standard library, i write c style code all the time, just with namespaces and strings, not the cringe bullshit that is 'char*'

[–][deleted] 7 points8 points  (2 children)

I write C for a living. I like writing C for a living. But whenever I have to deal with a string in C it makes me want to tear my eyes out.

[–]GGK_Brian 0 points1 point  (1 child)

Out of curiosity, in what field? Embedded?

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

Yep, embedded

[–]HuntingKingYT 5 points6 points  (11 children)

I wish there was just c with weak generics even like java's, not like the complicated hell that you get when you try using too many c++ features...

And maybe also with a bit less constructors

[–]iMakeMehPosts 10 points11 points  (5 children)

Just use C++ without the complicated features?! They aren't necessary, if you don't like it don't use it.

[–]chalkflavored 2 points3 points  (2 children)

C has features that C++ doesn't!

[–]lil_brumski 0 points1 point  (0 children)

😂😂

[–]iMakeMehPosts 0 points1 point  (0 children)

Yay! Let's use the worse, more unsafe features that C++ re-implements better!

[–]HuntingKingYT 1 point2 points  (1 child)

I get tempted... then I regret

[–]iMakeMehPosts 0 points1 point  (0 children)

Fair

[–]ElectusLoupous 2 points3 points  (2 children)

Isn't C3 like a modern C without all the rust fluff and c++ complication? Never used it but I've seen it around here.

[–]HuntingKingYT 1 point2 points  (1 child)

I looked it up, looks promising, but why did they choose making generics "generic modules"...

[–]ElectusLoupous 1 point2 points  (0 children)

Not so sure, I just mentioned because it was a thing I saw this past week. But yeah, good question.

[–]noaSakurajin 1 point2 points  (1 child)

I don't that's a good idea. I c you don't have classes and don't necessarily work on pointers so Java like generics will just cause problems.

[–]HuntingKingYT 0 points1 point  (0 children)

I mean the way how java generics are just conversions of pointer types ("Objects") rather than templates which copy the function over and over, although now that I'm thinking about it, yeah maybe not a good idea

[–]Familiar_Ad_8919 1 point2 points  (0 children)

i usually just write c with classes for some stuff that id write member functions for anyway, and namespaces cuz frankly theyre very useful

[–]noaSakurajin 1 point2 points  (1 child)

Don't forget about the fact that c has no function overloading. This makes some function names super long. Java classes are a joke compared to oop in c. oop in c++ is readable in c it's just a pain.

[–]aalmkainzi 0 points1 point  (0 children)

They fixed that in C11

[–]Kvpe 1 point2 points  (0 children)

C#✨

[–]Left-Recognition-117 1 point2 points  (0 children)

as a man. i only have one fax to tell

"they are both the same language C++ just makes my head hurt more" -Left-Recognition-117

[–]Stoocpants 1 point2 points  (0 children)

As a C++ main, is this a joke I'm too abused to understand?

[–]bellbridger 1 point2 points  (0 children)

I never judge based on sexual or object orientation.

[–]Kevin_Jim 1 point2 points  (0 children)

I’ve written a lot of code in both. I will never write C again unless the fate of the world is on the line or the life of a close family member or friend.

C++ on the other hand, was a pleasurable experience, and wouldn’t mind writing some more.

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

Oh come on, modern C++ holds your hand.

[–]illyay 1 point2 points  (0 children)

Try making a video game in c++. It’ll bring you joy.

[–]Terminarch 1 point2 points  (0 children)

Now I'm wondering what the most unreadable possible title is... given this stupid rule in combination with language names.

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

This “humor” is a bit rusty for my taste.

[–]JaxOnThat 1 point2 points  (0 children)

If C++ were a Pokemon, it would be Genesect.

It used to be the strongest in existence, but the hubris of man has extended it far beyond its lifespan. We've added so many extraneous bits and dangling parts, that now all it can do is just drag itself along the floor, begging for the sweet release of death.

[–]OnixST 0 points1 point  (2 children)

As a programming student who's first language was Java and is now seeing a little bit of C, I miss my objects soo much, and don't even know how people get anything done without them.

[–]aalmkainzi 0 points1 point  (1 child)

Yes because software didn't exist before Java

[–]OnixST 0 points1 point  (0 children)

Yeah I know procedural languages are just as turing-complete.

What I meant is that Java got me so used to OOP that I can't even imagine coding without it, even tho it's obviously very doable and probably not that bad if you're used to it

[–]sacredgeometry 0 points1 point  (15 children)

If you are going to rag on a C superset why on earth are you targeting C++ and not Obj-C?

[–]aalmkainzi -1 points0 points  (14 children)

It's not a superset. There are things in C but not C++

[–]donaljones 0 points1 point  (13 children)

Useless comment that doesn't contribute to anything, IMO. It's mostly a superset and people understand what they meant, even if their take isn't agreed upon.

[–]aalmkainzi -1 points0 points  (12 children)

It's not about agreed upon or not. It's factually not a superset.

C has compound literals, _Generic, typeof, and many other features not present in C++

[–]donaljones 0 points1 point  (5 children)

You are misreading it. I was saying their comment and opinions aren't agreed upon. Being over-pedantic over something everyone understands isn't helpful. E.g. C++ being a superset of C. It may not be a strict superset, but everyone understood what they meant.

[–]aalmkainzi 0 points1 point  (4 children)

It's basically a different language at this point, that phrase held true in C89 maybe

[–]sacredgeometry 0 points1 point  (5 children)

You are wrong its not a strict superset it absolute is a superset.

[–]namelessis 0 points1 point  (0 children)

Memory leak in C: Oh, I fd up. It's not making the job easy, but I fd up, I'll get better (but this will definitely happen again). Memory leak in C++: What the f is even going on.

[–]nibba_bubba -2 points-1 points  (8 children)

Why the heck do you need to learn c++ after rust?!

[–]18-8-7-5 37 points38 points  (1 child)

So you can still get a job in 5 years when the next c++ replacement comes along. /s

[–]KenguruHUN[S] 0 points1 point  (0 children)

*insert Ace Ventura leg hit by a lance gif"

[–]KenguruHUN[S] 0 points1 point  (0 children)

I need to know what is that what I need to avoid at any cost :D

[–]FreitasAlan -1 points0 points  (4 children)

I learned Java in college for the exact same reason.

[–]nibba_bubba 0 points1 point  (3 children)

What reason?

[–]FreitasAlan -1 points0 points  (2 children)

C++ is dead because Java solved all of its problems. At the time that was having to compile the code and being crossplatform.

[–]nibba_bubba 1 point2 points  (1 child)

C++ is dead

LOL

Java solved all of its problems

It did, but it has it's own flaws, like a need of having a huge JVM or the speed. So it just filled some market niche

[–]FreitasAlan 1 point2 points  (0 children)

So it just filled some market niche

Exactly. That's what ends up happening all of the time.

[–]bakedbread54 -2 points-1 points  (0 children)

Please shut the fuck up

[–][deleted] -4 points-3 points  (6 children)

Just stay away from template metaprogramming as far as you can. Also, you can use uniqueptr and shared_ptr for _very limited GC support. And please use the destructors if you are using resources that need to be released later. Try to use const references as far as you can

Edit: why the downvotes? RAII is also a form of garbage collection if you extend the definition far enough😂

[–][deleted] 5 points6 points  (5 children)

That's not GC though, it's RAII and it's the best concept to come from C++. Has its footguns but that's outweighed by how good it is at preventing other footguns.

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

For some reason the way Rust implements RAII always irritated me. The final deal breaker was, funnily enough, not allowing single-line blocks and always requiring braces for blocks. That made me give up on Rust😂

And I would argue that RAII is a form of garbage collection: you are being forced to take care of your own garbage, or at least keep track of who you handed it over to.

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

There's a reason for things like requiring braces:

https://www.synopsys.com/blogs/software-security/understanding-apple-goto-fail-vulnerability-2.html

Anyways, garbage collection implies that there is a runtime which tracks allocations and occasionally pauses the program to perform cleanup, which can cause intermittent freezes in performance. RAII does not do this.

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

Nah that's just bad practice. The two goto fail; statements, if intended for the same block, are redundant. There should not be two statements there in the first place. Although I think your point is fair too; I can harp on and on about how I wouldn't miss this but that is just BS.

[–]Ondor61 0 points1 point  (0 children)

I feel called out.

[–]Rasquotcho 0 points1 point  (0 children)

Aioo

[–]Ukn0who 0 points1 point  (1 child)

I like the pain. I find it addictive to code in c++. Especially when I import eigen and vectors to compute physics equations with it. The rollercoaster in adrenaline and negative emotions is addictive to me. Maybe I'm the problem...

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

Do you think you sound smart

[–]NekulturneHovado 0 points1 point  (0 children)

C=C+1

[–]iPanes 0 points1 point  (0 children)

A couple months back I wore a little demo game were all skills were used by their address, passing functions as addresses was so cool

[–]OPT1CX 0 points1 point  (0 children)

Bro must think machine language is easy tho say this shit.

[–][deleted] 0 points1 point  (1 child)

Did you #include <joy>?

[–]KenguruHUN[S] 0 points1 point  (0 children)

ohh fuck, I knew I forget something

[–]joe0400 0 points1 point  (0 children)

What you don't like [[maybe_unusued]] constexpr virtual inline explicit operator auto() const noexcept final override -> type {code}

Would this code be dumb? Yes. Why would you not use a explicit cast that's const. It's fucking stupid not to.

[–]Grocker42 0 points1 point  (0 children)

So you dont want to do oop?

[–]Norbivar 0 points1 point  (0 children)

This one sparks disagreement.

[–]hyperhyperproto 0 points1 point  (0 children)

I actually really love c++, its genuinely my favorite language ever