Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
hjk10157314yNo compiler optimisation is just bs. Well done. One upping the teacher is always bonus points in my book.
-
monkcs5594y@hjk101 yeah like the “ if I turn on -O3 the code doesn’t work” argument is like, stop write undefined behavior then!
-
sariel85344yhe knows.
I used to tutor students and would specifically show them the long way.
when they were done, i would show them the easy way.
this way, they knew both and why we use the easy way. -
I heard from other students (same course, but they started a year after me) that their new programming instructor, who's supposed to teach them the first introduction to programming, didn't even teach them that C and C++ are two different things
Related Rants
-
xjose97x19Just saw a variable in C named like this: long time_ago; //in a galaxy far away I laughed no stop.
-
Unskipp24So this happened last night... Gf: my favorite bra is not fitting me anymore Me: get a new one ? Gf: but it ...
-
sam966911Hats off to this lady .... I would have just flipped the machine
So I have a teacher that when he use "C++" it is basically C with a .cpp file-extension and -O0 compiler flag.
Last assignment was to implement some arbitrary lengthy calculation with a tight requirement of max 1 second runtime, to force us to basically handroll C code without using std and any form of abstraction. But because the language didn’t freeze in time 1998, there is a little keyword named "constexpr" that folded all my classes, arrays, iterators, virtual methods, std::algorithms etc, into a single return statement. Thus making my code the fastest submitted.
Lesson of the story, use the language to the fullest and always turn on the damn optimizer
Ok now I’m done 😚
rant
-o3
cppreference.com
c++