Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Which programming language should I learn? (Updated)
Index -> General Programming
Goto page 1, 2, 3, 4, 5, 6, 7, 8  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
wtd




PostPosted: Tue Jan 04, 2005 4:06 am   Post subject: Which programming language should I learn? (Updated)

I've seen it asked several times: what programming language should I learn?

I like answering this question, so I thought I'd do so in one place by listing pros and cons for several different languages. I may also organize it into a chart, but there are a lot of categories and a lot of languages, and some of the scores would be subjective. Smile

Assembly

Pros:


  • Fast.
  • Can open up job prospects that many programmers aren't trained for.


Cons:


  • Not portable. Your code won't translate between different processors, or often even different operating systems running on the same processor.
  • Poor documentation. Docs are often either very scarce or not written for beginners. Sometimes books on assembly programming can be quite expensive.
  • Very low-level. Assembly addresses problems related very specifically to hardware, rather than demonstrating general good software design practices. What you learn in the process of learning assembly language generally won't apply well to other programming work.


C

Pros:


  • Fast. Nearly as fast as assembly, but easier to develop.
  • It's everywhere. Nearly every hardware and software platform implements at least some of the C standard.
  • It's standardized. There is a standard you can code to, rather than worrying about each compiler actually working on a slightly different "version" of C.


Cons:


  • Manual memory management. The most frequent problems students and professionals alike have are with managing memory. It gets in the way of teaching other general skills.
  • No string type. Along with the previous point, this makes it cumbersome to do even basic programming in C without considerable experience.
  • A relatively limited standard library forces programmers to turn to nonstandard 3rd party extensions, or to reinvent the wheel.
  • Very limited facilities for code re-use.
  • Many errors involve code that compiles, but then fails with cryptic linker messages, making it difficult to find the bug that caused them without a significant amount of experience.
  • No support for object-oriented programming. It's possible, but the language doesn't help.


Code:

code:
#include <stdio.h>

int main()
{
   puts("Hello world");
   return 0;
}


Adding a simple function/procedure:

code:
#include <stdio.h>

void greet();

int main()
{
   greet();
   return 0;
}

void greet()
{
   puts("Hello world");
}


C++

Pros:


  • Fast. Almost as fast, and sometimes as fast as C.
  • Nearly as widely available as C.
  • Standardized, though not as long as C has been.
  • Good support for object-oriented programming, including multiple inheritance.
  • Amazingly powerful template system.
  • Standard Template Library. This collection of classes and functions makes it easy to do powerful things.


Cons:


  • Lots of sources don't teach standard C++. Worse, they often teach C concepts which ignore the power of C++ and leave programmers doing more work to write worse code.
  • Somewhat better for code re-use than C, but not good.
  • Complex, often tricky syntax which contains many subtle variations. A simple typo can produce code that compiles, but does something very different than what was intended.
  • Memory management is a bit better than C, but still presents frequent pitfalls.


Code:

code:
#include <iostream>

int main()
{
   std::cout << "Hello world" << std::endl;
   return 0;
}


Adding a simple function/procedure:

code:
#include <stdio.h>

void greet();

int main()
{
   std::cout << "Hello world" << std::endl;
   return 0;
}

void greet()
{
   puts("Hello world");
}


Objective-C

Pros:


  • Simplicity. For C programmers, Objective-C is entirely compatible with old C code, adding only a few new keywords.
  • Powerful object-oriented language.
  • Large, powerful libraries available.


Cons:


  • Aside from issues of code re-use and object-orientation, it also shares the cons of C.
  • Compilers are widely available, but Objective-C remains largely the domain of Apple Computer.
  • No independent standard.


Code:

code:
#include <stdio.h>

int main()
{
   puts("Hello world");
   return 0;
}


Adding a simple function/procedure:

code:
#include <stdio.h>

void greet();

int main()
{
   greet();
   return 0;
}

void greet()
{
   puts("Hello world");
}


Java

Pros:


  • Widely available.
  • Freely available.
  • Wide industry and community support.
  • A vast and powerful library, and excellent documentation of that library.
  • Excellent support for single inheritance object orientation.
  • Good support for code re-use.


Cons:


  • No alternative to object-oriented programming. It can be difficult when learning to use:

    code:
    public class Something
    {
       public static void main(String[] args)
       {
       }
    }


    As a "frame" for programs without knowing what that does.
  • Core language is rather limited, and forces use of much of the library to accomplish basic introductory programming tasks.
  • No independent standard.


Code:

code:
import java.lang.*;
import java.io.*;

public class HelloWorld
{
   public static void main(String[] args)
   {
      System.out.println("Hello world");
   }
}


Adding a simple function/procedure:

code:
import java.lang.*;
import java.io.*;

public class HelloWorld
{
   public static void main(String[] args)
   {
      greet();
   }
   
   private static void greet()
   {
      system.out.println("Hello world");
   }
}


Perl

Pros:


  • Available on many platforms. Already installed on pretty much every Unix or Unix-like system and available for Windows.
  • Easy to get started with.
  • Huge library of available code already written by others.
  • Integral support for regular expressions. Very powerful text-processing as a result.
  • Support for object-orientation with multiple inheritance.
  • Excellent support for code re-use.


Cons:


  • Object-orientation requires a great deal of discipline.
  • Large, sometimes confusing syntax.


Code:

code:
print "Hello world\n";


Adding a simple function/procedure:

code:
greet;

sub greet {
   print "Hello world\n";
}


Python

Pros:



  • Widely available.
  • Freely available.
  • Rapidly gaining in industry support.
  • Powerful built-in data structures and a large standard library.
  • Interactive interpreter makes it easy to test code.
  • Plentiful 3rd party code.
  • Object-oriented programming support, with multiple inheritance.


Cons:


  • Object-oriented components of the language feel tacked on.
  • Regular expressions do not have convenient syntax.
  • Scope of variables can be difficult to determine.
  • No independent standard.


code:
print "Hello world"


Adding a simple function/procedure:

code:
def greet():
   print "Hello world"
   
greet()


Ruby

Pros:


  • Widely available.
  • Freely available.
  • Active and friendly community for support.
  • Purely object-oriented. Everything is an object. Beginners can pretend it's not, to make getting started easy.
  • Blocks borrowed from SmallTalk make it easy to do some amazing things.
  • Well-endowed standard library.
  • Interactive interpreter makes it easy to test code.
  • Integral support for regular expressions allows powerful text processing at least on par with Perl.
  • Excellent support for code re-use.


Cons:


  • Of Perl, Python and Ruby, Ruby is probably the slowest.
  • Less code available than in the Perl and Python worlds.
  • Documentation is sometimes lacking.


Code:

code:
puts "Hello world"


Adding a simple function/procedure:

code:
def greet
   puts "Hello world"
end

greet


Turing

Pros:


  • Simple environment for writing and testing code.
  • Standard graphics library.
  • Decent support for structured programming and modularization.
  • Decent documentation.


Cons:


  • Not free. Wouldn't be such a sin, except that so many good languages have free implementations.
  • Proprietary. All future changes/improvements are in the hands of a single company.
  • No industry support to speak of, and few communities to provide help for beginning programmers.
  • Little 3rd party code to draw on.
  • Supports object-orientation, but in a cumbersome manner.
  • Language remains highly procedural when few other languages follow that style anymore, so experience gained is only marginally applicable elsewhere.


Code:

code:
put "Hello world"


Adding a simple function/procedure:

code:
procedure greet
   put "Hello world"
end greet

greet


Pascal

Pros:


  • Easy to get started with.
  • Widely available.
  • Free compilers available.
  • Mature. Programmers needn't worry about it changing tomorrow.
  • Support for many programming concepts.


Cons:


  • Old. There's no way around that one. It's old and what interest exists is either stagnant or waning.
  • Lack of good support for modern OO techniques.
  • Standardized, but adherence to those standards is lacking.


Code:

code:
program HelloWorld;
begin
   WriteLn("Hello world")
end.


Adding a simple function/procedure:

code:
program HelloWorld;

   procedure Greet;
   begin
      WriteLn("Hello world")
   end;
   
begin
   Greet
end.


Haskell

Pros:


  • Available on Mac OS X, Windows, and every Unix under the sun.
  • Multiple open source environments are freely available.
  • The standard for lazy, pure functional programming languages.
  • Standardized as Haskell 98. Environments implement that standard, and then add extra extensions.
  • Reasonably comprehensive standard library.
  • Stable. Haskell will not change radically in a year's time, so you don't have to worry as much about not using the latest and greatest thing.
  • Can be either compiled and interpreted.
  • Very fast. Roughly on par with C, and frequently faster.
  • Type-safe. All type errors are caught at compile time.
  • Excellent support for code re-use.
  • Large and active community.
  • Forces learning a functional style of programming.


Cons:


  • Relatively little "name value" in the industry at large.


Code:

code:
module Main where

main :: IO ()
main = putStrLn "Hello world"


Adding a simple function/procedure:

code:
module Main where

main :: IO ()
main = greet

greet :: IO ()
greet = putStrLn "Hello world"


Objective-Caml (O'Caml)

Pros:


  • Widely available.
  • Freely available.
  • Can be compiled or interpreted.
  • Fast. When compiled with the optimizing compiler, O'Caml programs can on par with or faster than programs written in C.
  • Type errors are all caught when compiling.
  • Supports object-orientation with multiple inheritance.
  • Excellent support for code re-use.
  • Large community concerned with "practical" programming.


Cons:


  • Lots of syntax to remember.
  • Unique set of operators for floating point math.


Code:

code:
let main = print_endline "Hello world"


Adding a simple function/procedure:

code:
let main = greet

let greet = print_endline "Hello world"


Eiffel

Pros:


  • Several implementations available. One is free and open source.
  • Excellent support for object-oriented programming with multiple inheritance.
  • Excellent support for code re-use.
  • Verbose. Code is often self-documenting.


Cons:


  • Small community.
  • Best implementations are very expensive.
  • Impossible to write code outside of a class, so beginners will have to deal with it immediately. Same con that you see with Java (and C#).


Code:

code:
class
   HELLO_WORLD
creation { ANY }
   make
feature { ANY }
   make is
      do
         std_output.put_string("Hello world")
         std_ouput.put_new_line
      end
end


Adding a simple function/procedure:

code:
class
   HELLO_WORLD
creation { ANY }
   make
feature { ANY }
   make is
      do
         greet
      end
feature { NONE }
   greet is
      do
         std_output.put_string("Hello world")
         std_ouput.put_new_line
      end
end


C#

Pros:


  • A vast and powerful library, and decent documentation of that library.
  • Excellent support for single inheritance object orientation.
  • Good support for code re-use.
  • Language is independently standardized.
  • Decent interoperability with other languages via .NET.
  • Free, open source compilers and environments available.


Cons:


  • Many libraries, especially those related to graphics and desktop and web applications are not standardized, and are only available on Windows or else lag on other platforms.
  • Forces programmers to immediately deal with object-orientation, which can be confusing and overly intimidating for beginners.
  • Odd naming convention.


code:
using System;

public class HelloWorld
{
   public static void Main(string[] args)
   {
      Console.WriteLine("Hello world");
   }
}


Adding a simple function/procedure:

code:
using System;

public class HelloWorld
{
   public static void Main(string[] args)
   {
      Greet();
   }
   
   private static void Greet()
   {
      Console.WriteLine("Hello world");
   }
}


Visual Basic (upto 6)

Pros:


  • Good integration with Windows.
  • Interfaces with other Microsoft tools (Office, notably).


Cons:


  • Dead. Microsoft has no further plans for VB6 and earlier, except to bury them as far underground as possible.
  • Not free.
  • Limited to Windows entirely.
  • Poor syntax. This one I usually leave out since it's subjective, but VB really takes the cake on odd syntax.
  • Poor facilities for structured programming lead to code that is difficult to read and maintain.


VB.NET

Pros:


  • Pretty much the same as C#, since they both access the same library. VB.NET is little more than a different syntax for C#.
  • VB6 and earlier programmers may feel more at home with VB.NET than C#.


Cons:


  • Also largely the same as those listed with C#.


Delphi

Pros:


  • Good Windows integration.


Cons:


  • Dead. Dead, dead, dead... Borland has utterly and completely given up.
  • Not free.
  • Limited to Windows.
  • Confuses language with environment, leading to programmers who are fundamentally confused later on.
  • Based on Object Pascal, for which there is no useful independent standard.


Ada95

Pros:


  • Excellent open-source compiler available.
  • Very fast. On par with or exceeding speed of programs written in C.
  • Very good support for code re-use.
  • Verbose. Code is often self-documenting.
  • Reasonably comprehensive standard library.
  • Independently standardized.
  • Strong in the aerospace industry. Ada is used to write software for Boeing aircraft, for instance.


Cons:


  • Small community.
  • Undeserved but quite pervasive bad reputation among management and corporate types.
  • Verbose. It can take a while to say anything in Ada.
  • Only really strong in aerospace and defense industries.


Code:

code:
with Ada.Text_IO;
use Ada.Text_IO;

procedure Hello_World is
begin
   Put_Line("Hello world");
end Hello_World;


Adding a simple function/procedure:

code:
with Ada.Text_IO;
use Ada.Text_IO;

procedure Hello_World is
   procedure Greet is
   begin
      Put_Line("Hello world");
   end Greet;
begin
   Greet;
end Hello_World;
Sponsor
Sponsor
Sponsor
sponsor
MihaiG




PostPosted: Tue Jan 04, 2005 6:29 pm   Post subject: (No subject)

i should slap you.....you for got Visual Basic 6.... Delphi 5 and others.....
zomg




PostPosted: Tue Jan 04, 2005 6:37 pm   Post subject: (No subject)

considering how the long the list was he probably either
1)copied it from a website and they didn thave anything about VB or anything...
2)typed it up and left out VB cuz it was so long already
3)Perhaps he forgot it...unlikly tho


BTW this list kicks thx for posting
Catalyst




PostPosted: Tue Jan 04, 2005 6:41 pm   Post subject: (No subject)

or he simply doesnt like visual basic 6
wtd




PostPosted: Tue Jan 04, 2005 6:45 pm   Post subject: (No subject)

Catalyst wrote:
or he simply doesnt like visual basic 6


Very much so, but yes, I typed it all myself and I was first including languages I am most familiar with. It will be expanded in the near future.
zomg




PostPosted: Tue Jan 04, 2005 6:46 pm   Post subject: (No subject)

its all coming together
Martin




PostPosted: Wed Jan 05, 2005 1:45 am   Post subject: (No subject)

Great guide wtd Very Happy

I've been considering learning C#, as it has some really nifty features, and what appears to be incredibly cleaned up syntax as compared to C++. All and all, it seems like an interesting language.

My main motivation is that winAPI and COM are apparently being replaced by .net (I read somewhere that Longhorn is going to be built on .net) and I want to get into some DirectX.

EDIT: Speaking of which, can anyone point me in the direction of a good, and free C# compiler for Linux?
Tony




PostPosted: Wed Jan 05, 2005 2:52 am   Post subject: (No subject)

wtd wrote:
I typed it all myself

He defenatly did. You can see so in the views expressed tawards certain programming languages (well atleast to those who know wtd better)

Anyways, wtd knows alot about alot of programming languages, and I find this list to be quite accurate. Great job Very Happy
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Wed Jan 05, 2005 3:02 am   Post subject: (No subject)

martin wrote:
Great guide wtd Very Happy

I've been considering learning C#, as it has some really nifty features, and what appears to be incredibly cleaned up syntax as compared to C++. All and all, it seems like an interesting language.

My main motivation is that winAPI and COM are apparently being replaced by .net (I read somewhere that Longhorn is going to be built on .net) and I want to get into some DirectX.

EDIT: Speaking of which, can anyone point me in the direction of a good, and free C# compiler for Linux?


Mono is a good C# environment on Windows, Linux, Mac OS X, etc.

Be careful, though, Microsoft's plans for Longhorn change every other Tuesday. .NET is the way to go for Windows development, though.

As for it being a cleaned up C++... it's really more a Java clone, though the guy in charge of developing C# headed up Delphi for Borland, so you'll find some parts of the language that behave more like Object Pascal.
rizzix




PostPosted: Wed Jan 05, 2005 3:09 pm   Post subject: (No subject)

martin wrote:

I've been considering learning C#, as it has some really nifty features, and what appears to be incredibly cleaned up syntax as compared to C++. All and all, it seems like an interesting language.



Ha the guy who dislikes java but likes c#.. lmao
wtd




PostPosted: Wed Jan 05, 2005 3:27 pm   Post subject: (No subject)

rizzix wrote:
martin wrote:

I've been considering learning C#, as it has some really nifty features, and what appears to be incredibly cleaned up syntax as compared to C++. All and all, it seems like an interesting language.



Ha the guy who dislikes java but likes c#.. lmao


But C# came from Microsoft. With that sig image I think he's obligated to like it.
Martin




PostPosted: Wed Jan 05, 2005 4:01 pm   Post subject: (No subject)

Hey, I'm not a Microsoft lackey. I'm just heading the anti-anti-microsoft campaign. I still use Firefox AND Linux. Hell, I make my money from programming in Linux.

And my dislike of Java is entirely due to the classes that I took.
Tony




PostPosted: Wed Jan 05, 2005 9:24 pm   Post subject: (No subject)

martin wrote:
And my dislike of Java is entirely due to the classes that I took.

You didn't go to any of your Java classes Eh
Martin




PostPosted: Wed Jan 05, 2005 9:30 pm   Post subject: (No subject)

Brainf*ck
Pros:
  • 3 bit development environment, making it easy to learn the entire language in just minutes.
  • Compiler that is under one kb in size.
  • Turing complete.
  • Free

Cons:
  • Some more advanced applications (such as input, output, math, repetition, etc.) are more difficult.
  • Very few tutorials.
  • The name gets starred out by compsci.ca's filter


And, on that note, you win a sticky.
Bobrobyn




PostPosted: Fri Apr 08, 2005 9:10 am   Post subject: (No subject)

He also forgot qbasic, which is a very fun, but old. *cough* we have to use it in our computer engineering classes */cough*

~Bob
Display posts from previous:   
   Index -> General Programming
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 8  [ 111 Posts ]
Goto page 1, 2, 3, 4, 5, 6, 7, 8  Next
Jump to:   


Style:  
Search: