Learning Programming Languages

Like the title says, anything and everything else goes here. As long as it follows the forum rules.

Moderator: Raccoon

Post Reply
User avatar
Hoopity
AFH
Posts: 252
Joined: Thu Jul 03, 2008 11:43 am

Learning Programming Languages

Post by Hoopity » Tue Apr 07, 2009 7:01 pm

Shy of four years ago, I began a journey to study the mystical art of mechanical engineering from the Eastern wise men. Since that journey began, I have slowly come to terms with the fact that nobody expects or believes me to have academic ambitions or interests outside that field.

In one such way, I have sought the aid of my computer science friends. When asked for guidance, their response was a unanimous: "It's kind of a lot of effort to pick up."

I have never thought myself stupid, and I have the rest of my life. I ask you, forum-goer, what are the reasons I might choose to learn one language over another and what are some of the applications they are suited for?

I'd appreciate any response that attempts to avoid jargon, but I understand how impossible that may be.

User avatar
zombiepops
My Pie Blown Sky High
Posts: 483
Joined: Thu Jan 22, 2009 8:18 pm
Location: North Carolina
Contact:

Post by zombiepops » Tue Apr 07, 2009 8:30 pm

warning: a favorite programming language is like an asshole - every one has one, and will swear theirs doesn't stink.

shortest biased answer: learn python. python is awesome.

less short and less biased answer:
if you're writing ___ you'll probably want to write in ____ -
os, device driver or highly optimized code: C
os, device driver or insanely optimized code: assembly
windows applications: C++, C#, or VB.NET
Os X applications: Objective C
cross platform applications: Java, Python, and C/C++ with the right libraries
writing your own cellphone apps: Java
scripts to do routine non-interactive tasks: perl, python
large array/matrix math: FORTRAN
software for 40 year old mainframes: Cobol
webapplications or cgi: ruby, perl, python


Longer answer (full of hyperbole and personal bias):
mostly why you chose one language over another should be based more on the problem you're trying to solve. You really can't write an OS or device drivers in something that doesn't let you at the raw hardware, which means C or assembly. Java offers some of the advantages of a of scripting languages with some of the advantages of compiled languages. Scripting languages often offer easy of development and learning, and often a huge array of libraries to do a lot of the heavy lifting for most any situation, at the expense of speed and optimization.

another consideration, what platform are you developing on? If you want to write gui applications on windows, C#, C++, and VB.NET seem to be the popular choice. On Os X objective C is the way to go. (Linux/Posix gives a wider choice). I you want to develop greasemonkey scripts to improve your KOL experience you're stuck with javascript.

If you learn programming right, the language starts to become irrelevant. The algorithms, methods, and designs should be independent of language. (as my first CS teacher said, all programing boils down to a few types of statements: reading data, printing data, looping and calling functions on data - a gross over simplification, but still very true). Learning a new language then becomes a matter of learning new syntax.

Personally, after having worked a variety of languages, these days I do everything in python. I love python. As xkcd said, it makes programming fun again. It's got a nice set of libraries for lots of situations, and has a fairly consistent interface, and after initially being resistant to forced white spacing, I'm a total convert. It make code easier to read and maintain.

now I can't tell if I answered your question or not... damn...

User avatar
NardoLoopa
Market Manipulator
Posts: 1201
Joined: Tue Jun 19, 2007 10:37 pm

Post by NardoLoopa » Tue Apr 07, 2009 9:33 pm

What are your objectives in learning a language?
Image

User avatar
Eleron
Has a thing!
Posts: 870
Joined: Tue Jun 03, 2008 1:52 pm

Post by Eleron » Wed Apr 08, 2009 4:49 am

It depends on what you want to do. If you want to focus on learning programming instead of just learning one programming language, I'd recommend looking at several quite different languages. (And preferably occasionally talk to a programmer friend, which would be invaluable if you have one in close physical proximity =))

Some more information about what you want to do would be really helpful. Python's a nice language to start with if you find a good and suitable tutorial though.

User avatar
Hoopity
AFH
Posts: 252
Joined: Thu Jul 03, 2008 11:43 am

Post by Hoopity » Wed Apr 08, 2009 11:08 am

Thanks for the replies, all.

Although the content of Flolle's log visualizer has little to do with some of the problems I want to solve, it is a nice example. It is:

Stand-alone
Shiny for first-time users
Minor to moderate user interaction

Based on Zpop's statements, starting with python or perl sounds like a fair way to go.

feng shweez
Inscrutable Pi
Posts: 361
Joined: Wed Jul 11, 2007 10:41 am
Location: Boston, MA

Post by feng shweez » Wed Apr 29, 2009 12:15 pm

So I'm interested in web apps. I want a language that makes it easy to interact with medium-to-large databases, and that is easily scalable. Ideally, it would also be reasonably maintainable. So Perl is out.

Seems like most web applications I come across have lots of PHP. My friends use Ruby. Everyone who uses Python seems to swear by it.

Does it matter?

I have some experience with (in order of competence): Java, C++, Perl, VBS, and Pascal. I can't say I'm a terribly good coder. But I always could do the programs assigned to me back in high school/college and I can still take a text file and replace every instance of "Darth Dud" with "DELIBERATELY ANTAGONISTIC ASSHOLE," so there's that.

I'm suppose I'm just wondering...
1) Why I'd choose Ruby over Python or vice versa.
2) Why everyone seems to use PHP.
3) Are any of these languages nearly as good at handling RegEx as Perl?
4) Where I should start learning how to build a useful application. Got a 2-D array with 100,000 items that you need me to do complex algorithms over? Done. But you want a website that takes an input and interacts with a database, or an automated script that scrubs a website for certain data? I'm totally lost at these secondary things like using useful libraries or interacting with inputs that aren't, like, a flat text file.
[url=http://img341.imageshack.us/img341/9392/nootrosforumslk9.gif][img]http://img341.imageshack.us/img341/9392/nootrosforumslk9.gif[/img][/url]

User avatar
NardoLoopa
Market Manipulator
Posts: 1201
Joined: Tue Jun 19, 2007 10:37 pm

Post by NardoLoopa » Wed Apr 29, 2009 7:30 pm

PHP, Python and Ruby are all in the same family. Pick any one of them. Really doesn't matter.

1) PHP -- sort of Perl for web-pages
2) Python -- hyper organized
3) Ruby -- between the two. Rails is where it's at. Python has something similar.

Go with Python . . . because at least then you don't have to listen to the Python people proselytizing to you. Other than that there's no real reason to choose one over the other.

2. everyone uses PHP for the reason lots of people use Perl. It's like a lot of other languages and there are few restrictions. It's very very similar to ASP also.

3. Regex - yes, most have pretty good Regex intergration -- not as good as Perl, though. But not as bad as Java.

4. Any good intro-tutorial website will do -- though, for screen scraping you might stick to Perl.
Image

User avatar
Mr_Crac
Spy vs. Pie
Posts: 57
Joined: Fri Jul 18, 2008 7:31 am

Re: Learning Programming Languages

Post by Mr_Crac » Thu Apr 30, 2009 5:05 am

Hoopity wrote:I'd appreciate any response that attempts to avoid jargon, but I understand how impossible that may be.
If you don't know any programming language at all yet, I would actually recommend to start with HTML. Yes I know it's not a programming language. But it is easy to learn, makes you familiar with the concept of writing "code" in an editor, and lets you see the results immediately in your web browser. Plus, you can use it to create your own homepage. How cool is that? ;-)

Then, you could expand on it by learning JavaScript, and/or PHP. PHP leads you to SQL. Which is also somewhat not really a programming language, but counts as one. Computer science is fantastic.

Recommended book for PHP: Learning PHP5 by David Sklar.
There is a very good website for learning HTML/JavaScript - www.selfhtml.org - but unfortunately it is not available in English. :-(

Turias
AFH
Posts: 134
Joined: Mon Jul 28, 2008 2:06 pm
Contact:

Post by Turias » Thu Apr 30, 2009 5:06 pm

1) Why I'd choose Ruby over Python or vice versa.

They are both good. Python for the web (mod_python, mod_wsgi) has a smaller userbase, so you will get less support, help, and sample code because of it. I have heard stories of rails being unstable, but I do not have any first-hand experience with it.

Personally I would just pick whichever language interests you most. In general I would recommend Python as I feel like Ruby is being pigeonholed into being a web-specific language with rails. From what I have seen, Python is more popular in writing general applications and scripts.

2) Why everyone seems to use PHP.

This one is simple. PHP is supported by every webhost out there. Especially the cheap ones. mod_python / mod_wsgi is not. Rails is somewhere in-between.

My recommendation? If you don't need to be compatible with everything, or if you don't really need some guy's PHP module you found on the web, stay far far away from PHP.

3) Are any of these languages nearly as good at handling RegEx as Perl?

Regexs in Python are straight-forward and easy-to-use, and should be just as powerful for 99% of things you want to do. It's just more wordy (and thus more readable) than perl.

4) Where I should start learning how to build a useful application. Got a 2-D array with 100,000 items that you need me to do complex algorithms over? Done. But you want a website that takes an input and interacts with a database, or an automated script that scrubs a website for certain data? I'm totally lost at these secondary things like using useful libraries or interacting with inputs that aren't, like, a flat text file.

You should start with the documentation for the system you choose. Python? Look at the mod_python or mod_wsgi docs, or the Django docs if you go there (Django is the Rails of Python). Ruby? Read the rails docs. All of these have lots of tutorials out there. I would just start with those.

Post Reply