PDA

View Full Version : modern programming languages



Bender
11-11-2009, 04:42 PM
In the midst of all the MW2 threads, here's something different...

thinking about playing around with learning a more modern language in my spare time at home. I have never been able to get my head around OOP the few times I have dabbled in it.

I'm an old guy, used to be an RPG II programmer and a COBOL programmer back in the early 80s, before PCs were common in business. Anything that came after cobol is "modern" to me.

I dabbled in java for a little while, but never really went after it. Was thinking about learning python... What is python used for? is it a rinky dink language like basic, or can it do hard-core stuff? Is python an OO language?

what's a good language to learn OO programming?

sabar
11-11-2009, 08:37 PM
Python is usually used for scripting, but it is certainly powerful enough to write just about anything. It can be used for OO if you choose.

Almost every language nowadays has OO support natively or from additional modules. C-sharp, C++, and Java are by far the most common OO languages taught. You can easily learn them from the internet or a cheap book.

In the end, any language is good. You can do OO in C++, C#, Java, Lua, Ruby, Python, Perl, or in a lot of ancient languages too. Look at the syntax of them and pick something that looks easy or useful. Once you pick up OO fundamentals, you can easily transition to any other programming language.

Even COBOL has OO support these days.

spursncowboys
11-11-2009, 10:45 PM
lifehacker just did a good blog on this:
http://lifehacker.com/5401954/programmer-101-teach-yourself-how-to-code

Bender
11-11-2009, 11:50 PM
I downloaded python 3.1.1, been playing with the interpreter.

thanks for the lifehacker link.

I just want to learn the concepts of OOP. Back in the day, it was all procedural programming.

I've read a few books on oop, but I think it is harder for an ex-procedural programmer to grasp the concept of objects than it is for someone new to programming.

spurster
11-12-2009, 10:11 AM
Java and C# are probably the best OO languages out there. The languages themselves are so-so, but they come with huge libraries. The disadvantages is that they are slow for anything computationally intensive and they need more a lot more runtime memory.

Python is a cool language. Its main use is for scripting rather than large-scale programming. It has OO, but that is not its key feature, which is that Python uses indentation for program structure rather than { } or other delimiters. You'll need a editor that will help you keep the indentation consistent.

Bender
11-12-2009, 11:15 AM
so what's a good, simple IDE? something better than notepad, but without all the complications and bells & whistles of a powerful IDE.

a couple years ago when I was messing with java, I used eclipse for an ide, but I thought it was more complicated than I needed at the time.

I bought a bunch of highly recommended Java books back then, and still have them. Maybe I should get back on learning java instead of python. Yeah, I know, most info is available on the web... but us old guys like books... :lol

edit: I remember there was something about eclipse I wasn't crazy about. something about directories, or something... workspaces?

baseline bum
11-12-2009, 02:00 PM
If you want to learn Java, Core Java by Cay Horstman is by far the best book out there. I don't know what to recommend if you didn't like Eclipse though. Eclipse is an awesome IDE with its ability to do things like text completion and show documentation in popups. I'm not sure what's good on Windows as a lightweight text editor with syntax highlighting for writing small programs, but in GNU/Linux I like using Kate.

Python is a really cool language, and if you want a good but not too fast intro to programming it you can watch the lecture videos for MIT's 6.00 class at http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/6-00Fall-2008/CourseHome/index.htm.

baseline bum
11-12-2009, 02:05 PM
Also, if you want a good overview of OOP, I think Brian Harvey at Cal Berkeley gives a great explanation of it in his CS61A class. It's in the video titled Object Oriented Programming I at the page http://webcast.berkeley.edu/course_details_new.php?seriesid=2008-D-26263&semesterid=2008-D

baseline bum
11-12-2009, 02:13 PM
If you want to learn a really cool language though, I recommend Scheme. It's incredibly easy to learn while providing powerful techniques that languages like Java and C++ implement in clunky ways. On top of that, the greatest computer science book ever written, the Structure and Interpretation of Computer Programs, uses it to teach one how to program.

Here's a link to SICP, which is freely available online from MIT Press:
http://mitpress.mit.edu/sicp/full-text/book/book.html

I highly recommend following the rest of those CS61A lectures I posted above if you're interested in programming, and the authors also have some outstanding lectures posted at MIT's 6.001 website at http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/6-001Spring-2005/CourseHome/index.htm

Bender
11-12-2009, 02:25 PM
thanks, I'll check all that out when I get home from work today!

baseline bum
11-12-2009, 02:34 PM
Let me warn you that SICP isn't going to spend much time explicitly on OOP though. It'll show you how to implement it, but it's definitely not what you're looking for if learning OOP is your single goal. Still, it's filled with lots of mind-blowing "I didn't know you could do that!" moments.

baseline bum
11-12-2009, 02:52 PM
I bought a bunch of highly recommended Java books back then, and still have them. Maybe I should get back on learning java instead of python. Yeah, I know, most info is available on the web... but us old guys like books... :lol

I'm curious... which books did you try? There are so many awful CS books out there.

Bender
11-12-2009, 03:01 PM
can't remember which ones offhand, they are at home. These were recommended on amazon (by noobs), so they may be simplified books...

edit: oh yeah, I remember a couple: Head First Java, by Kathy Sierra, and Thinking In Java, by Bruce Eckels. And a couple more that I can't remember.

baseline bum
11-12-2009, 03:58 PM
Crap. I loved Head First Java. :lol

Bender
11-12-2009, 04:11 PM
I remember Head First having an unusual presentation... but I liked it ok. Didn't get very far into it before I quit Java and got into something else.

The Eckel book was real good if I remember. I might have the Murach Java book too.

velik_m
11-12-2009, 04:42 PM
It has OO, but that is not its key feature, which is that Python uses indentation for program structure rather than { } or other delimiters.

Indentation is a key feature of Python? :lol

Python is the language that in my opinion sucks the least, so i would recommend it.

Most languages nowdays have OO support. But if you want to learn it, then perhaps a language designed around OO principles like Smalltalk, or maybe even Java, would be best. I think the best method to learn OO, is to at first force yourself to think about everything in terms of objects, methods, inheritance... and try to write everything with object. And then, when you get comfortable with it, you scale back the OO principles to something useful and practical.


so what's a good, simple IDE? something better than notepad, but without all the complications and bells & whistles of a powerful IDE.

Python has Stani's Python Editor, which is very nice. I used Notepad++ on Windows and I use Geany on Ubuntu.

Bender
11-12-2009, 05:10 PM
my problem a couple years ago while trying out OO, was that, coming from cobol 74, I couldn't get my mind thinking in terms of objects, encapsulation, etc....

guess I have a linear brain.

have a lot of time on my hands every evening, so was thinking about getting into it again.
Plus my 11, almost 12, year old son has expressed interest in learning programming. He's pretty geeky with computers.

baseline bum
11-12-2009, 05:31 PM
Just think of OOP as a metaphor where your encapsulated local state, i.e., your object, has a certain level of intelligence built in. You tell it to do things by passing it a message, and it knows how to do them. Your object has all the functions it needs physically encapsulated in it. Instead of having smart functions like in the procedural world, you have smart data that knows how to operate on itself when given simple instructions (i.e., a message telling it to do something, a.k.a., a method call).

velik_m
11-13-2009, 12:41 AM
my problem a couple years ago while trying out OO, was that, coming from cobol 74, I couldn't get my mind thinking in terms of objects, encapsulation, etc....

Yeah, i had the same issue - i understood everything about the OO, but when i wrote the program, i just didn't use any of it. Then one day, i said my next program will be OO, no matter what, from now on everything is an object, even if i know there is a better alternative. I forced myself to use OO principles, even if i thought that something was stupid and i could do that stuff faster and better with procedural programming.
At first it was kind of wierd, but after a while it started to feel natural to think of everything as objects. Of course in practice OO is sometimes overkill and not every situation calls for it, and procedural is just as ok.

It's always fun to learn new programming philosophies, for instance learning something like Prolog or Erlang. It gives you a new, fresh perspective on stuff, even if you don't end up using it.

Bender
11-13-2009, 10:52 AM
I wonder what type of home programming projects I could mess with...?

spurster
11-13-2009, 03:03 PM
Indentation is a key feature of Python? :lol


And parentheses are the key feature of Scheme, lots and lots of parentheses.