3 ms·
You can pump out a Modern C++ version in 5 minutes too that will run loops (haha) around the higher level languages. The readability won't even be very differen
by snovv_crash 5y ago
You can pump out a Modern C++ version in 5 minutes too that will run loops (haha) around the higher level languages. The readability won't even be very different...
- bigiain 5y agoTrue. I bet the Rust guys would come close too. But realistically? For anything except code golf and nerd fights, the actual client requirement is probably better met by a WordPress widget written in php/html, because what they asked for is something that'll print the fizz buzz all the way up to the person's age when they log into the company website... Nobody is even going to notice if it takes a whole second to fizz buzz all the way to 95 :-) (Now I'm wondering if that guy's raw hyper optimised x86 assembly can get transpiled to WASM... Because nerd fights are fun.)
- Taywee 5y ago> Now I'm wondering if that guy's raw hyper optimised x86 assembly can get transpiled to WASM Not really. WASM is significantly simpler and more abstract than x86 assembly, and has a JIT compile step that probably wouldn't get anywhere near as optimized. You could probably hand-write a WASM version that would JIT compile to something roughly similar and still get very good performance, but it would probably be more comparable to the other compiled versions at best, rather than the x86 ASM one.
- bigiain 5y ago> probably wouldn't get anywhere near as optimized. Yeah, I'm not doing this for performance, I'm doing out for nerd fight points and the lulz :-) The Most Hightly Optimised Fizz Buzz EVER! In your browser! As a service. Join the waiting list now! Email: [_____________] [submit]
- DeathArrow 5y ago>But realistically? For anything except code golf and nerd fights, the actual client requirement is probably better met by a WordPress widget written in php/html, because what they asked for is something that'll print the fizz buzz all the way up to the person's age when they log into the company website... Nobody is even going to notice if it takes a whole second to fizz buzz all the way to 95 :-) What if 100 million people log from different corners of the world? Would the WordPress widget still cut it?
- bigiain 5y agoIn that scenario, the fizzbuzz widget is gonna be just a tiny tiny part of your WordPress scaling problem…
- DeathArrow 5y agoNot only you can write a modern C++ version in 5 minutes but by carefully choosing your subset of C++ and coding style you can do that while being as readable and maintainable as in higher level languages. C++ isn't hard because it's low level, it is hard because it is a Frankenstein monster and I don't think there is a living being that masters all the complexities of C++. I would love to see a C++ Next version with lots of crap cut down from it.
- pkolaczk 5y agoC++ next version with lots of crap cut down is called Rust. ;)
- snovv_crash 5y agoJudging by it's age and how much crap it's accumulated already, I think in 10 years time Rust won't be in a much better situation. Similarly, judging by C++'s current trajectory, in 10 years it will have a simplified subset (enforced with something similar to --pedantic) which is easier to get right than Rust is today. Also, it will have a static analysis borrow checker based on clang-tidy.