LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Questions About Code Golf (https://www.linuxquestions.org/questions/programming-9/questions-about-code-golf-4175412214/)

cin_ 06-19-2012 04:41 AM

Questions About Code Golf
 
Is there any benefit to code golf come run time?

I understand it as an exercise, entertainment, and challenge, but is there any improvement to be had, come runtime, in dropping the byte size on a program?

I can assume interpretation time reduces with less syntax to interpret, so does that mean a commonly implemented interpreted language: bash, lisp, python, et al; would run quicker?

In the same vein, for compiled languages, is there anything to be said about the machine code shrinking as a result of code golf causing the execution to speed up?

Is golf always good programming praxis so long as you can identify the necessary elements of a program?


... golf example : http://codegolf.stackexchange.com/qu...es-and-so-do-i

dugan 06-19-2012 09:01 AM

No to every question.

The closest analagous practice is minifying Javascript. That's not really the same thing though.

To reduce the size of machine code through code golf, you would have to do it to the assembler code.

Most "interpreted" languages (like PHP and Python) are compiled to bytecode before being executed. Those that aren't don't have profilers, so there would be no way to tell whether or not they're running faster.


All times are GMT -5. The time now is 10:23 PM.