this post was submitted on 08 Jun 2024
317 points (96.2% liked)

Programmer Humor

32386 readers
698 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 34 points 5 months ago (7 children)

Meh? I write pretty much exclusively in C and honestly I still like C++ better, and wouldn’t mind switching to Rust either

[–] [email protected] 18 points 5 months ago (4 children)

I started with c++ so does c really has advantages over c++ ?

And yeah same, Rust seems to be pretty cool too, at some point I'm gonna try it...

[–] [email protected] 13 points 5 months ago (2 children)

I started in C and switch to C++. It's easy to think that the latter sort of picked up where the former left off, and that since the advent of C++11, it's unfathomably further ahead. But C continues to develop and occasionally gets some new feature of its own. One example I can think of is the restrict key word that allows for certain optimizations. Afaik it's not included in the C++ standard to date, though most compilers support it some non-standard way because of its usefulness. (With Rust, the language design itself obviates the need for such a key word, which is pretty cool.)

Another feature added to C was the ability to initialize a struct with something like FooBar fb = {.foo=1, .bar=2};. I've seen modern C code that gives you something close to key word args like in Python using structs. As of C++20, they sort of added this but with the restriction that the named fields have to come in the same order as they were originally defined in the struct, which is a bit annoying.

Over all though, C++ is way ahead of C in almost every respect.

If you want to see something really trippy, though, have a look at all the crazy stuff that's happened to FORTRAN. Yes, it's still around and had a major revision in 2018.

[–] [email protected] 2 points 5 months ago

I just like that it's relatively procedural. Assembly too. Classes etc are just not something I've needed... Yet.

load more comments (1 replies)
load more comments (2 replies)
load more comments (4 replies)