169

I rather write garage code than using slop

you are viewing a single comment's thread
view the rest of the comments
[-] istdaslol@feddit.org 8 points 5 hours ago

As C++ is a superset of C, I reckon you should start with C, as many concepts of C++ are translatable to C, which is what the first C++ compiler did.

I still use fprintf instead of cout because it feels more “proper”

[-] observantTrapezium@lemmy.ca 4 points 1 hour ago

I very strongly disagree. It's practically a superset for backwards compatibility reasons but modern C++ coding patterns are vastly different to C. Modern English is kind of a superset of Shakespearean English, but you don't need to know it for most daily tasks. C++ is much more elegant and safe when avoiding C patterns. C has its place and I use it sometimes, but the two should absolutely not get confused because of the name and compatibility.

[-] one_old_coder@piefed.social 9 points 3 hours ago

I reckon you should start with C

I tried that 20 years ago and it was a massive waste of time. Spend a few days to understand pointers, then embrace modern C++ with the STL, it's safer and more productive.

Also cout is dead, you can use print, println, and format now.

[-] ColdWater@lemmy.ca 14 points 4 hours ago

That's what I tried to get started with, but I wanna make programs with qt6 and the qt creator doesn't support it so c++ it is

[-] mamg22@sh.itjust.works 0 points 3 hours ago

Props to you for learning C++, its a neat powerful language, although it has grown quite overcomplicated through the years.

Though if you want something a bit easier, you can also use Python for Qt development through the PySide6 library. It is one of the officially supported Qt languages alongside C++ and JS. I've personally used it for a few programs and it works wonderfully, it is one of my favorite ways to make GUIs for myself, it just works™

[-] lime@feddit.nu 1 points 4 hours ago

a lot of languages support qt6 though

[-] ColdWater@lemmy.ca 9 points 4 hours ago

but from what I understand from form posts is it's harder to make qt6 programs with c than c++, because I have to make warper in my qt6 program with c++ for that c code to work? Idk I'm just getting started

[-] ImgurRefugee114@reddthat.com 1 points 1 hour ago* (last edited 1 hour ago)

The problem with QT is that everything becomes a "QT app" when you start writing with QT. You'll end up using more of their types than the standard library, and getting a clean front-end / back-end separation is more difficult.

Anyways, C++ isn't just a superset of C; they're surprisingly different, and the best modern approaches are extremely so. That advice may have been true before 2014 and a bit until 2017, but it certainly isn't now.

[-] istdaslol@feddit.org 7 points 4 hours ago

Honestly C and C++ code are the same. You can use C++ function calls and objects when needed and have everything else pure C. Don’t think of them as two completely different languages, C++ is more of an “object oriented framework for c” than its own language. That is a gross oversimplification but you get what I mean.

[-] ImgurRefugee114@reddthat.com 2 points 1 hour ago* (last edited 1 hour ago)

That really hurts to read. Have you programmed with any spec newer than c++11? Best-practices have changed a lot. It isn't "c with classes" anymore. Yes, most of the ancient code will work; but there are better, more efficient, and more ergonomic alternatives now.

[-] lime@feddit.nu -1 points 4 hours ago

sure but you can also use like java or python

[-] ColdWater@lemmy.ca 8 points 4 hours ago
[-] lime@feddit.nu -2 points 3 hours ago

i thought you were learning? or is it just learning c++

[-] mkwt@lemmy.world 1 points 2 hours ago

As C++ is a superset of C

This is not true. Both ISO C++ and ISO C have have features that are not available in the other language. Therefore, there is no subset or superset relationship.

I would tweak this recommendation. If you want to start with C, consider writing C-style code into .cc or .cpp files, and compile as C++. You will therefore be learning "C++ with functions only" as opposed to "C with classes."

[-] mmmm@sopuli.xyz 5 points 4 hours ago

At uni I was taught C++ first (all the basics, logic 101, control flow, pointers, etc). Then I was taught data structures with C the next period (linked lists, stacks, queues, a tiny bit of trees...). Then I found out I sucked at maths and switched to graphic design!

All in all OP is in for a hell of a ride - yeah you could just start with C but they could start with C++ too so just to get the feel of it.

[-] istdaslol@feddit.org 1 points 4 hours ago

True, it was just a recommendation because for me it made more sense this way around. Like objects are just structs with function pointers and some compiler magic to ensure private and publicness, polymorphism is just unions etc.

this post was submitted on 28 Oct 2026
169 points (97.7% liked)

linuxmemes

33207 readers
702 users here now

Hint: :q!


Sister communities:


Community rules (click to expand)

1. Follow the site-wide rules

2. Be civil
  • Understand the difference between a joke and an insult.
  • Do not harrass or attack users for any reason. This includes using blanket terms, like "every user of thing".
  • Don't get baited into back-and-forth insults. We are not animals.
  • Leave remarks of "peasantry" to the PCMR community. If you dislike an OS/service/application, attack the thing you dislike, not the individuals who use it. Some people may not have a choice.
  • Bigotry of any kind will not be tolerated. This is an LGBTQ+-friendly community -- if that is a problem for you, you should leave.
  • 3. Post Linux-related content
  • Including Unix and BSD.
  • Non-Linux content is acceptable as long as it makes a reference to Linux. For example, the poorly made mockery of sudo in Windows.
  • No porn, no politics, no trolling or ragebaiting.
  • Don't come looking for advice, this is not the right community.
  • 4. No recent reposts
  • Everybody uses Arch btw, can't quit Vim, <loves / tolerates / hates> systemd, and wants to interject for a moment. You can stop now.
  • 5. 🇬🇧 Language/язык/Sprache
  • This is primarily an English-speaking community. 🇬🇧🇦🇺🇺🇸
  • Comments written in other languages are allowed.
  • The substance of a post should be comprehensible for people who only speak English.
  • Titles and post bodies written in other languages will be allowed, but only as long as the above rule is observed.
  • 6. (NEW!) Regarding public figuresWe all have our opinions, and certain public figures can be divisive. Keep in mind that this is a community for memes and light-hearted fun, not for airing grievances or leveling accusations.
  • Keep discussions polite and free of disparagement.
  • We are never in possession of all of the facts. Defamatory comments will not be tolerated.
  • Discussions that get too heated will be locked and offending comments removed.
  •  

    Please report posts and comments that break these rules!


    Important: never execute code or follow advice that you don't understand or can't verify, especially here. The word of the day is credibility. This is a meme community -- even the most helpful comments might just be shitposts that can damage your system. Be aware, be smart, don't remove France.

    founded 3 years ago
    MODERATORS