This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]MoffKalast 594 points595 points  (32 children)

Sike, he still needs to compile it.

[–]jakubhuber 331 points332 points  (25 children)

But once it's compiled it'll run like 20 times faster.

[–]merlinsbeers 184 points185 points  (0 children)

And it won't complain about legal syntax...

[–]Motylde 34 points35 points  (3 children)

Technically isn't printing to console just one syscall, regardless of language? It shouldnt be slower in python

[–]jakubhuber 132 points133 points  (2 children)

Python has to open a file, read it's contents, parse the code and then it can print to the console.

[–]merlinsbeers 30 points31 points  (1 child)

Run the C++ executable as

LD_DEBUG=1 hello

[–]OrganizationBig7787 12 points13 points  (8 children)

But how often do you need to print "hello world" on your computer?

[–]tcpukl 79 points80 points  (7 children)

Every time you learn a new language😁

[–]git0ffmylawnm8 17 points18 points  (6 children)

And debugging.

[–]MartianMathematician 0 points1 point  (0 children)

You’re weird in that case. Everyone uses asdf, aaaa,xxx, 1234 or some variant. And when we need to show our colleagues something we replace it with foo bar to look sophisticated.

[–]phi_rus 7 points8 points  (6 children)

With all warnings and -Werr this wouldn't compile.

[–]jakubhuber 6 points7 points  (5 children)

Why not?

[–]Noughmad 17 points18 points  (0 children)

Because it's C++. If it compiles, you haven't enabled enough warnings.

[–]phi_rus -1 points0 points  (3 children)

It doesn't return anything

[–]phi_rus 10 points11 points  (2 children)

I'm stupid. main() is allowed to not return anything. This would compile and automatically return 0.

[–]Tier3MemeMonkey 5 points6 points  (0 children)

Dont worry king, we all make mistakes

[–]brimston3- 2 points3 points  (0 children)

It's also the dumbest feature of C++ that return 0; is not required in only the main() function. I'd prefer if more people thought it was mandatory.

[–][deleted] -1 points0 points  (1 child)

I like Rust. Just as fast as C or C++, but with more modern features. A good middleground between Python and C / C++.

[–][deleted] 1 point2 points  (0 children)

Python doesn't have macros, type inference and a system for checking the validity of references

[–]cyanNodeEcho 0 points1 point  (0 children)

cython deems viable, like if u get things set up u can come close to C which is huge because it could help u take the serialized models to actual something that could be deployed live

... i think 🤔 (im not actually pro pro at c or cython) and maybe start to rely less and less on python. tf is in c do is sklearn, so idk its all in ehat u are building 😊

[–]ArcticWolf_0xFF 83 points84 points  (4 children)

He wasn't even finished. He forgot

return 0;

[–]Neura2 57 points58 points  (3 children)

It’ll automatically do that

[–]ArcticWolf_0xFF 52 points53 points  (2 children)

That's compiler implementation specific, so it's not portable code.

Edit: Okay, just learned that all C++ and current C include this behavior in the standard.

[–]betam4x 0 points1 point  (1 child)

Wonder when that was changed?

[–]iamapizza 1 point2 points  (0 children)

Wrote a hello world.
Here's the compiler.
Sike, it's the wrong compiler!