LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 06-19-2012, 04:41 AM   #1
cin_
Member
 
Registered: Dec 2010
Posts: 264

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 : http://codegolf.stackexchange.com/qu...es-and-so-do-i

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

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


Reply

Tags
programming


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:16 AM.

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