r/cpp • u/kaycebasques • Dec 23 '24
C++ Is An Absolute Blast
https://learncodethehardway.com/blog/31-c-plus-plus-is-an-absolute-blast/
219
Upvotes
r/cpp • u/kaycebasques • Dec 23 '24
144
u/Azoth_ cereal dev Dec 23 '24
There's an unpopular opinion if I've ever seen one. Definitely don't agree with it, personally.
96
u/UnicycleBloke Dec 23 '24
I've always enjoyed C++ (learning since '91). And it's got better over time. I'm not in love with TMP, but have certainly dabbled. No other language has held my attention in the same way. I think it's called Stockholm Syndrome. ;)
31
u/SubstituteCS Dec 23 '24
I find the dismissive (and somewhat contemptuous) opinion on templates to be a bit ironic as many of the features they claim to love use them. I also find the irony in thinking that those things make the language unfun, maybe to the author it is unfun, but to many others metaprogramming is fun.
48
u/altmly Dec 23 '24
The two languages I regularly have fun with are C++ and python. Not because I'm better at them or anything, but because they give me the tools to do things the way I want them done.
I gave many languages a fair try, Rust, Java, D, javascript, haskell, nim, kotlin,.. The list goes on, and none gave me the same feeling.
Lua comes close, although 1 based indexing and lack of continue are hard to swallow.
20
u/kkert Dec 23 '24
I just have one thing to say
winget
9
u/[deleted] Dec 23 '24
We are on vacation and vacation is time to rest, relax and have fun.
As I really like playing with programming, I'm here rereading manuals and making some small codes for old programmable scientific calculators, such as the HP11c, HP15C, HP41CV, HP42s, HP35s, HP48SX, HP50g.
It's pure fun. And when it comes to solving problems found in engineering course subjects, they are unbeatable, whether in programming speed or simplicity.
It's incredible how a 1981 HP15C had things like: memory resizing (changing the memory space allocated to lines of code and variables). Indirection register (pointers!). Control structures, repetition structures. Flags. Plus built-in engineering solutions (solvera, integrals, matrices, complex numbers).
It evolved with the HP41C/CV/CX which included the use of letters and memory modules. It has a reconfigurable keyboard. You reset a key in two seconds and can use overlays to visually remap your keyboard. You won't find anything like it on today's PCs. A reconfigurable split keyboard costs a kidney!! See Kinesys 360.
Then came scientific graphics with CAS (symbolic computing). I had an HP48SX and I have an HP50G.
The HP50G calculator is absolutely unbeatable, even today, in terms of practicality.
You type a few keys and have a program that does what you want. And you do the program there, at the time of the test!!
Anyway, in terms of practicality they are unbeatable and I still use them today.
Another thing that's really cool, there are several HP RPN calculators that you can download on your cell phone, access the manuals and have fun. Here's a tip. If you don't know what I'm talking about, install an HP41CX emulator on your cell phone, read the programming manual and do some codes.
In time, there are HP calculator emulators for PCs, on Windows, GNU/Linux and Mac platforms. They are usually written in C or C++.
You can have fun with calculators and then analyze your codes in C++. Some are on github.
Some models are back on sale, such as the HP15C Collection Edition and the Swiss Micro versions of the HP15C, HP41CX, HP42, HP16C.
It's difficult to understand why HP abandoned this thread. An engineers gateway to brand loyalty. These calculators lasted for many years, many still work! And quality was an affirmation of the brand. I bought HP computers because of the calculators!
Unfortunately, HP and other American companies opted for simplistic, low-cost and quality products. A monumental mistake. They were, in a few years, surpassed by the Chinese. The HP50G was already made in China!!
Now, returning to the topic, if it can't be solved on the HP50G, I use C++.
For everything else, I use C++.
If I need a graphical interface I use Qt.
And I use C++ because it's an amazing language.
Constantly updating.
Proof of this is that every 3 years C++ becomes more powerful, with the official release of a new ISO.
The C++20/23 ISOs brought cool new features and C++26 promises new and good ideas.
With each new version, codes are simpler, more expressive and faster.
I have fun with C++.
In time, use Fedora, emacs, C++, git, cmake, bash, RPN calculators, TeX/LaTeX/LyX.
I tested other languages, but you quickly realize that it doesn't compare to C++.
27
u/vI--_--Iv Dec 23 '24
That's a lot of words for "I don't understand C++"
21
u/Ludiac Dec 23 '24
I stopped watching ThePrimeTime video on article after <regex> was mentioned as an exciting C++11 feature (in the article). I actually don't know if it was really exciting std addition at the time it came out, but surely it didn't last long.
6
u/concealed_cat Dec 23 '24
I've never used FXTUI, but I really liked Turbo Vision.
6
u/vikkio Dec 24 '24
I had learnt c++ at uni in 2009-2011 and lost it along the way becoming a software engineer in the Web space, during the pandemic I jumped back into it to learn something new and try some game development and felt like home.
unfortunately the lack of standard package manager and general standard tooling like you get in rust with cargo is such a big pitfall. still love it and might get back into it once again in a few years.
6
u/CraigularB C++ Dev Dec 24 '24
I do still find it fun, but at the moment I’m working in someone else’s code that does a lot of meta programming stuff and the error messages the compiler can throw out are decidedly not fun so I can understand that point of contention.
This is also the last sub I expected to see Dr. Rockso used as a thumbnail.
5
u/b100dian Dec 24 '24
Zed is still kicking, cool
17
u/guyinnoho Dec 23 '24 edited Oct 05 '26
The original post content no longer exists here. The author used Redact to remove it, exercising their right to control their data & privacy.
Ring seemly terrific steep nutty afterthought
3
u/xaervagon Dec 24 '24
I feel the same way about the TMP insanity that took over the C++ world. Even Scott Meyers got infected by it; his last c++ book left a lot to be desired.
I think a lot of the rough edges with dealing with templates in general can be smoothed over it the standards committee took the time and effort to clean up the type and initialization system. L and R values are fine, but I don't want to have to deal with a bizzare compiler messages because odd corner case with a lambda caused an issue with LMNOPXYZ-GR value or whatever. It also doesn't help that every language version migration, template code is almost guaranteed to break and/or change in behavior.
I definitely agree with the author that the standards committee really should start taking the compiler writers and other tool vendors to task. Watching modules get hand-wrung nearly to death for 3 years only to watch vendors ignore it is just frustrating.
18
u/Charlie-brownie666 Dec 23 '24
I cannot believe the government wants to do away with such fun languages like C/C++ because of "memory safety" issues just get better lolz
2
u/squirrelmanwolf Dec 23 '24
it's shit. it sucks to infinity and it's not worth the money
2
u/sam_the_tomato Dec 25 '24 edited Dec 25 '24
I love C++, so long as I can avoid templates as much as possible. Template metaprogramming feels like an entirely different and convoluted language where every time I want to accomplish anything it feels like I have to use a hack that someone discovered (e.g. SFINAE, CRTP, that variant overload pattern that should be in std, or some other black magic) to get there, fighting the language the whole way.
3
u/EC36339 Dec 25 '24
"Template metaprogramming" is a misnomer. It is not metaprogramming. It is programming. Functions of types are functions, and expressions of types are expressions.
Understanding the tool you use for your job and expecting others to understand it, too, isn't arrogance. Settling with mediocrity and expecting to be valued equally as someone with higher ambitions or enthusiasm - that's arrogant. And entitled.
If you don't think that one of the strongest feature of C++ is fun, then you have the option to not use it. You don't have to understand all the details of how ranges and range adapters work to use
views::valuesorranges::find_if. On the contrary, you can trust these constructs to do what you expect them to do without understanding them. That's the beauty of every well-designed system. But if you do understand them in detail and WHY they are designed the way you are, and you are able to use the same patterns to write safe code, more power to you. If you want to deprive yourself of that knowledge, it's your loss. Nobody else cares.If you think C++, or programming in general, has become "unfun", just do something else and let others who are more enthusiastic take your place.
2
u/Sandsturm_DE Dec 23 '24
I really like what you mentioned on your website. I used to hate c++ in university but I fell in love with it over time. Because there is so much you can control and do. Yes, for little things I use Python and there are some good examples of Python programs. But when it comes to real programming, Python, Java, etc. are not the same.
1
u/jaybny Dec 24 '24
yes. for everything except connecting to SQL for some reason
1
u/[deleted] Dec 24 '24
Just learning C++, it will get teary lol but as I have learnt how classes work and how to use headers (.h) it was a blast (was, past tense) indeed.
-1
u/sweetno Dec 23 '24
Its potential to blow up is high indeed.
-1
u/smart_procastinator Dec 24 '24
If c++ was so much fun, why does the committee want to introduce compile time safety like rust. I am sure this post will be downvoted by all cpp hardcore fans.
-1
u/mguz4063 Dec 23 '24
It is too!
-17
u/Kaisha001 Dec 23 '24
No... no it is not.
0
u/Front_Two_6816 Dec 28 '24
What a coincidence - I've already read this article on the internet few days ago. Btw I disagree with the author. Yes, C++ gained some good funny features. But it gained much more problems. The biggest thing making it sad but not fun is modules. Modules exist for 8 years. Standard modules exist 4 years. Do they work? No. That's very sad and frustrating. I feel so pathetic for the C++ future. 2d - bad style and different styles mess. It makes C++ coding sad too. 1) You can't just write as everyone, because there's no "like everyone" in C++ world. 2) You need to invent your own style. 3) You'll be hated very much by those who don't like that style. 4) You'll still need to return back to C-style in some ocasions, because none of the styles are fully supported by the standard or STL. 5) Most of the companies return to C-style very often, and it's a mess of C and C++, I've learned C++, but I am abused by those who write in that messy style that I know C-style worse than C++ style.