Which language . . . .

Status
Not open for further replies.

travathian

Ars Tribunus Angusticlavius
9,831
This forum really needs a FAQ detailing the various languages, what people think of them, and the type of profession which would commonly use them.

I'm currently pursuing my AAS in network administration, as well as MCSA and CCNA. Completion is about a year away, but one of the requirements is to take a programming language. So I would like people's thoughts on a good choice. Cost and ease of use are not issues, I want to learn something that I'll actually use and that will be around for a while. I have zero programming experience.
 

jbode

Ars Legatus Legionis
11,752
Subscriptor
Will this do?

Programming Languages

Some choice quotes:

Ada: The mistakes which have been made in the last twenty years [of designing large overly-complex languages] are being repeated today on an even grander scale.
...
Gadgets and glitter prevail over fundamental concerns of safety and economy.

-- C. A. R. Hoare, "The Emperor's Old Clothes", CACM 24(2), 1981

APL: There are three things a man must do / Before his life is done;
Write two lines in APL, / And make the buggers run.

-- Stan Kelly-Bootle, The Devil's DP Dictionary, 1981

BASIC is to computer languages what Roman numerals are to arithmetic

-- unknown

C: A language that combines all the elegance and power of assembly language with all the readability and maintainability of assembly language.

-- New Hacker's Dictionary

C++: "an octopus made by nailing extra legs onto a dog"

-- Steve Taylor, 1998
 

Nebob

Ars Tribunus Militum
1,879
programming n.

1. The art of debugging a blank sheet of paper (or, in these days of on-line editing, the art of debugging an empty file). "Bloody instructions which, being taught, return to plague their inventor" ("Macbeth", Act 1, Scene 7) 2. A pastime similar to banging one's head against a wall, but with fewer opportunities for reward. 3. The most fun you can have with your clothes on. 4. The least fun you can have with your clothes off.

THE PROGRAMMER'S QUICK GUIDE TO THE LANGUAGES

The proliferation of modern programming languages (all of which seem to have stolen countless features from one another) sometimes makes it difficult to remember what language you're currently using. This handy reference is offered as a public service to help programmers who find themselves in such a dilemma.

TASK: Shoot yourself in the foot.



C: You shoot yourself in the foot.

C++: You accidentally create a dozen instances of yourself and shoot them all in the foot. Providing emergency medical assistance is impossible since you can't tell which are bitwise copies and which are just pointing at others and saying, "That's me, over there."

FORTRAN: You shoot yourself in each toe, iteratively, until you run out of toes, then you read in the next foot and repeat. If you run out of bullets, you continue with the attempts to shoot yourself anyways because you have no exception-handling capability.

Pascal: The compiler won't let you shoot yourself in the foot.

Ada: After correctly packing your foot, you attempt to concurrently load the gun, pull the trigger, scream, and shoot yourself in the foot. When you try, however, you discover you can't because your foot is of the wrong type.

COBOL: Using a COLT 45 HANDGUN, AIM gun at LEG.FOOT, THEN place ARM.HAND.FINGER on HANDGUN.TRIGGER and SQUEEZE. THEN return HANDGUN to HOLSTER. CHECK whether shoelace needs to be re-tied.

LISP: You shoot yourself in the appendage which holds the gun with which you shoot yourself in the appendage which holds the gun with which you shoot yourself in the appendage which holds the gun with which you shoot yourself in the appendage which holds the gun with which you shoot yourself in the appendage which holds the gun with which you shoot yourself in the appendage which holds...

FORTH: Foot in yourself shoot.

Prolog: You tell your program that you want to be shot in the foot. The program figures out how to do it, but the syntax doesn't permit it to explain it to you.

BASIC: Shoot yourself in the foot with a water pistol. On large systems, continue until entire lower body is waterlogged.

Visual Basic: You'll really only appear to have shot yourself in the foot, but you'll have had so much fun doing it that you won't care.

HyperTalk: Put the first bullet of gun into foot left of leg of you. Answer the result.

Motif: You spend days writing a UIL description of your foot, the bullet, its trajectory, and the intricate scrollwork on the ivory handles of the gun. When you finally get around to pulling the trigger, the gun jams.

APL: You shoot yourself in the foot, then spend all day figuring out how to do it in fewer characters.

SNOBOL: If you succeed, shoot yourself in the left foot. If you fail, shoot yourself in the right foot.

Unix:
% ls
foot.c foot.h foot.o toe.c toe.o
% rm * .o
rm:.o no such file or directory
% ls
%

Concurrent Euclid: You shoot yourself in somebody else's foot.

370 JCL: You send your foot down to MIS and include a 400-page document explaining exactly how you want it to be shot. Three years later, your foot comes back deep-fried.

Paradox: Not only can you shoot yourself in the foot, your users can, too.

Access: You try to point the gun at your foot, but it shoots holes in all your Borland distribution diskettes instead.

Revelation: You're sure you're going to be able to shoot yourself in the foot, just as soon as you figure out what all these nifty little bullet-thingies are for.

Assembler: You try to shoot yourself in the foot, only to discover you must first invent the gun, the bullet, the trigger, and your foot.

Modula2: After realizing that you can't actually accomplish anything in this language, you shoot yourself in the head.
======================================================================

But seriously, my personal recommendation is C++. I know there are "experts" who criticize... well, whatever it is they criticize about the language, but those are the types of people that go pale and faint when Godel is mentioned. If you just want power, flexibility and performance, and don't care about volumes of dry abstractions and formalisms, C++ is for you.
 

Agathos

Ars Praefectus
3,558
Subscriptor
Originally posted by travathian:
Well thanks for all the responses, but what makes you recommend particular choices?

Well, let's start a list of reasons to advocate any particular language. I'll go first:

ML - All the beauty of functional programming, with type checking. After your code is good enough to make it past the interpeter's or compiler's type checker, it's probably correct and you're done debugging.

Perl - "There's more than one way to do it." You can write the same thing in about 100 different ways, fitting your solution to the problem and your personal style.

Ruby - What if Perl and Smalltalk had a baby? Perl programmers will recognize many of its features, but it was object-oriented from the first day, so you'll be able to code in that style with ease.

C - So you want it to be fast? It needs to get close to the machine? Don't want to write in assembly? Got C?
 

nathematics

Ars Scholae Palatinae
984
Originally posted by dereferenced:
INTERCAL
Yes!
Code:
 	DO (5) NEXT
    (5) DO FORGET #1
	PLEASE WRITE IN :1
	DO .1 <- 'V":1~'#32768$#0'"$#1'~#3
	DO (1) NEXT
	DO :1 <- "'V":1~'#65535$#0'"$#65535'
		~'#0$#65535'"$"'V":1~'#0$#65535'"
		$#65535'~'#0$#65535'"
	DO :2 <- #1
	PLEASE DO (4) NEXT
    (4) DO FORGET #1
	DO .1 <- "'V":1~'#65535$#0'"$":2~'#65535
		$#0'"'~'#0$#65535'"$"'V":1~'#0
		$#65535'"$":2~'#65535$#0'"'~'#0$#65535'"
	DO (1) NEXT
	DO :2 <- ":2~'#0$#65535'"
		$"'":2~'#65535$#0'"$#0'~'#32767$#1'"
	DO (4) NEXT
    (2) DO RESUME .1
    (1) PLEASE DO (2) NEXT
	PLEASE FORGET #1
	DO READ OUT :1
	PLEASE DO .1 <- 'V"':1~:1'~#1"$#1'~#3
	DO (3) NEXT
	PLEASE DO (5) NEXT
    (3) DO (2) NEXT
	PLEASE GIVE UP
 

jbode

Ars Legatus Legionis
11,752
Subscriptor
Originally posted by travathian:
Well thanks for all the responses, but what makes you recommend particular choices? That's what I am really interested in, or what languages you learned but never use.

C is good for stuff that needs to be close to the hardware: drivers, OS kernels, etc. It's also good for general-purpose programming, although GUIs are a serious pain in the ass. C doesn't provide high-level support for graphics, networking, file system manipulation, etc; all of these tasks must be accomplished through platform-specific libraries. It's not the best choice for hardcore number crunching.

C++ has many of C's low-level features, with additional tools to facilitate object-oriented programming. Like C, it's good for both systems and general-purpose programming, but IME seems to be used more for the latter. Also like C, it doesn't provide high-level support for graphics, networking, file system manipulation, etc. If you develop for Windows, you will likely be using C++ (not necessarily because it's the best available tool, but it's what everyone is currently using).

I've never used Visual Basic, but I understand it's the tool of choice for rapidly developing data management applications for Windows. Unlike C and C++, it's has high-level support for GUI construction. If you want your application to run on something besides Windows, you're currently out of luck.

My experience with Java is limited. It's described by some as being like C++ "with all the nasty bits taken out." It does provide high-level support for many of the things that C and C++ lack, and is used for both client-side and server-side development. Speed is still an issue, although that's getting better over time. My soon-to-be-former company is using it as a front end to a forms design tool, but they're encountering some problems with fine placement of lines and text.

The other languages I have real experience with (Fortran and Ada) nobody really uses anymore. Fortran's good for number crunching and some general-purpose programming, although serious number-crunchers these days use dedicated tools like Maple or Mathematica. Ada was designed by the DoD to be its standard development environment, and is sort of a bastard cross between object-oriented and procedural paradigms. It was supposed to do low-level and high-level tasks equally well, and was supposed to make really large projects easier to handle. IME, the low-level stuff didn't work so well, and it didn't really make projects easier to manage, it just told you with greater precision how poorly you were managing them.

I recently rediscovered Lisp, which is good for driving yourself insane counting parentheses.
 

Hagbeard

Ars Tribunus Angusticlavius
9,999
Subscriptor
Originally posted by jbode:The other languages I have real experience with (Fortran and Ada) nobody really uses anymore. Fortran's good for number crunching and some general-purpose programming, although serious number-crunchers these days use dedicated tools like Maple or Mathematica. Ada was designed by the DoD to be its standard development environment, and is sort of a bastard cross between object-oriented and procedural paradigms. It was supposed to do low-level and high-level tasks equally well, and was supposed to make really large projects easier to handle. IME, the low-level stuff didn't work so well, and it didn't really make projects easier to manage, it just told you with greater precision how poorly you were managing them.

Not just serious number crunchers, but realize the majority of engineering heritage codes are in fortran - they were and will continue to be, simply because the cost of porting some of those beasts is too large.

As for Ada, that beast. Yes, the DoD still uses it. Every rocket launch you see go out of the Cape or Vandenberg has its guidance and navigation coded in Ada. I know because I worked for three years verifying that bastage Ada was doing its job correctly. Atlas, Titan, and Delta all run Ada, and get this, so will the next generation expendable vehicles, Atlas V and Delta IV. (EELV - evolved expendable launch vehicle). Another example of heritage code that would be way too expensive to port to another language.

Interesting note, to verify the Ada was working correctly, we used the actual flight code, slightly modified to compile and run on an HP-UX box as opposed to the 1750A processors on the bird, connected to our vehicle dynamics written in Fortran by pipes written in C. You want a headache? Try creating a new variable on the Fortran side to be passed to the Ada through the C pipes.

With that said, I know Fortran, some Ada (enough to read and debug, not enough to actually code anything but print statements), started learning C and C++ but kept falling back on my Fortran crutch, Awk for basic scripting, and I started learning Perl a week ago. Awk will now be abandoned for my love affair with Perl, a much more functional and versatile language. I already have a highly functioning script working as a wrapper for pre-processing and post-processing data from a heritage Fortran code, and I can't wait to start incorporating Perl into my recently acquired sysadmin duties.

It's hard to really recommend a language without knowing what you want to do with it. Perl, for example, won't work spectacularly well for matrix math....but then again you could always have it call something that can. ;) So, um, learn Perl. :p
 
Status
Not open for further replies.