News for hackers. Stuff that matters.
Re:Fun with C++26 reflection: Keyword Arguments by hyperhello on Tuesday February 11, 2025 @12:49AM (#43009408)
At this point, you should just switch to JavaScript. The desperation to have the simple ease of JavaScript without having to say you're going near "that terrible language" is twisting C++ into ridiculous loops. I'm serious. It's like a bizarre Victorian relic now.
Re:Fun with C++26 reflection: Keyword Arguments by eqvinox on Tuesday February 11, 2025 @02:01AM (#43009826)
https://javascriptwtf.com/

Arguably this is worse than C++ because for basic things/beginner to intermediate users, the footguns in C++ are more benign (e.g. performance related, rather than correctness) than the ones in JavaScript.

Re:Fun with C++26 reflection: Keyword Arguments by orphea on Tuesday February 11, 2025 @08:16AM (#43012388)

  > the footguns in C++ are more benign
I don't think I can agree. https://pvs-studio.com/en/blog/posts/cpp/1215/
Re:Fun with C++26 reflection: Keyword Arguments by eqvinox on Tuesday February 11, 2025 @01:05PM (#43015982)
I'm not gonna claim C++ is a great language, just that JavaScript starts its weirdness "earlier"/"lower" than C++. Especially since a bunch of the issues listed on your linked reference are technically UB but compilers (a) can warn about it, and (b) have reigned back somewhat on exploiting UB for optimizations.

Now that I think about it, the fact that you necessarily have to use a compiler with C++ is also part of the equation here. It's basically a mandatory linter. With JavaScript as with any interpreted language there's a lot of mines you can trip over waaaaaay down the line, especially if you aren't taking steps to use linters.

Re:Fun with C++26 reflection: Keyword Arguments by hyperhello on Tuesday February 11, 2025 @09:12AM (#43012900)
The same tired edge cases. Especially the null pointers. Yes, but what did you want the language to do? Stop you? You can do that yourself.
Re:Fun with C++26 reflection: Keyword Arguments by eqvinox on Tuesday February 11, 2025 @01:06PM (#43015998)
Honestly? I want the language to add integers. I don't understand how anyone can take seriously a language that only has floats for numbers. It's straight up ridiculous.
Re:Fun with C++26 reflection: Keyword Arguments by drivebyhooting on Tuesday February 11, 2025 @01:06AM (#43009505)
Is JS simpler than Python? I don’t think so but willing to change my mind.
Re:Fun with C++26 reflection: Keyword Arguments by hyperhello on Tuesday February 11, 2025 @01:09AM (#43009523)
The syntax? Probably a little. It’s a typeless C. As for what you can use it for, it’s limited to browsers, practically, so not really comparable.
Re:Fun with C++26 reflection: Keyword Arguments by flakes on Tuesday February 11, 2025 @01:25AM (#43009629)
> it’s limited to browsers, practically

That massively ignores node.js and all of the many popular backend frameworks built on it today. JS might not be everyone's cup of tea, but it is certainly not limited to browsers, practically.

Re:Fun with C++26 reflection: Keyword Arguments by friendzis on Tuesday February 11, 2025 @02:41AM (#43010079)
We don't even write utilities in JVM languages, because spawning whole JVM is generally considered too expensive.

Yet there are people who will happily spawn whole web browser and even go as far as recommend doing so. All because they can't even write a left-pad function.

Re:Fun with C++26 reflection: Keyword Arguments by porridgeraisin on Tuesday February 11, 2025 @08:06AM (#43012301)
> We don't even write utilities in JVM languages, because spawning whole JVM is generally considered too expensive.

This is definitely not why, at least today. People are even willing to spawn an entirely new userspace (docker) for their utilities.

> Yet there are people who will happily spawn whole web browser and even go as far as recommend doing so.

Electron, like the JVM is nice and cross-platform with no BS. The only problem with the JVM is that it doesn't have a lot of important features/historical advantage that web tech does, not to mention the difference in quality between web UI and Swing, JavaFX, etc,. The combination of all of this is pretty much why electron is preferred. And I guess I should say chrome-tech instead of web-tech.

> All because they can't even write a left-pad function

Well, they certainly want the functions they write to work on every possible combination of OS/userspace.

Re:Fun with C++26 reflection: Keyword Arguments by eqvinox on Tuesday February 11, 2025 @01:16PM (#43016127)
> Electron, like the JVM is nice and cross-platform with no BS.

If we were talking in person I'd look at you like you had 2 heads now. In my bubble it is extremely en vogue to hate on Electron being a piece of bloated shit…

…but then again, I will agree that this is a piece of social signaling and would need some actual evaluation. There's probably some real problems with Electron that have caused people to start hating on it, but who knows how relevant those are. Trivial junk can easily snowball into social signals like this.

Re:Fun with C++26 reflection: Keyword Arguments by porridgeraisin on Tuesday February 11, 2025 @01:47PM (#43016616)
Oh it has its problems for sure. Especially the bloat.

I was just bringing up the similarity in ease of packaging.

Re:Fun with C++26 reflection: Keyword Arguments by dingi on Tuesday February 11, 2025 @02:28AM (#43009989)
Which uses JS made for a browser with some modifications.
Re:Fun with C++26 reflection: Keyword Arguments by vlovich123 on Tuesday February 11, 2025 @10:57AM (#43014342)
Ah yes, the language that has no built in support to test if two non-primtive types are equal (& not just objects but arrays of primitives too), that has no proper integer type, whose standard library is thread-bare, and is an exercise in masochism if you don’t transpile it from TypeScript. TypeScript is at least somewhat livable but can we get beyond arguing which terrible language is better?