DEV Community

Discussion on: What makes for readable code?

Collapse
 
fennecdjay profile image
Jérémie Astor

Sometimes I collect a piece of code in a procedure that is called just once, only to provide a "descriptive name" to that piece of code. Of course, it is not efficient

It depends on your compiler: in C, if you write said function as static inline, the compiler might insert it in your code (it is said to be as fast as macros).

Collapse
 
pinotattari profile image
Riccardo Bernardini

You're right. I think that many compilers could do that autonomously during the optimization phase. If I remember correctly gcc does this unless you specify an option.