4 ms·
>t I am trying and how can I make that happen with the fewest lines of instructions as possible Isn't that the compilers job?
by pixl97 3y ago
>t I am trying and how can I make that happen with the fewest lines of instructions as possible
Isn't that the compilers job?
- gwbas1c 3y agoThe compiler doesn't know how to reduce three database round trips into one database round trip. Modern compilers are awesome, but they still can't read your mind to understand your intent and suggest changes that would objectively change the program, but do what your intent is in a much better way. Perhaps someday artificial intelligence could, but I think that is a long ways off.
- ilrwbwrkhv 3y agoThe compilers job is to turn source code into machine code. You are still writing human readable source code. I am not suggesting we start writing everything in numeric machine code.
- chefandy 3y ago> The compilers job is to turn source code into machine code. You are still writing human readable source code. I am not suggesting we start writing everything in numeric machine code. Human-readable is a spectrum. If something can be more human-friendly while being compacted into an equivalent instruction set at compile time, then what is the benefit of writing extremely terse code?
- ilrwbwrkhv 3y agoLess maintenance the fewer lines of code. While it shouldn't be unreadable, it should be succinct. Basically using abstractions sparingly, letting the data flow through the system and not wrapping things within each other are all great ideas. If you are instantiating a bunch of objects, you can simplify things.
- chefandy 3y agoMaybe there are domains/languages/paradigms where using the smallest possible number of lines to achieve a given compiled instruction set really makes things more efficient, but to me it sounds more like code golf. Using 1 very terse line to accomplish the same thing that 3 readable lines can accomplish should require the same exact amount of maintenance but would be much harder to read and modify.