homeGeek CultureWebstoreeCards!Forums!Joy of Tech!AY2K!webcam

The Geek Culture Forums


Post New Topic  New Poll  Post A Reply
my profile | directory login | | search | faq | forum home
  next oldest topic   next newest topic
» The Geek Culture Forums   » Other Geeky Stuff   » Ask a Geek!   » Discipline in Programming

 - UBBFriend: Email this page to someone!    
Author Topic: Discipline in Programming
Groggle
Mini Geek
Member # 2360

Member Rated:
3
Icon 1 posted March 25, 2005 12:31      Profile for Groggle     Send New Private Message       Edit/Delete Post   Reply With Quote 
CSK posted a link to this article talking about scripting languages.

Reading it, I was struck by the "us versus them" of some of the interviewees. There was a real defensiveness on their part when they were comparing their favorite scripting language (Perl, Python, Ruby, PHP - whatever) with Java/C++/C# compiled languages.

Reflecting on that for a few moments, I found myself thinking about the code that I've seen written in both scripting and compiled environments. I've seen some truly amazing code written in both; similarly, I've bore witness to some truly awful code as well.

My sense is that the issue isn't choice of language, so much as clarity and discipline on the developer's part. From my experiences in software, 98% of what goes on in software boils down to 2 things: coupling and cohesion. If you get those right in your factoring of a problem, the resulting code should be reasonably readable.

I strikes me that perhaps our C/S (computer science) schools should be focusing on teaching not languages, but problem solving skills. Programming language choice should be a matter of "the right tool for the job", and is actually secondary to understanding how to break problem spaces into something coherent.

(Somewhere in the depths of my degree, I had Ada inflicted upon me, along with PL/1, Prolog, Lisp and a few other horrors. In truth, the languages turned out to be secondary to learning solid problem solving techniques.)

Posts: 77 | From: Calgary | Registered: Aug 2003  |  IP: Logged
magefile
Highlie
Member # 2918

Member Rated:
5
Icon 1 posted March 25, 2005 14:22      Profile for magefile     Send New Private Message       Edit/Delete Post   Reply With Quote 
quote:
Originally posted by Groggle:
I strikes me that perhaps our C/S (computer science) schools should be focusing on teaching not languages, but problem solving skills. Programming language choice should be a matter of "the right tool for the job", and is actually secondary to understanding how to break problem spaces into something coherent.

All the colleges I've visited in the past year or two (all of 'em in the top 10 for CS or engineering) have told me that their 100 courses are in Scheme or something similar for exactly that reason. It's not until you start doing OS design or assembly that they give you a "real-world" language.
Posts: 743 | From: Massachusetts | Registered: Aug 2004  |  IP: Logged
csk

Member # 1941

Member Rated:
5
Icon 1 posted March 25, 2005 19:35      Profile for csk     Send New Private Message       Edit/Delete Post   Reply With Quote 
In other words, someone's skill in IT has little to do with what development environment they are currently acquainted with. Give them a little time, and they'll transfer the really important skills (like problem solving, etc) to another environment. In addition, once they're familiar with several, they can objectively evaluate the suitability of each for a particular task. Now, if only the people recruiting for IT jobs realised the above, life would be much easier. Still, it happens, as I moved successfully from a mainframe PL/1 etc based job to one mainly coding C/C++ on Unix. I've also done Windows coding, and a fair bit of sysadmin type stuff.

However, I think the defensiveness seen in the article is as a result of the sort of narrow minded thinking you're talking about. People thinking of scripting languages as "toys", etc. In my opinion, you should program at the highest level that is machine efficient enough to successfully implement what you're doing. In other words, use one of those very high level languages for the bulk of the work. Unfortunately many people don't see a blanket decision to always use C/C++/whatever as the premature optimisation that it is.

--------------------
6 weeks to go!

Posts: 4455 | From: Sydney, Australia | Registered: Jan 2003  |  IP: Logged
Groggle
Mini Geek
Member # 2360

Member Rated:
3
Icon 1 posted March 26, 2005 11:11      Profile for Groggle     Send New Private Message       Edit/Delete Post   Reply With Quote 
CSK - Precisely the point.

Unfortunately that logic applies all over the place. I was at a job interview relatively recently where the interviewers turned it into a "do you know all of the trivia about Java" session.

I'm sitting there thinking to myself "you don't get it, do you?". What they were looking for was someone who had "married Java". I wasn't exactly impressed by them (not to mention the fact that they seemed oblivious to the fact that in an interview, I'm evaluating them, too)

Posts: 77 | From: Calgary | Registered: Aug 2003  |  IP: Logged
GameMaster
BlabberMouth, a Blabber Odyssey
Member # 1173

Member Rated:
4
Icon 1 posted March 26, 2005 12:01      Profile for GameMaster   Author's Homepage     Send New Private Message       Edit/Delete Post   Reply With Quote 
quote:
csk:In my opinion, you should program at the highest level that is machine efficient enough to successfully implement what you're doing. In other words, use one of those very high level languages for the bulk of the work. Unfortunately many people don't see a blanket decision to always use C/C++/whatever as the premature optimisation that it is.
Don't you mean the lowest level that is human efficient enough... Every level your removed from the chip is another level of compilation or interpretation which is (generally) added overhead.

I'm of the school of thought that the best tool for the job. Granted I reach for Java or C++ more often than scripting languages, but that is because I see C++ as being closer to the chip and JAVA as being a universal tool wrench, I can run the same compiled versions on my laptop (Mac), my home computer (Linux), school (Solaris) and work (Linux)....

Our school really trys to teach the ideas about programing (though most classes are in C+). Then they cover a few other languages (Lisp is covered in intro to AI and Natural Language processes sing; ML, Prolog and a brief intro to Java is covered in Program Languages concepts; Operating Systems is programming in C (POSIT stuff) and VC++ (windows system calls provided by the windows API); Graphics is done in VC+++; there are elective classes for Fortran, VB and a few others; and Object Oriented programming is either C++ or Java depending on who you take it with).

Personally, I've always wanted there to be a class in problem solving, flow charting, ML diagramming and just thinking like a programmer. Tutoring I see a lot of the same types of mistakes. Most people who I've seen struggling with programming either can't see "the forest" and they get to caught up "in the trees" (loose sight of the details); or all they see "the forest" and don't see "the trees" and can't find where the first tree is (loose sight of the details). If there isn't a semesters worth there, then fill the rest with computer history and/or truth tables and logical proof. Just my crazy idea.

--------------------
My Site

Posts: 3038 | From: State of insanity | Registered: Mar 2002  |  IP: Logged
The Famous Druid

Gold Hearted SuperFan!
Member # 1769

Member Rated:
4
Icon 1 posted March 26, 2005 13:57      Profile for The Famous Druid     Send New Private Message       Edit/Delete Post   Reply With Quote 
quote:
Originally posted by GameMaster:
quote:
csk:In my opinion, you should program at the highest level that is machine efficient enough to successfully implement what you're doing. In other words, use one of those very high level languages for the bulk of the work. Unfortunately many people don't see a blanket decision to always use C/C++/whatever as the premature optimisation that it is.
Don't you mean the lowest level that is human efficient enough... Every level your removed from the chip is another level of compilation or interpretation which is (generally) added overhead.

Depending on the situation, you're both right.

The aim should be to minimise the cost of obtaining a satisfactory solution.

For quite some time now, the cost of hardware has been dropping. As faster hardware gets cheaper, the balance has been shifting from hand optimisation and clever coding tricks towards 'brute force' and higher-level languages.

That said, if you're coding for embedded systems (as I often do) and the end product will ship in the tens of millions, then it may make sense to spend $100,000 in programmer time to solve some problem rather than adding a 10 cent part to every unit you ship.

As GM said, it's all about using the right tool for the job.

(techno-trivia: Did you know that over half the microprocessors manufactured are 4-bit or less?)

--------------------
If you watch 'The History Of NASA' backwards, it's about a space agency that has no manned spaceflight capability, then does low-orbit flights, then lands on the Moon.

Posts: 10680 | From: Melbourne, Australia | Registered: Oct 2002  |  IP: Logged
quantumfluff
BlabberMouth, a Blabber Odyssey
Member # 450

Member Rated:
5
Icon 1 posted March 26, 2005 14:39      Profile for quantumfluff     Send New Private Message       Edit/Delete Post   Reply With Quote 
With few exceptions, the further away you are from the chip the better. We should be always using the language that expresses intent in the closest possible way to the problem domain. I've been writing code for 30 years and I've yet to see proof that more than 10 to 20 percent of all programmers out there understand memory allocation well enough to be allowed to do it.

What I've been doing a lot of lately is splitting languages in mid-application. I'll write the classes I need in Java or C++, then wrap them in tcl. Then I write as much of the application logic in tcl. This helps me maintain the wall between what I want to do, and the elements I have to do it with. Even better, it let's me split my team. I can have the senior guys writing the performance oriented stuff in one language, and another group writing in a language where they can't get into pointer problems.

But there's more...
- I can rapid prototype a new feature in tcl much faster than I can write it in C .If it runs too slow, I can recode in C *after* I get the logic right.
- I can deliver customer specific modifications to the scripted part.
- I can write unit tests for the C code in the scripting language.

It's a win all around.

Posts: 2902 | From: 5 to 15 meters above sea level | Registered: Jun 2000  |  IP: Logged


All times are Eastern Time  
Post New Topic  New Poll  Post A Reply Close Topic    Move Topic    Delete Topic next oldest topic   next newest topic
 - Printer-friendly view of this topic
Hop To:

Contact Us | Geek Culture Home Page

2015 Geek Culture

Powered by Infopop Corporation
UBB.classicTM 6.4.0



homeGeek CultureWebstoreeCards!Forums!Joy of Tech!AY2K!webcam