PDA

View Full Version : Programming as a Hobby




marco114
Dec 27, 2006, 07:21 AM
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 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
Dec 27, 2006, 09:47 AM
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
Dec 28, 2006, 01:08 AM
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

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

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



//C++
#include <iostream>

using namespace std;

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



//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.

tominated
Dec 28, 2006, 03:10 AM
learn objective-c. if you know even the basics you can sort of understand it. Apps in xcode can end up being really good.

blaster_boy
Dec 28, 2006, 08:53 AM
It all depends how much time you can allocate to your programming. I've decided for myself on a scripting language like python (http://www.python.org) :

- 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 !

Wes
Dec 28, 2006, 09:16 AM
That program that you typed in basic, here's what it looks like in C, C++, and Objective-C

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

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



Surely you mean:


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

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


And similarly for the others ;).

bronxbomber92
Dec 28, 2006, 09:26 AM
Surely you mean:


/* 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:/* C */
#include <stdio.h>

int main()
{
while (1) {
printf("Hello world!");
}
return 0;
Or, even better
/* 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 ;)

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...

AlmostThere
Dec 28, 2006, 10:11 AM
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?

Cromulent
Dec 28, 2006, 10:22 AM
I'm pretty sure he doesn't ;)
That will print it forever, going down a line each time.

The original basic code was an endless loop as well. I guess if you were translating it directly he would indeed mean that.

Wes
Dec 28, 2006, 12:54 PM
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
Dec 28, 2006, 01:46 PM
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 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!

mac-convert
Dec 28, 2006, 01:54 PM
And here is Hello, World (http://www2.latech.edu/~acm/HelloWorld.shtml) in about any programming language that you care to pick!

blaster_boy
Dec 28, 2006, 04:53 PM
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
Dec 28, 2006, 05:01 PM
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
Dec 28, 2006, 05:22 PM
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 otherUm, 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

slooksterPSV
Dec 28, 2006, 05:46 PM
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

Personal opinion, yes I can, absolute, no.

bmb012
Dec 28, 2006, 07:12 PM
I like Flash. Here's your little program in Actionscript.

trace("Hello World")

:p

slooksterPSV
Dec 28, 2006, 07:27 PM
I like Flash. Here's your little program in Actionscript.

trace("Hello World")

:p

Or batch:

echo "Hello World"

bronxbomber92
Dec 28, 2006, 09:02 PM
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
Dec 28, 2006, 09:55 PM
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
Dec 28, 2006, 11:06 PM
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
Dec 28, 2006, 11:37 PM
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
Dec 28, 2006, 11:40 PM
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
Dec 29, 2006, 07:57 AM
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