View the Most Wanted LQ Wiki articles.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


Search this Thread
Old 06-19-2012, 04:41 AM   #1
Registered: Dec 2010
Posts: 266

Rep: Reputation: 23
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 :

Last edited by cin_; 06-19-2012 at 07:54 AM. Reason: gramm`err
Old 06-19-2012, 09:01 AM   #2
Senior Member
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 4,769

Rep: Reputation: 1468Reputation: 1468Reputation: 1468Reputation: 1468Reputation: 1468Reputation: 1468Reputation: 1468Reputation: 1468Reputation: 1468Reputation: 1468
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.

Last edited by dugan; 06-19-2012 at 09:11 AM.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Myst Series and MS or any other Golf game grabro Linux - Games 1 08-24-2006 04:45 PM
Any real Golf games for Linux? thomasplock Linux - Software 1 10-22-2004 12:33 AM
Golf goes Linux mjolnir Linux - General 0 01-23-2004 11:31 AM

All times are GMT -5. The time now is 10:34 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration