Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Programming: Where to Start?

Programming: Where to Start?
Thread Tools
Gamoe
Mac Elite
Join Date: Sep 2000
Status: Offline
Reply With Quote
Oct 7, 2007, 06:09 AM
 
So, I want to actually "learn" a programming language, rather than continue hacking things together from existing code. Problem is, I can't decide which one, or how to go about it. I tried learning to code back before Mac OS X by buying a book on learning to program in C for the Mac. I didn't get through the book then, but I'm willing to give it another shot now.

Some of the languages I've considered are:

Objective-C
C++
PHP
Python

I realize some of these languages are pretty different. I'll start with why I've considered the above languages.

Objective-C, C++

My platforms of choice are Mac OS X and Linux. I need something that is easily transferable from one platform to the other. I'd like the ability of making graphical applications for both. Coding for Windows is not a priority for me, but being able to do more is never bad, of course.

I'm looking at Objective-C because it's Apple's preferred language for Mac OS X and XCode seems designed for it, though I understand it also works well with some other languages. The nicely integrated, freely available, Objective-C ready Apple tools are a nice plus for the language, however.

But, I'm not sure how portable or transferable this would be to Linux. That's why I've also considered C++. Of course, the differences between the two languages I understand are minor, as they both share the basic C language set. I'm not sure about the difficulty here. Some people seem to find the language difficult.

PHP

PHP seems a simpler language to learn, and I find it's server/web emphasis very useful. I've often hacked PHP scripts quite effortlessly to do what I need, even though I do not "know" PHP. To me, this highlights the power of simplicity that PHP offers. I would definitely like to be able to write some simple web apps using PHP.

But again, I am also very interested in writing desktop apps for Mac OS X and Linux. In fact, I would love to be able to make client/server apps, one on a server (for example a photo gallery script) and one on the desktop to interact with the former (posting a photo gallery to a web site using the desktop app client).

The thing is, I'm not sure of the practical limits to PHP for desktop applications. Would it be a difficult or overly complex task to create a graphical app for Mac OS X or Linux using PHP, or would this be as simple or simpler than doing it in C or some other "mainstream" desktop language? All I've heard of in regards to desktop GUI apps and PHP is PHP-GTK, but that appears to be a relatively new endeavor.

Python

I understand this language also has less complex syntax for a beginner to pick up, and that it is used on the desktop, but I don't know a whole lot about it.

Other Languages

I know all the rage is about Ruby on Rails now as far as web programming, but I find that the language is too new, and I prefer something more established, with more tools and support available. There might be other good candidate languages I've missed, though.

Uses

I'd like to be able to write a desktop to web photo gallery, as per my previous example, for instance. I'd also like to be able to write something akin to a word processor, or a file browser.

I'd also like to be able to make simple game-like environments with game-like elements, though I'm not really aiming to make games per-se, but rather to integrate game-like graphical elements for other uses (for example, game-like 2-D or 3-D characters for an engaging chat client). I'm not sure of the difficulty required here, though. I suppose a language that could do 90% of what I want ideally, but would be much less complex than the language that could do 100%, would be my preferred choice.

Conclusion

So there you have it. I need something I can use on Mac OS X, Linux and across the Internet to make graphical (and occasionally command line, but I figure if it can do the former, it can do the latter,) apps., is hopefully not incredibly difficult to learn, and has free, quality development environments/compilers I can use. I can't exactly spend $300 on one just to try out a language. A good intro book to guide me with the language would be great also. Please enlighten me with your feedback!
( Last edited by Gamoe; Oct 14, 2007 at 10:55 PM. Reason: typo)
     
mduell
Posting Junkie
Join Date: Oct 2005
Location: Houston, TX
Status: Offline
Reply With Quote
Oct 7, 2007, 08:23 AM
 
How about Tcl? You can use Tcl/Tk to make cross-platform GUIs (and just Tcl for commandline/web stuff).

Or perhaps it would be wise to learn more than one language for the variety of projects you'd like to complete. Everything looks like a nail when all you have is a hammer.
     
SirCastor
Professional Poster
Join Date: Jan 2001
Location: Salt Lake City, UT USA
Status: Offline
Reply With Quote
Oct 7, 2007, 07:18 PM
 
I'm a professional PHP programmer. It's excellent for web stuff, but I wouldn't bother trying to write desktop apps with it. Primarily because it's focus has never been and won't ever be a desktop environment, even though it's possible. PHP is written in C, and there are many many many languages better suited than PHP for what you're shooting for. Moreso, you'll be hardpressed to find a large support group for something like this, and that's what beginning programmers need, support.

Have you considered Java? I know that a lot of people think that Java is past it's prime, but it's pretty robust, and compiles on everything under the sun. It's syntax is similar to C, it's freely available and it's got a lot of support.

The main differences you're going to face in languages is some simple syntax and then function names. (OOP is a huge part as well, but that's not language specific) Learn something like C and you've already got C++, Objective-C, Java, and PHP syntax down cold.

My other big recommendation (and I just learned this myself) is to learn to flowchart. It's not necessary no, but flowcharting takes the solution out of the language. That is to say that when you solve a problem with a flow chart, you can write it in anything (usually quite quickly), you just need some syntax.

Anyway, I'm rambling, best of luck.
2008 iMac 3.06 Ghz, 2GB Memory, GeForce 8800, 500GB HD, SuperDrive
8gb iPhone on Tmobile
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Oct 7, 2007, 07:22 PM
 
Objective-C and C++ are not very similar except in that both are more or less supersets of C. Objective-C is a dynamic object-oriented language, more similar to Smalltalk and Ruby than it is to C++, and it's strongly based around the Cocoa framework. Objective-C is not a good choice for cross-platform code (because there are not currently any good implementations of Cocoa outside the Mac), though it is a great choice for Mac-native programs and Mac-native layers in cross-platform programs.

PHP is a good Web programming language, but it's useless on the desktop.

To paint with a very broad brush, Python is Ruby. They're both good languages, both relatively new, both work well both as desktop languages and on the Web. Python is faster, but IMO less powerful as a language. I'd say they're the languages that best fit your requirements, but they are somewhat newer than I guess you'd prefer.

But like mduell said, there's no good reason to learn only one language. They have different strengths and weaknesses. The more you know, the better the odds that you'll know one whose strengths fit the program you need to write.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Oct 7, 2007, 07:39 PM
 
Originally Posted by SirCastor View Post
The main differences you're going to face in languages is some simple syntax and then function names. (OOP is a huge part as well, but that's not language specific) Learn something like C and you've already got C++, Objective-C, Java, and PHP syntax down cold.
I don't think that's really correct. Syntax is one difference, but writing valid code is different from writing good or idiomatic code. Like the saying goes, you can write Fortran in any language. For a real-world example, I've noticed that C++ programmers' preconceived notions from their old language will often actually make it harder for them to figure out Objective-C.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 06:40 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,