Post #3191685
2026-06-08 10:59 UTC
Replies (3)
-
@YaBoyMax@programming.dev 2026-06-08 16:24
I don’t disagree that the language is a great way to build an understanding of object lifecycles, but in my experience C++ ctors and dtors are also the biggest source of confusing footguns I’ve ever encountered in any programming language. Separately, template metaprogramming is a whole different beast. It’s an extremely powerful tool, but to me it also feels like finding the correct incantation to get it to do exactly what you need for more complex scenarios. It can be really fun if you know what you’re doing, but it also tends to make me very upset at the compiler when my incantations are a bit off.
-
@SinTan1729@programming.dev 2026-06-08 11:41
I’ve always preferred the functional approach to programming, so OOP never really intrigued me. That’s one of the reasons why I never liked C++ or Java, but instantly fell in love with Rust. It lets me do a lot of functional style programming, while still being somewhat practical. (I’m looking at you, Haskell.)
-
@Valmond@lemmy.dbzer0.com 2026-06-09 07:19
I inherited a supposedly finalised “core” handling data, but only booleans were dealt with and I had to code the other ones. It was coded in template metaprogramming (MSVC & gcc 4.8 😨), just thinking about it gives me chills down the spine! It’s a bit fascinating (and your normal template problems if you have any will vanish and your loved one will return) but it’s, IMO, not for large projects 😬. Impossible to debug (not every error is caught compile time after all). printf was coded like that (with the variadic template “…”), I don’t remember if it was libraries for the old compilers or the new ones… But that’s a fun way of checking it out IMO!