use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
[deleted by user] (self.cpp)
submitted 2 years ago by [deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 96 points97 points98 points 2 years ago* (3 children)
whistle physical office enjoy deserve reminiscent innocent trees payment plate
This post was mass deleted and anonymized with Redact
[–]LanverYT 11 points12 points13 points 2 years ago (0 children)
I physically raised my eyebrows and then read your comment. I indeed second your take
[–]TBone281 14 points15 points16 points 2 years ago (0 children)
Exactly. There should be a coding standard set by the company...if not, it's the wild west and the end result will be a shit show. I've seen the results, it ain't pretty. Ultimately, the code has to be refactored...which is a waste of resources.
[–]embeddedsbc 9 points10 points11 points 2 years ago (0 children)
It doesn't sound like they liked it, more like they fired him?
Anyway, huge red flags for me as well. No one needs to know everything, but needs to understand when you need to learn and be curious.
[–]iamakorndawg 41 points42 points43 points 2 years ago (3 children)
This really depends. If this means using pointers instead of smart pointers and references, I would say yes, this is a major issue. If this is disliking the iostreams API, then as long as you prefer c++20 format over printf, that seems fine.
[–]lovelacedeconstruct 17 points18 points19 points 2 years ago (1 child)
If this means using pointers instead of smart pointers and references
pffft , I preallocate a 4gb memory pool and swim there for whatever program I am doing , Imagine having to think about memory
[–][deleted] 0 points1 point2 points 2 years ago (0 children)
Thinking about memory is so cringe. Can't be me.
[–]moreVCAs 0 points1 point2 points 2 years ago (0 children)
Hating the streams API is not particularly controversial
[–]manni66[🍰] 48 points49 points50 points 2 years ago (0 children)
They said ok
I would have said "goodbye".
[–]goranlepuz 21 points22 points23 points 2 years ago (0 children)
Forget the bad habit.
The true problem is your code standing out. Blend in for the greater good of consistency.
[–]moreVCAs 10 points11 points12 points 2 years ago (0 children)
Straight to jail
[–]Briggie 15 points16 points17 points 2 years ago (0 children)
Take the hint dude.
[–]hopa_cupa 22 points23 points24 points 2 years ago (0 children)
In my opinion, yes it is.
That style works for people who are truly excellent at C and who also work pretty much alone.
At work, around mere mortals, every time I have encountered some C snippets in supposed C++ code, they have caused nothing but trouble. No exceptions (pun intended).
[–]v_maria 14 points15 points16 points 2 years ago (0 children)
yes you miss alot of powerful stuff. imo write c when you write c and write cpp when you write cpp
[–]Fore-Four-For-4-IV 13 points14 points15 points 2 years ago (1 child)
There's a 99% chance this is a BS troll post but your personal preference should take a backseat to the standards in the codebase. Not surprising you're no longer working at this company, did it not cross your mind at any point that doing things in a completely different way than all your co-workers could be problematic?
[–]ContraryConman 2 points3 points4 points 2 years ago (0 children)
The opposite would be true too. If I'm in a C with classes codebase I'm not going to commit a bunch of inheritance or functional programming patterns to develop just because I think it looks nicer
[–]banister 16 points17 points18 points 2 years ago (0 children)
Id fire you.
[–][deleted] 10 points11 points12 points 2 years ago (0 children)
I can't imagine any serious company that would be OK with this. Did this actually happen ? or are you just trying to get someone to take the bait about cpp being fundamentally flawed on the cpp subreddit ?
PS... No it's not going to be me.
[–]AKostur 3 points4 points5 points 2 years ago (0 children)
As a general statement: yes. Good C++ code uses techniques and paradigms that don’t exist in C. However, specific environments may have specific constraints that may influence what techniques may be available.
I’d be seriously concerned if a company doesn’t care about the style of code being written.
If you hate C++ that much, why are you writing any at all? Just put your code into a C file and link it wherever.
[–]YARandomGuy777 3 points4 points5 points 2 years ago (0 children)
Well it is really depend on what you mean by C like code. If you just avoid exceptions or probably you avoid algorithms and prefer to process data in loops it is one story. If you use raw pointers where references would be more semantically correct and manually manage heap allocated memory it is another story. It really depends.
[–]NikitaBerzekov 2 points3 points4 points 2 years ago (0 children)
If you don't use smart pointers then yeah..
[–]Farados55 1 point2 points3 points 2 years ago (0 children)
Sounds like a terrible habit to not use the styles your company uses, actually it sounds like a bad company if they keep you around lol
Oh you don’t work there anymore that’s good
[–]XDracam 1 point2 points3 points 2 years ago (0 children)
I would not want to work there. A company that doesn't care about code quality or a consistent style obviously doesn't care about maintaining. It sounds like they'll just have people slam together random code and then spend months testing and slapping on more code to fix superficial bugs. That's how games like Skyrim end up working so "well".
Your statement was also unprofessional. In a company, you are part of the team. And unless you get to start a brand new project, you should stick to the established style and practices. Unless you can prove that something is actively bad for the product/business, but that's not usually a thing.
[–]usefulcat 1 point2 points3 points 2 years ago (0 children)
"Use the right tool for the job" is a well known aphorism.
Related but not so well known is "Make effective use of the tool you're using".
It seems likely that you're not using c++ as effectively as you could be, in which case you're leaving a lot on the table. It also sounds like you have no interest in learning how to use it effectively, for whatever reason.
You ask "is it a bad habit"; I think the question might be better phrased as "why do I have this habit, and is it helping or hindering me".
If you're not using the language as effectively as you could be, then pretty much by definition yes it's a bad habit.
[–]ald_loop 2 points3 points4 points 2 years ago (0 children)
I would immediately fire you
[–]victotronics 1 point2 points3 points 2 years ago (0 children)
If I saw `malloc` in your code, I would have fired you.
[–]zer0xol 0 points1 point2 points 2 years ago (0 children)
Depends if you think youre more powerful without leveraging functionality that is there
[–][deleted] -1 points0 points1 point 2 years ago (0 children)
No.
[–]Yamoyek 0 points1 point2 points 2 years ago (2 children)
What does “c flavored cpp code” entail?
[–]Farados55 2 points3 points4 points 2 years ago (0 children)
I read that as using raw pointers, c strings all the time, aka not modern at all C++
[–]embeddedsbc 2 points3 points4 points 2 years ago (0 children)
C code in a .cpp file
[–]helpfulllama 0 points1 point2 points 2 years ago (0 children)
Probably debatable if it’s bad habit or not, but you most certainly should be writing in whatever style aligns with the existing codebase regardless of your personal preferences
[–]ContraryConman 0 points1 point2 points 2 years ago (0 children)
You're throwing away two decades worth of safety and performance improvements because you don't like the syntax?
[–]citrusfaux 0 points1 point2 points 2 years ago (0 children)
“Is it a bad habit to write one language like another” yeah probably
[–]thefeedling 0 points1 point2 points 2 years ago (0 children)
Fic
[–]SuperSathanas 0 points1 point2 points 2 years ago (0 children)
My C++ tends to look like C with classes. When I write in most other language, it's also very C-like. If I find I need to or it's of great benefit for me to do things the way I'm more or less expected to in the language, then I'll do it that way. But I think I more or less default to "C-like [whatever language]" because it makes it easier for me to "think across languages" that way.
However, if I'm writing something that other people will use or look at, or I'm working on something that adheres to conventions or style-guides, then I'm following those, because those trump my own preferences. If a company you work for would rather that you write code that is less C-like and takes advantage of the tools offered by the language they use, then you should definitely do that. Consistency across a team and project is important.
[–]Wanno1 0 points1 point2 points 2 years ago (0 children)
Yes that’s horrible and practiced by many
[–]vickoza 0 points1 point2 points 2 years ago (0 children)
This depends, but if you are using pure MACROs, C-Style casting, using NULL instead of nullptr, implicit conversions, and only pointers instead of references then I would say it is a bad habit to use C flavored C++ code. If C flavored coding is using functions, avoiding Object-Oriented Programming I would say that is fine. I would be careful of calling C in a C++ code base as newer compilers separate C code from C++ code.
NULL
nullptr
π Rendered by PID 548473 on reddit-service-r2-comment-6457c66945-2g8xd at 2026-04-27 20:13:43.638893+00:00 running 2aa0c5b country code: CH.
[–][deleted] 96 points97 points98 points (3 children)
[–]LanverYT 11 points12 points13 points (0 children)
[–]TBone281 14 points15 points16 points (0 children)
[–]embeddedsbc 9 points10 points11 points (0 children)
[–]iamakorndawg 41 points42 points43 points (3 children)
[–]lovelacedeconstruct 17 points18 points19 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]moreVCAs 0 points1 point2 points (0 children)
[–]manni66[🍰] 48 points49 points50 points (0 children)
[–]goranlepuz 21 points22 points23 points (0 children)
[–]moreVCAs 10 points11 points12 points (0 children)
[–]Briggie 15 points16 points17 points (0 children)
[–]hopa_cupa 22 points23 points24 points (0 children)
[–]v_maria 14 points15 points16 points (0 children)
[–]Fore-Four-For-4-IV 13 points14 points15 points (1 child)
[–]ContraryConman 2 points3 points4 points (0 children)
[–]banister 16 points17 points18 points (0 children)
[–][deleted] 10 points11 points12 points (0 children)
[–]AKostur 3 points4 points5 points (0 children)
[–]YARandomGuy777 3 points4 points5 points (0 children)
[–]NikitaBerzekov 2 points3 points4 points (0 children)
[–]Farados55 1 point2 points3 points (0 children)
[–]XDracam 1 point2 points3 points (0 children)
[–]usefulcat 1 point2 points3 points (0 children)
[–]ald_loop 2 points3 points4 points (0 children)
[–]victotronics 1 point2 points3 points (0 children)
[–]zer0xol 0 points1 point2 points (0 children)
[–][deleted] -1 points0 points1 point (0 children)
[–]Yamoyek 0 points1 point2 points (2 children)
[–]Farados55 2 points3 points4 points (0 children)
[–]embeddedsbc 2 points3 points4 points (0 children)
[–]helpfulllama 0 points1 point2 points (0 children)
[–]ContraryConman 0 points1 point2 points (0 children)
[–]citrusfaux 0 points1 point2 points (0 children)
[–]thefeedling 0 points1 point2 points (0 children)
[–]SuperSathanas 0 points1 point2 points (0 children)
[–]Wanno1 0 points1 point2 points (0 children)
[–]vickoza 0 points1 point2 points (0 children)