Which Computer Language to Learn

  • #51
Monique
Staff Emeritus
Science Advisor
Gold Member
4,149
64
graphic7 said:
If you're used to C syntax it's very easy to learn Perl.
Absolutely true.
faust9 said:
If you are not proficient with Unix programming then Perl has a very steep learning curve.
Not true.

In bioinformatics Perl is the main programming language, mainly because of the ability to use regular expressions when search DNA and protein files. So for bioinformatics I'd say definately learn Perl, but before doing that I'd start with learning C. By learning C you get programmed yourself to write clean scripts and declare variables, write your own functions etc. so you get a more comprehensive understanding of programming. Learning Perl after that is a piece of cake.

But running a program written in Perl can take considerably longer to run than a program written in C. Thirty secs vs 2 secs. Probably because Perl is compliled while it is being run, while C requires compilation before it can be run?

Anyway.. I'm not a hard-core programmer, but I found that programming in C and Perl is simple and that running Unix is not a big deal either. There are some things I still need to learn though, like extracting data from online databases..

Two questions I don't quite get yet:
1. What's the difference between scripting languages and others?
2. What's exactly is object oriented? What I understand is that it allows you to bring units from different programmers together into a single program? What's the use of being object oriented?
 
  • #52
dduardo
Staff Emeritus
1,890
3
1. A program written in an interpreted language is interpreted by an interpreter when run :rofl:

A program written in a compiled language is converted into machine code and can be executed directly by the processor.

2. Object oriented programming as opposed to procederal programming uses objects to represent things. For example:

class person {

string name;
int age;

};

main () {

person david, linus;

david = linus

cout << david.age ;

}

This is a rather simple example of OOP, but it shows you how you basically organize stuff into objects. In procedural programming you would need to do something like this:

string person1_name;
int person1_age;
string person2_name;
int person2_age;

person1_name = person2_name;
person1_age = person2_age;

cout <<person1_age << endl;

You can easily see how OOP is easier to understand.

----------------------

On other note, I've recently been doing some work in Python and I must say it is one of the tightest and elegant programming language i've worked with. Although I would probable always recommend C as the best langauge to learn first because it forces you to actually understand memory and other aspects of programming, Python really makes programming every so more enjoyable. Especially when you don't need to remember to put semicolons at the end of each line.
 
  • #53
graphic7
Gold Member
450
2
A scripting language is essentially interpreted. With Perl, once your script is executed, it's passed through the Perl interpreter, the Perl interpreter reads the script and calls the neccessary libraries and functions, just as the script would suggest.

This is a tidbit you may find useful - Perl scripts can also be translated to C code. Take a look at PerlCC. I've seen performance increases, but it's difficult to compile it if you're using tons of modules.

Object oriented programming is a much more structured way of programming. It's a little bit more intuitive than creating a subroutine. You can sort of actually create a subroutine that holds lots of other subroutines.

I'm sure you've exercised Perl's object oriented structure before:

$a = Some::Module->new();

etc. etc.

Any time, you're using a module, you are exercising the object orientation Perl features. If you call some module like Net::FTP, we know that we're calling Net, but we really want to call the FTP function. It would be funny finding the FTP function in some module; for instance, Math::FTP. I said earlier, that it's like "creating a subroutine within a subroutine," however we know Math or Net isn't a subroutine - they just hold lots of other subroutines.

There's a lot to OOP, like polymorphism, classes, etc. etc. Objects themselves are just skimming the surface of the OOP ocean.

I had no idea that Perl was used in your line of work. You mentioned regex; take a look at `awk' in UNIX. It's basically an interpreter that can accept regex's from the terminal. It might save you a few minutes the next time you're wanting to search through something, instead of having to hack up a Perl script with some simple regex, which is unneccessary.
 
Last edited:
  • #54
158
0
Which is the best language for graphics.
 
  • #55
36
0
thats a hard one.

Many here might say C++.
I would rather say C# than C++ (but that is because i bloody hate C++)

Altough, whilst i was still programming 3D games i do remember having seen a Delphi 3D engine once, and it was remarkable. But that was almost 3, perhaps even 4 years ago. So i have been out of the professional game dev loop for a while so i am going to leave this to others to answer.
 
  • #56
dduardo
Staff Emeritus
1,890
3
chound, it depends on what you mean by graphics. Any high end game is going to be written in C++. If your doing simple 2d or 3d drawing you can get away with slower languages.

Bah C#. I would never recommend locking your self into the .NET framework. This is just another way Microsoft can force you to pay their tax. I've never written anything in that language and I don't plan on doing so anytime soon. I'll stick to python thank you very much.
 

Related Threads on Which Computer Language to Learn

  • Last Post
Replies
18
Views
6K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
8
Views
360K
  • Last Post
Replies
2
Views
2K
Replies
1
Views
18K
Replies
17
Views
194K
Replies
1
Views
8K
  • Last Post
Replies
5
Views
6K
Replies
1
Views
7K
Replies
14
Views
4K
Top