LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 01-20-2010, 06:33 AM   #16
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454

Quote:
Originally Posted by sundialsvcs View Post
As you have no doubt discovered, you have unleashed a religious holy-war...

Here are a few of what might be 'useful' observations...
...
  • These days, you almost never have to seriously worry about how long it will take the computer to do whatever you ask. ("At several billion ops per second, nobody can hear you scream...") The very-expensive resource that you need to seriously optimize is ... you.
  • It is an absolutely fabulous thing to be able to implement a complete Web server in three lines of Perl code... and to know that it will work correctly, no matter what kind of computer (or portable phone... ) you may be using at the time. That is the kind of "efficiency" that you are looking for!

The two bullets are actually thought-provoking in the light of each other.

The point is that specifically in mobile devices efficiency matters a lot. I.e. inefficient code means extra CPU cycles -> extra milliwatt-hours consumed from battery. I.e. even though the code might be fast enough/even fast enough to work in real times (like decoding video/audio), if the code consumes more CPU cycles, it drains the battery faster.

...

Sorry, I am a physicist by education and a VLSI designer by trade .
 
1 members found this post helpful.
Old 01-20-2010, 10:12 AM   #17
MBybee
Member
 
Registered: Jan 2009
Location: wherever I can make a living
Distribution: PC-BSD / FreeBSD / Debian / Ubuntu / Win7 / OpenVMS
Posts: 440

Rep: Reputation: 57
Quote:
Originally Posted by sundialsvcs View Post
As you have no doubt discovered, you have unleashed a religious holy-war...

Here are a few of what might be 'useful' observations...
  • There is no "one Ring to rule them all." Every situation that someone might be willing to pay for is different. Sooner or later, you are going to have to "soil yourself in the excrement of" a great many languages. (C'mon in... the water's fine...)
  • It is always a wonderful thing to be able to easily leverage somebody else's painstakingly-optimized "C" (or "C++" or "asm") code. And so, anytime you are able to use one of the mainstream "this is not C or C++ or asm" languages, you should be aware that you are doing precisely that. (The (hundreds of...) programmers who wrote languages like Perl or PHP or Java or Python or what-have-you are TRUE WYZARDS, whose skills are far beyond those of Mere Mortals like you 'n me. Anytime you can coat-tail upon their trails of "magickal pixie-dust," do so!)
  • These days, you almost never have to seriously worry about how long it will take the computer to do whatever you ask. ("At several billion ops per second, nobody can hear you scream...") The very-expensive resource that you need to seriously optimize is ... you.
  • It is an absolutely fabulous thing to be able to implement a complete Web server in three lines of Perl code... and to know that it will work correctly, no matter what kind of computer (or portable phone... ) you may be using at the time. That is the kind of "efficiency" that you are looking for!
Wow, there are so many things I have to disagree with here...

1) Perl and PHP were certainly not written to create high-performance code, and Larry Wall especially will tell you that Perl was designed to make it easy on the coder, not the machine. Java... maybe. Just maybe. It's completely deplorable track record will attest that the 'wyzards' certainly took a long time to produce something that wasn't utter junk.

2) You don't give yourself enough credit, or perhaps rate your billable time too highly. Just because I can knock out an app that barely manages to perform a task in time doesn't mean that it will scale properly, port properly, or even actually work in a few years.
Compare a simple string parser in 3 or 4 languages for an example of this. C/C++ are the most tedious languages to manage arrays and strings in, but if you have to parse the string ten million times the difference is worth it.


Look, simple example. Using Perl (a high level language), the difference between a variable with a value and a constant with a value makes a difference of 10s of seconds over even an empty loop. (I can post examples of the test I ran on 15 different pieces of various size/class). When even a small tweak like that makes a difference, it's worth paying attention to appropriateness.
What is appropriate for the circumstance? If you're writing a script to take a backup once a day, Perl or Bash or whatever is ideal. If you're working on real-time processing, use ASM or embedded C or whatnot. If you have to run the same process 20 billion times, little things add up.

Anything less is simply sloppy.

Last edited by MBybee; 01-20-2010 at 10:19 AM. Reason: typo - and really need to stop posting prior to coffee
 
  


Reply


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
ASM x32 vs ASM x64 Tegramon Programming 3 02-27-2008 03:26 PM
I/O in ASM Mercurius Programming 10 11-16-2006 08:02 PM
asm Question Whiteghost Programming 2 09-03-2005 10:26 AM
Have you seen such asm code? snowing Programming 2 07-07-2005 06:13 AM
How to use C functions in asm? LongName Programming 4 08-29-2004 01:25 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:49 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration