Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

shawnb123

macrumors newbie
Original poster
Dec 21, 2012
1
0
OK, I'm looking for a programming language to learn in the new year. Here is my background: I have a bachelor's degree in computer technology (mostly web development). I never really learned one language completely well in school because they always changed every semester. Here are some languages I've had some experience with: C, Java, C#, Visual Basic, ASP, SQL/PL-SQL, HTML. I'm not an expert on any of these languages, but I know the basics of object oriented programming, if statements, loops, etc. Currently I'm a systems engineer for a car radio supplier which has nothing to do with my major. Recently I've been filling in some for a software engineer doing builds for software releases and I really enjoy that and may want to push more for doing that eventually. I don't think I want to write software at a really low level, so that rules out C. I would delve more into Java, but that's mostly used in web development and I'm not sure I want to do that. I really just want to learn a general language that would make me more marketable in the future and at the same time learn a language that's fun to use and can be useful anywhere. I'm thinking this may be a scripting language like Python, Ruby, or Perl. I may have just answered my own question, but does anyone have any opinions on what I should learn and advantages/disadvantages of these languages? I really want to devote the entire year to learning a language.

Thanks.
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
Well, you're posting on a Mac programming forum, so if you want to program for OS X or iOS, Objective-C would be best.
In terms of a general purpose, marketable language my first instinct is Java. You wrote it off as a web programming language, which confused me. If you were talking about JavaScript, that's a different story, though it is a great language and very interesting in its own right.
If you are keen to do scripting, any of the three you listed are fine. I might add a shell dialect, too. It helps to have this under your belt, just to save yourself time.

So basically I haven't narrowed it down much, but there isn't one answer, so giving you more info is the best I can do. To be fair, C# is as marketable as Java, but it generally means Windows. That's fine for many folks, but others would choose to avoid that.

Good luck!
-Lee
 

ytk

macrumors 6502
Jul 8, 2010
252
5
Ruby. I can't recommend it enough.

It's really the ideal general purpose programming language for the Mac—I would say even more so than Objective-C. There are at least two methods of integrating Ruby and Cocoa: RubyCocoa, which is the old style and is a bit more compatible in some ways, and MacRuby which is newer and much faster. Code written in MacRuby is actually comparable to Objective-C in terms of speed and functionality. Entire apps can be written in either variant, and you can even write MacRuby iOS apps using RubyMotion.

Most importantly though, Ruby is a really fantastic language. It will change the way you think about programming—no joke. It's straightforward and logical in the way it implements object orientation (literally everything is an object in Ruby, from classes themselves down to integers), and once you learn the Ruby way of doing things you'll be amazed at how much better it is. You can use Ruby for all sorts of things, too—it's just as great for writing a simple text filter as it is running the backend for a massive database or a full on GUI application. Best of all, Ruby is fun to write. No kidding. You will enjoy learning the language, and the Ruby way of doing things.

I've learned quite a few languages over the years, including Objective-C and Perl. After learning Ruby, I never want to use either of them again if I can avoid it. Objective-C is fine, but it seems like you spend more time generating formal descriptions of how your program is going to work and fiddling with data types than writing actual code. Anyway, statically typed languages are a pain in the ass, and not really necessary for most purposes.

Perl is alright, but it's just not as elegant as Ruby in my opinion. Also, code written in Perl tends to be unreadable unless you're meticulous about commenting, and even then it can be a mess trying to figure out what you were doing when you come back to code weeks or months later. By comparison, I rarely bother commenting anything in Ruby (most of it is just short scripts to automate personal tasks, so I'm the only one who ever looks at it) and I usually have no trouble deciphering my code.

I tried learning Python, but there were a lot of things about it that turned me off pretty quickly. I still have to use it from time to time, as it's integrated into several software packages that I use, but I get really frustrated with a lot of aspects of the language. The whitespace thing is obviously a big turnoff, but there are other things about it too, such as how inconsistent it seems. It's like it can't decide if it wants to be mainly a procedural or an object oriented language; sometimes you operate on objects by calling a method on them, and sometimes you pass them to a function, and sometimes you can do it either way, but they work slightly differently. It's very confusing and frustrating, especially compared to Ruby where everything works pretty much the way you expect it to.

So, obviously I have a strong opinion on the matter, but having been there and been unsure about taking the plunge into learning Ruby a few years ago after using Perl for nearly a decade, I can honestly now say that I didn't even know it was possible to like any programming language nearly as much as I do Ruby.
 

firewood

macrumors G3
Jul 29, 2003
8,108
1,345
Silicon Valley
Objective C is rising in demand and popularity. It allows you to use and develop both low-level C chops as well as higher level object/message patterns. You can use Objective C for both mobile and desktop apps.

Personally I would also throw learning a bit of one scripting language as well, such as python, perl or lua.
 

mslide

macrumors 6502a
Sep 17, 2007
707
2
I would pick 2, a traditional object oriented language like C++ and a dynamic type/scripted language like Ruby. That will give you exposure to most of the things you'd see in any language. It also exposes you to two different styles of programming. Like ytk, I'm a fan of Ruby. It's a nice language.

Java isn't a web only language. It's a good, general purpose language that's used in lots of areas. Maybe you're thinking of JavaScript? If so, that's a completely different language that has nothing to do with Java other than the fact that the word 'Java' is in its name.

You sound like you aren't interested in web development, however, if you are ever interested in going that route, the language to learn is JavaScript followed by something like Ruby and Ruby on Rails or some other web framework.

In the end though, it's mostly all the same just different syntax and APIs
 

crows

macrumors member
Nov 26, 2012
90
0
To the OP and anyone with a similar question, I would strongly suggest you learn C and as mush as possible as to how computers work in general, trust me it will save you a lot of time when you know what is going on behind the scenes, as you might know higher level languages and implementations hide many details like memory management and other stuff just to save time on development and to compensate for programmer errors like forgetting to release resources, but they also assume that you do have this knowledge and that you are using the tool to save time not to skip learning why it works...I really recommend not viewing yourself as an expert in anyone one language but as a person who knows how to tell the computer what to do, because it really doesn't matter in what language you end up programming in what matters is that you can provide a working solution.

That said obviously there are languages that are better for specific areas just because they were designed for solving those problems in a better/elegant matter.

imo you should learn how the low level stuff works before dwelling in the higher level

this is the list of what I would learn in order:
C
C++

then you can move to your higher level stuff
Objective-C
Java
C#

interpreted
Python
Ruby
Perl

i'm not saying to become an expert in C or C++ what i'm saying is get yourself a book on C and really read it and understand what is going on, later you will see that the knowledge just helps you debug faster and solve problems that give you misleading outputs or errors
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.