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

Cromulent

macrumors 604
Oct 2, 2006
6,810
1,100
The Land of Hope and Glory
Tygernoot is correct in my opinion.
Guys, the guy never programed before, so you CAN'T say "Learn C or C++, that's what I use!". That's nutz, and a sure path to failure. It will be YEARS before any good comes of it. I was in the same boat long not too long ago, and what came to the rescue? RealBasic. EASY to learn, all the concepts are there, excellent tutorials, lots of samples, cross platform, and you are rewarded with a finished product much sooner, so it's good for the soul. Master the basics there and you have a good foundation for the future. There is also Revolution. But C? No way. You are condemning him to hell.

I think that is more an indication of the times rather than anything else.

My Dad learnt to program using machine language because that was the only programming language available. He then moved on to assembler and then C. Personally I think programmers have just got increasingly lazy especially when I hear what they were doing with computers with a minute amount of memory or a punch card for inputting programs back in the 70s. I'm positive that the hardware we have in computers is capable of so much more than it actually delivers. This is partly the reason for my burning desire to learn to program effectively.
 

toddburch

macrumors 6502a
Dec 4, 2006
748
0
Katy, Texas
I have never programmed anything in my life. I just xcode and wanted to learn how to use it. which language should i start and how do I learn. I want to make applications for mac os x ppc and intel. I also want to develop windows applications. How long does it take to make a simple application. tell me anything else I might want to know.

Not even a VCR? An alarm clock? Taught a dog a trick or command? Surely you have programmed before.

The answer most likely does not lie in a particular programming language. Sure, there are lots of programming languages to learn, and lots of platforms they can (or can not) run on.

There are programming concepts to learn, which is way beyond the programming syntax of a language. Memory management, file systems, I/O models, parsing, structures of all kinds, networking, multi-tasking, serialization techniques and on and on.

There is procedural programming, structured programming, event drive programming and object oriented programming, with some overlap betwixt them all.

My suggestion would be to start with a cross-platform scripting language to start with. It frees you from a lot of the mechanics of programming and lets you concentrate on your end result.

Todd
 

sushi

Moderator emeritus
Jul 19, 2002
15,639
3
キャンプスワ&#
The answer most likely does not lie in a particular programming language. Sure, there are lots of programming languages to learn, and lots of platforms they can (or can not) run on.

There are programming concepts to learn, which is way beyond the programming syntax of a language. Memory management, file systems, I/O models, parsing, structures of all kinds, networking, multi-tasking, serialization techniques and on and on.

There is procedural programming, structured programming, event drive programming and object oriented programming, with some overlap betwixt them all.

My suggestion would be to start with a cross-platform scripting language to start with. It frees you from a lot of the mechanics of programming and lets you concentrate on your end result.
Well said! There is so much to learn besides coding.

Regarding which is the best language to learn. Just think how fast programs would be today if they were developed in assembly language instead of bloated object oriented apps. Of course I am sure that I will hear some flak from the OOP folks. ;) And, I wouldn't want to do all my programming in assembly language for sure. But it is still the best for creating tight compact fast executable code.

I think that the key today, is to become well rounded in languages. And then use the one that allows you to solve your problem in the most effective manner. That is why we still see FORTRAN, Basic, COBOL, and other legacy type languages still being used.
 

Jason S.

macrumors 6502a
Jul 23, 2007
504
1
Pennsylvania
I'm also interested in programming and have no idea where to start. I might want to be a programmer for a living, but I'm not sure. I'm still in high school and haven't decided what road I'd like to take yet -- graphic design and video game development are things I've been considering.

I've always wanted to be able to write applications. The most complex language I know is PHP. I taught myself the basics when I was about 12 by reading tutorials around the 'net, but I always felt that some form of C would be too difficult to learn on my own. I know a little bit about OOP, but not really how to use it efficiently. (I'm 16 now by the way.)

Since I already know a good bit of PHP, where should I start?

And also, I know getting a head start now while I'm young can really help later on. But most people who program for a living -- like video game developers, for example -- do a lot of them start learning the basics in college or do most go in with an understanding already?

I don't want to sound like I'm hijacking this thread; I don't want it to seem that way. And I hope any responses to my post can help the original poster, too.
 

sushi

Moderator emeritus
Jul 19, 2002
15,639
3
キャンプスワ&#
Just think of how far behind technology would be if that were the case.
Are you saying that you cannot do OOP in assembly? Of course you can, it just takes a bit of time. ;)

Of course OOP can make the process of creating applications easier and much faster. No doubt about that.

Regarding assembly language, and cool programming techniques, look at what used to be done. The SR-71 had an Astro-inertial Navigation System (ANS) that it used for navigation. This system stored information for 61 navigational stars.

Here is some of what it did:
--------------------------------------------------------
By comparing the position of the stars to their known
location, and with the exact time of day, the ANS could then
compute the aircraft's precise position. A normal gyro
compass alignment of the ANS required 36 minutes of warmup
time and provided the SR-71 with great-circle navigational
accuracy of 1,885 feet (0.3 nautical mile) for up to ten
hours of flying time. It still amazes me even today that
astronomers have charted our solar system so accurately that
it allows the ANS to calculate the SR-71's position so
precisely. Things may change here on Earth from century to
century, but the same stars guided both Christopher Columbus
and Habus.

The heart of the ANS was a large, self-contained unit-about
half the size of a large refrigerator-called the Guidance
Group. A computer inside the Guidance Group computed
auto-navigation, guidance and avionics control, and
maintained a continuously updated account of navigational
status and coordinate values. The computer also stored
instrument and mathematical coefficients, predetermined
data references that defined the stars, and the mission
flight plan. For continuous accuracy the computer initiated
and evaluated self-tests periodically throughout the flight.
Software corrections to the star data were provided for the
supersonic shock wave over the star tracker window that
refracts the star light and for pressure and temperature
gradients acting on the window causing optical lens effects.
--------------------------------------------------------

If memory serves, this was all done with 32K of RAM memory. That's 32K for the OS, application, 61 navigational stars, and other reference values.

Pretty darn cool!
 

angelneo

macrumors 68000
Jun 13, 2004
1,541
0
afk
Regarding which is the best language to learn. Just think how fast programs would be today if they were developed in assembly language instead of bloated object oriented apps. Of course I am sure that I will hear some flak from the OOP folks. ;) And, I wouldn't want to do all my programming in assembly language for sure. But it is still the best for creating tight compact fast executable code.
Sure, assembly will create a very fast and compact program but just how long do you need to build it compare to another high level language?
 

titaniumdecoy

macrumors member
Oct 13, 2005
86
0
Are you saying that you cannot do OOP in assembly? Of course you can, it just takes a bit of time. ;)

I would argue that you cannot. According to Wikipedia, OOP is "based on several techniques, including encapsulation, modularity, polymorphism, and inheritance," none of which are possible in assembly since there is no such thing as a class (or object, for that matter) in assembly.
 

demallien

macrumors regular
Oct 13, 2005
137
0
I'm also interested in programming and have no idea where to start. I might want to be a programmer for a living, but I'm not sure. I'm still in high school and haven't decided what road I'd like to take yet -- graphic design and video game development are things I've been considering.

I've always wanted to be able to write applications. The most complex language I know is PHP. I taught myself the basics when I was about 12 by reading tutorials around the 'net, but I always felt that some form of C would be too difficult to learn on my own. I know a little bit about OOP, but not really how to use it efficiently. (I'm 16 now by the way.)

Since I already know a good bit of PHP, where should I start?

And also, I know getting a head start now while I'm young can really help later on. But most people who program for a living -- like video game developers, for example -- do a lot of them start learning the basics in college or do most go in with an understanding already?

I don't want to sound like I'm hijacking this thread; I don't want it to seem that way. And I hope any responses to my post can help the original poster, too.

Personally, I'm a big Ruby fan. Ruby is one of the big three scripting languages (Perl, Python, Ruby). On the Mac you can also write desktop apps using Ruby thanks to RubyCocoa and XCode 3. For web development, Ruby has Ruby on Rails, quite possibly the easiest way around at the moment to create a web app. As you are already familiar with PHP, this might not be a bad place to start - write yourself a web app using Rails that does the same thing as your PHP code. I would recommend "Agile Web Development with Rails", as a great book to get you started on this task. From there you can take your newly gained Ruby knowledge and branch out into other interesting areas.
 

demallien

macrumors regular
Oct 13, 2005
137
0
I would argue that you cannot. According to Wikipedia, OOP is "based on several techniques, including encapsulation, modularity, polymorphism, and inheritance," none of which are possible in assembly since there is no such thing as a class (or object, for that matter) in assembly.

And you would be wrong. I routinely write OO code in C. It's a little harder than in C++ - you have to write your own runtime to handle things like polymorphism/inheritence, the syntax is less elegant, and of course some principles of OOP, such as encapsulation, can be ignored by ill-discplined programmers, but it's not to say that you can't do OOP in C.

All of the above applies equally well to assembly, with the important note that mucking around with function pointers in C is a right-royal pain in the arse compared to doing the same in assembly, so assembly is actually more elegant for OOP.

Most of the time, when you are a competent assembly-language programmer, writing a function in assembly takes only marginally more time than doing the same thing in a higher level language. Where you do take a hit is in debugging. Because there are more statements, you are more likely to make dumb mistakes, like taking the value stored at an address, rather than the address itself, because of a notation error. This in turn introduces more bugs, that take more time to debug...

But it is nevertheless well and truly possibly to write complex apps in assembly.
 

sushi

Moderator emeritus
Jul 19, 2002
15,639
3
キャンプスワ&#
Sure, assembly will create a very fast and compact program but just how long do you need to build it compare to another high level language?
It all depends on what you are trying to do, and what hardware you have available to do it on.

But generally, I would agree that doing OOP in assembly would take longer than a higher level language. Of course, debugging is a whole different story. That is where assembly can get real tricky at times.

I would argue that you cannot. According to Wikipedia, OOP is "based on several techniques, including encapsulation, modularity, polymorphism, and inheritance," none of which are possible in assembly since there is no such thing as a class (or object, for that matter) in assembly.
Ever wonder what your OOP compiler that you use compiles the program into? Yep, good old assembly language. So the compiler can do it, or you can do it yourself.

And you would be wrong. I routinely write OO code in C. It's a little harder than in C++ - you have to write your own runtime to handle things like polymorphism/inheritence, the syntax is less elegant, and of course some principles of OOP, such as encapsulation, can be ignored by ill-discplined programmers, but it's not to say that you can't do OOP in C.

All of the above applies equally well to assembly, with the important note that mucking around with function pointers in C is a right-royal pain in the arse compared to doing the same in assembly, so assembly is actually more elegant for OOP.

Most of the time, when you are a competent assembly-language programmer, writing a function in assembly takes only marginally more time than doing the same thing in a higher level language. Where you do take a hit is in debugging. Because there are more statements, you are more likely to make dumb mistakes, like taking the value stored at an address, rather than the address itself, because of a notation error. This in turn introduces more bugs, that take more time to debug...

But it is nevertheless well and truly possibly to write complex apps in assembly.
Well put! :)
 

craig1410

macrumors 65816
Mar 22, 2007
1,130
911
Scotland
Just think of how far behind technology would be if that were the case.

Yeah and just think how many projects would never actually get completed...
There is now way a typical modern application would get completed if everything was hand cut assembly code.

Try building a house without any tools...

Craig.
 

craig1410

macrumors 65816
Mar 22, 2007
1,130
911
Scotland
Personally, I'm a big Ruby fan. Ruby is one of the big three scripting languages (Perl, Python, Ruby). On the Mac you can also write desktop apps using Ruby thanks to RubyCocoa and XCode 3. For web development, Ruby has Ruby on Rails, quite possibly the easiest way around at the moment to create a web app. As you are already familiar with PHP, this might not be a bad place to start - write yourself a web app using Rails that does the same thing as your PHP code. I would recommend "Agile Web Development with Rails", as a great book to get you started on this task. From there you can take your newly gained Ruby knowledge and branch out into other interesting areas.

I'd second that - I learned programming using a combination of Basic, Assembly and Comal but that was 25+ years ago (scary!) I've been messing about with Ruby and Ruby on Rails lately and it actually brings fun back to programming along with loads of productivity. I would say that Ruby is much more relevant than something like C or C++ for someone who has zero background in programming. Start with some Ruby scripting and move on from there to working with simple classes and then maybe go for a "Hello World!" GUI app using RubyCocoa.

Good luck!
Craig.
 

sushi

Moderator emeritus
Jul 19, 2002
15,639
3
キャンプスワ&#
Where in my reply did I say that? It has nothing to do with OOP, but rather the slow development pace of ASM. If everything was done in ASM, we'd be stuck in 1955.
I understand your point. But your comment is being a little bit dramatic. Programs are written everyday that are created with Assembly.

OOP has it's place. Procedural has it's place. Assembly has it's place. And so on.

Anyhow, we are getting off topic from the OPs desire. Getting back on topic, there have been some good recommendations in the thread. I would add, that when beginning, it is good to see results quickly to keep yourself motivated. Languages such as Basic can provide a wonderful start.
 

Monkaaay

macrumors 6502
Jun 19, 2006
258
0
Richmond, VA
Programs are written everyday that are created with Assembly.

Yeah, in CS101. Do you really think something like Windows, OS X, Linux, Oracle, Exchange, Active Directory, Visual Studio, etc, would be built in ASM? You think it sucks to have Vista take 6 years to develop, just consider what it would have been had it been developed in ASM. You say I'm being dramatic, I say I'm just being honest.
 

Lyle

macrumors 68000
Jun 11, 2003
1,874
1
Madison, Alabama
If we haven't already scared the OP away: my first recommendation (as others have mentioned) would be to take an introductory programming class. As long as it was truly an introduction, I don't think it would matter all that much which language they were using, since you'd be focusing on fundamentals that are common to all programming languages anyways.

If taking a class isn't an option, I'd recommend a book like Chris Pine's Learn to Program, or some other book that assumes no previous programming experience.

While I absolutely agree with robbieduncan that every working programmer should know C, there's no way I'd expect someone to start out with that as their first language. Like some of the more recent posters, I'd recommend started out with a cross-platform, interpreted language like Ruby. If you're running Windows or have access to a Windows machine, I'd recommend Hackety Hack as well.
 

jhande

macrumors 6502
Sep 20, 2006
305
0
Denmark
I'm not suggesting that C isn't used for being "productive". There are numerous examples otherwise; operating systems, compilers, database systems, etc. Notice the computer science background of each. When it comes to the business world, C puts you 20 years behind everyone else.

I completely agree, given the 'business world' criteria, he/she should definitely start, and stay, with COBOL.......:rolleyes: Having just finished a project refactoring code for a financial institution, the hourlies have more than paid for 3 months vacation. Sweet.
 

jhande

macrumors 6502
Sep 20, 2006
305
0
Denmark
I would suggest that you Google "how to think like a computer scientist". This book is not only excellent in giving you the basics of programming, but also a viable methodology leading up to the actual coding.

Best of all, the book is in the public domain (AFAIK). Even better, it has been rewritten several times, with focus on many of the languages the other respondents have listed above. Thus, you could read HTTLACS for Python, for C, for Java, for C++ etc., and then compare which of them 'feel' right for you.

Best of luck.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.