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

marco114

macrumors 6502
Original poster
Jul 17, 2001
440
458
USA
I want to learn a little programming and I'm not sure where to start. I'm 36, and I've been into computers all my life. I do a lot of web programming already in Lasso for about 8 years (see http://www.omnipilot.com) w/ MySQL databases, e-commerce, etc.

I have never programmed applications. I'd really like to start building some applications that interact with MySQL. I've heard that Real Basic is good but others have told me XCode is also good (and free). Real Basic seems like it has the advantage of compiling in multiple OS (Windows, Mac Linux) which seems attractive, but not totally 100% necessary.

Can anyone shed some light on where to start and if there are any books I should get. I've programmed in BASIC back in the Apple // days, but that's been a LONG TIME ago!

10 PRINT "HELLO!"
20 GOTO 10

RUN


:) Marc
 

Eraserhead

macrumors G4
Nov 3, 2005
10,434
12,250
UK
well for cross platform look at Java, otherwise Cocoa is very very nice and makes making a GUI app very easy.

A good book for Cocoa is Cocoa: Programming for OS X by Aaron Hillegass.
 

slooksterPSV

macrumors 68040
Apr 17, 2004
3,544
306
Nowheresville
You'll want to learn Objective-C as well - Objective-C Programming by Steve Kochan is an awesome book.

That program that you typed in basic, here's what it looks like in C, C++, and Objective-C
Code:
/* C */
#include <stdio.h>

int main()
{
 printf("Hello world!");
 return 0;
}

Code:
//C++
#include <iostream>

using namespace std;

int main()
{
 cout << "Hello World!";
 return 0;
}

Code:
//Objective-C
#import <Foundation/Foundation.h>

int main()
{
 NSLog(@"Hello World");
 return 0;
}

Learn Objective-C it's easy, way easy. If you need to program for both Windows and Mac OS X - learn C++, Objective-C, and Cocoa.
 

blaster_boy

macrumors 6502
Jan 31, 2004
282
4
Belgium
Depends

It all depends how much time you can allocate to your programming. I've decided for myself on a scripting language like python :

- human readable even after 6 months or longer of not having programmed
- lots of functions available that touch on the web
- gentle introduction curve

It's also cross-platform !
 

4409723

Suspended
Jun 22, 2001
2,221
0
That program that you typed in basic, here's what it looks like in C, C++, and Objective-C
Code:
/* C */
#include <stdio.h>

int main()
{
 printf("Hello world!");
 return 0;
}

Surely you mean:

Code:
/* C */
#include <stdio.h>

int main()
{
    while (1==1) {
        printf("Hello world!");
   }
    return 0;
}

And similarly for the others ;).
 

bronxbomber92

macrumors regular
Nov 23, 2006
109
0
Surely you mean:

Code:
/* C */
#include <stdio.h>

int main()
{
    while (1==1) {
        printf("Hello world!");
   }
    return 0;
}

And similarly for the others ;).

I'm pretty sure he doesn't ;)
That will print it forever, going down a line each time. In command line (terminal) printing it once would be fine, as terminal won't close until it you tell it to. And even if you wanted to print it forever, it would be better to do:
Code:
/* C */
#include <stdio.h>

int main()
{
    while (1) {
        printf("Hello world!");
   }
    return 0;
Or, even better
Code:
/* C */
#include <stdio.h>

int main()
{
    for(;;) {
        printf("Hello world!");
   }
    return 0;
}
But most modern compiler will optimize the while(1) {}, though for(;;) {} is better programming practice ;)

blaster_boy said:
It all depends how much time you can allocate to your programming. I've decided for myself on a scripting language like python :

- human readable even after 6 months or longer of not having programmed
- lots of functions available that touch on the web
- gentle introduction curve

It's also cross-platform !
I just picked up python yesterday, and I absolutely love it! Slices seem like an amazing feature, and the built in function foreach object (EVERYTHING in Python is an object) leaves a great amount of power, and ease.
Acourse, it will never be as powerful as C, C++, or Objective-C. But it may be as powerful as Java since they are both compiled into bytecode... But Java may have a leg up, not sure...
 
I would also second Python as the best option, given no further information to work on. The thread header says hobby and I think it is hard to justify suggesting something like C to someone who very likely has limited hours in which to work. Python will have a faster and shorter learning curve and simply be more rewarding and fun.

For example:

I just picked up python yesterday, and I absolutely love it! Slices seem like an amazing feature, and the built in function foreach object (EVERYTHING in Python is an object) leaves a great amount of power, and ease.
Acourse, it will never be as powerful as C, C++, or Objective-C. But it may be as powerful as Java since they are both compiled into bytecode... But Java may have a leg up, not sure...

I would actually say that something like Python is much MORE powerful than C / C++ as much more can be achieved for significantly less effort (although this is always going to vary with your interpretation of powerful, of course)

Sure, there are things that cannot be implemented in Python, but these form a small subset of most programmes / functionality and are often not the subject of hobbyist programming (or perhaps better phrased as not the domain of a hobbyist programmer asking where to start learning programming).

In the case of MySQL that the OP asks about, this can be done interactively and in only three or four lines of code and something a technically competent beginner could likely achieve in their first few days. How long is the same thing going to take for someone starting from scratch with C?
 

4409723

Suspended
Jun 22, 2001
2,221
0
I'm pretty sure he doesn't ;)
That will print it forever, going down a line each time.

I don't see a newline character in there, don't believe it's going to go down a line at a time, and the original code did repeat forever too, if we're getting picky. ;)
 

WebMongol

macrumors member
Sep 19, 2004
50
0
Bay Area, CA
I want to learn a little programming and I'm not sure where to start. I'm 36, and I've been into computers all my life. I do a lot of web programming already in Lasso for about 8 years (see http://www.omnipilot.com) w/ MySQL databases, e-commerce, etc.
[skip]
:) Marc

If you want to develop web application with MySQL - PHP is a good starting point. Another way is Rails - web framework based on Ruby programming language.
In case you are looking for good general purpose language - both Python or Ruby are great. With Python you can use cgi module for simple web applications and Django web framework for complex web apps.
PHP, Python and Ruby have implementations for all major platforms.
Objective-C with Cocoa is your ticket for MacOSX application development. Do not even consider C/C++/ObjC/Java for lightweight web development.
There are tons of books that cover basics and web development for PHP/Python/Ruby - check corresponding web sites and amazon.
Good luck!
 

blaster_boy

macrumors 6502
Jan 31, 2004
282
4
Belgium
I just picked up python yesterday, and I absolutely love it! Slices seem like an amazing feature, and the built in function foreach object (EVERYTHING in Python is an object) leaves a great amount of power, and ease.
Acourse, it will never be as powerful as C, C++, or Objective-C. But it may be as powerful as Java since they are both compiled into bytecode... But Java may have a leg up, not sure...

I agree with you - it isn't for everything, especially if you need speed. But it's fine for those of us who only program from time to time, and if you don't know any C variants or Java it's a very good language in which to get things done with a minimum of fuss.

I'm always surprised at how short my programs are and the result I can get. Often I have more comments in there than actual code (but maybe that's me) !:D
 

slooksterPSV

macrumors 68040
Apr 17, 2004
3,544
306
Nowheresville
I'd say powerful programming is programming where you have finite control like with C, C++, Objective-C, Java, etc.
I would rate them, in order of power, in this order:
C
Java
C++
Objective-C

C being the most powerful language, and Objective-C being 4 most powerful language. That's just how I interpret it.

EDIT: Uh lets change that, sinces objects make a programming language more powerful how about:
1 - Java - versatile, has tons of features, simple, but still has finite control, compatible with tons of OSes
3 - C++ - versatile, has tons of features, easy to use, but can be confusing, has finite control, compatible with lots of OSes
2 - Objective-C - Very very easy to use, very secure, when it comes to classes, compiles even with programming errors, step it up with C++ features and sdks, etc.
4 - C - do I need to say why? most hackers and virus programmers use C so yeah.

there we go, C is the 4th most powerful, and java is the most powerful.

EDIT: Said why one is better than the other
 

bronxbomber92

macrumors regular
Nov 23, 2006
109
0
I'd say powerful programming is programming where you have finite control like with C, C++, Objective-C, Java, etc.
I would rate them, in order of power, in this order:
C
Java
C++
Objective-C

C being the most powerful language, and Objective-C being 4 most powerful language. That's just how I interpret it.

EDIT: Uh lets change that, sinces objects make a programming language more powerful how about:
1 - Java - versatile, has tons of features, simple, but still has finite control, compatible with tons of OSes
3 - C++ - versatile, has tons of features, easy to use, but can be confusing, has finite control, compatible with lots of OSes
2 - Objective-C - Very very easy to use, very secure, when it comes to classes, compiles even with programming errors, step it up with C++ features and sdks, etc.
4 - C - do I need to say why? most hackers and virus programmers use C so yeah.

there we go, C is the 4th most powerful, and java is the most powerful.

EDIT: Said why one is better than the other
Um, no. You can't just list them a certain way just because you feel like it.

This is how it is (from my interpretation over my learnings)

1.) C++
2.) Objective-C
3.) C
4.) Java
 

bronxbomber92

macrumors regular
Nov 23, 2006
109
0
Personal opinion, yes I can, absolute, no.
Um, no you can't. I'm not tryin to argue, but the power of a language doesn't change by your opinion. Your preference can change all it want. But C++ is the most powerful. It is the most raw, so arguably is the easiest to get into trouble with :)p). Java is the least because its translated into Bytecode, so it HAS to be slower, and Objective-C is faster then C because it IS C but with MORE features and strong points.

Sorry, but because you feel better or think one is stronger then the other from day does not make it true. Please don't post misleading information.
 

slooksterPSV

macrumors 68040
Apr 17, 2004
3,544
306
Nowheresville
Um, no you can't. I'm not tryin to argue, but the power of a language doesn't change by your opinion. Your preference can change all it want. But C++ is the most powerful. It is the most raw, so arguably is the easiest to get into trouble with :)p). Java is the least because its translated into Bytecode, so it HAS to be slower, and Objective-C is faster then C because it IS C but with MORE features and strong points.

Sorry, but because you feel better or think one is stronger then the other from day does not make it true. Please don't post misleading information.

My opinion is my opinion, and facts are facts. My opinion stands, but the truth may be different. I can have my own opinions I'm entitled to them so there =P. hehe
 

HiRez

macrumors 603
Jan 6, 2004
6,265
2,630
Western US
I think you can easily argue that "power" is subjective. Does it mean the fastest? The ability to do the most low-level tasks? Ability to do things using the least amount of code? The most features or largest API? The power to get more done in a given amount of time? You can justify just about anything you want.
 

bronxbomber92

macrumors regular
Nov 23, 2006
109
0
I think you can easily argue that "power" is subjective. Does it mean the fastest? The ability to do the most low-level tasks? Ability to do things using the least amount of code? The most features or largest API? The power to get more done in a given amount of time? You can justify just about anything you want.
3/5 of those do describe C++ (out of the above fore mentioned Languages)
So I think it's safe to say C++ is the most powerful :p
 

slooksterPSV

macrumors 68040
Apr 17, 2004
3,544
306
Nowheresville
I think you can easily argue that "power" is subjective. Does it mean the fastest? The ability to do the most low-level tasks? Ability to do things using the least amount of code? The most features or largest API? The power to get more done in a given amount of time? You can justify just about anything you want.

I change my vote:
Objective-C is the best in my opinion, cause it gives me the simplicity and power I need to make my own programs. There I said it =P
 

lazydog

macrumors 6502a
Sep 3, 2005
709
6
Cramlington, UK
Hi Marc,

Out of C, C++, Objective C and RealBasic, I think RealBasic would be the quickest to learn and to be productive in. It is very easy to use and you can be creating applications with user interfaces in next to no time. It's definitely worth spending a couple of hours playing around with it to see if it's what you want.

b e n
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.