Why aren't people programming everything inline for maximum gains and throughput?

Why aren't people programming everything inline for maximum gains and throughput?

inb4 goto is bad

Other urls found in this thread:

number-none.com/blow/john_carmack_on_inlined_code.html
venturebeat.com/2017/02/02/oculus-john-carmack-vents-about-500-million-zenimax-jury-verdict/
twitter.com/SFWRedditGifs

>15,000 lines of code goes in to a single file - the thread

Almost every modern compiler do that for you.

That's false for many languages.

Because it's not effective

What does that mean, programming inline? What's the alternative?

Because inlining does more harm than good.

>not programming your entire program in header files

GOTO is bad, because Dijkstra have said so

>Not coding all of your work in Assembler

Found the guy who has no clue about programming

Usually you write the declaration of classes and functions in .h files an than you implement them in a .cpp

compilers are typically Smart Enough to inline when it makes sense

Unless you declare the functions as inline

>I prefer bloated binaries

Exactly but that is not a good idea in the majority of the times, you should almost never use inline functions and let the compiler to optimize it, unless you are working on max efficiency and unsing an inline declaration gives you a tangible gain in performance

The inline keyword in C++ is a suggestion to the compiler.

No,it is not a suggestion to the compiler, the inline keyword will make function treated as inline even if is not declared inline together with the declaration

Using Turbo C++ in DosBox, how shitty your college can be. kek.

Do you even know what inlining means?

Wrong. is correct.

Same as using volatile or register

I, too, enjoy raping the i-cache of my processor.

false

inline for C++ is a serious boost in performance. If I'm iterating line by line of a file over 2Gb, an inline function that compares two variables runs nearly 100x faster if I don't inline it at all

>John Carmack has no clue about programming
number-none.com/blow/john_carmack_on_inlined_code.html

>Trusting a criminal.
venturebeat.com/2017/02/02/oculus-john-carmack-vents-about-500-million-zenimax-jury-verdict/

>thinking this is a criminal act, and not that the ip system in itself, and the jews that are zenimax are the real criminals

volatile is NOT just a suggestion, since the compiler has no way to know if another source will be modifying the variable or not. if you mark something as volatile, the compiler will respect that.
register and inline ARE suggestions though. in fact, i think register will be deprecated either this standard or the next one.

register is already deprecated

both are wrong, inline has nothing to do with inlining a function anymore. It now means "multiple definitions are permitted"

If they were always faster then everything would be inlined.

They're not always faster so you should use the inline keyword to suggest inlining. Also the compiler will inline anything whenever it thinks it'll make your program faster

Inline functions are not always faster. If you have the same function called repeatedly in succession, then you're going to get many more cache hits than if you inline it at all those call sites.
Also C++'s antiquated linkage model limits the amount of inlining you can do.

HEY GUYS MY NAME IS PAJEET AND I AM NEW TO THE 4CHANS. CAN SOMEONE TELL ME IN PLAIN ENGLISH WHEN TO INLINE AND WHEN NOT TO INLINE

THOUSAND THANK YOUS

Hello Pajeet my name is Ho-Li-Fuk I would also like to know when to use inline.

samefagging larper

Sasuga C++.