4 ms·
> then spend the rest of the day learning why I can't do what I want There's a point when learning's fun, I think the OP is still there. I wrote a bunch of re
by gopalv 2y ago
> then spend the rest of the day learning why I can't do what I want
There's a point when learning's fun, I think the OP is still there.
I wrote a bunch of realtime C++ in 2003, hated it. But last year, I wrote most of my code in C++ and liked it finally.
Lambda and auto was the tipping point where I stopped hating it. Some templates thrown in, but mostly to avoid writing a lot of branches for variants of the same function.
With lambdas I could now write the way I was initially taught programming, mostly by Lispy teachers channeling SICP.
Didn't hate the allocations either with unique_ptr.
- hashishen 2y ago"Lispy teachers channeling SICP" made new audibly laugh
- cshokie 2y agoIf you haven’t already look up ‘if constexpr’ in cpp17 and newer. It lets you have compile time branches in a single function.
- mst 2y agoAlso requires, which initially looks batshit insane but is in fact really quite cool: https://www.think-cell.com/en/career/devblog/if-constexpr-requires-requires-requires https://www.think-cell.com/en/career/devblog/if-constexpr-re...
- Loranubi 2y ago> Unlike requires requires and requires { requires }, which are perfectly reasonable C++ code, requires requires { requires } is completely silly. Normal day in cpp land...
- spopejoy 2y agoHow on earth did C++ brainrot lead them to think that reusing that keyword was anything but a nightmare? The very first line of the article > Probably the two most useful features added to C++20 are requires and requires said without a trace of irony ... the whole thing reads like parody! I keep hearing that C++20 or whatever is getting so great but if so why would they specify such a dumpster fire of syntax???
- scotty79 2y ago> There's a point when learning's fun, I think the OP is still there. What a horrible idea that one might no longer be there.