Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
This threads seems to have gone slightly more web orientated than I think the OP really intended. His son sounds like he is more interested in desktop and mobile development and for that there is no getting away from the fact that C (and Objective-C if you are happy to limit yourself somewhat) is the way to go.

The Android mobile phone platform uses Java but if you know C then learning Java is pretty straight forward, the same is true for Objective-C, C++, C#, PHP, JavaScript and a host of other languages. In short if your son is looking to be a developer rather than a Java programmer (an important distinction to make) it makes sense to start with C. If he is really adventerous then learning a language like Scheme using the book entitled "Structure and Interpretation of Computer Programs" would stand him in excellent stead for a CS degree (heck, that book is one he may actually study on his course). You can find the book for free on the MIT website (yes, it is legal).
 
Can a person learn HTML, CSS, SQL and PHP, and graduate into learning one of the languages mentioned, without getting bad habits? Is the HTML route a completely different course of learning?

He definitely wants to learn programming. But can he do programming using the skills he picked up learning HTML, etc.? Or are the 2 skill sets not a good match. Should it be one or the other, or is both good to know? Trust me, I understand the importance of being on the right track from the start. Just wondering if he can pick up one of the languages after he finishes the book he's reading, O'Reilly's Head First with HTML, XHTML and CSS. He's more than halfway done, and he's proud of his progress. :) I just don't want him to pick up a language book and be confused because his foundation was set with HTML.
 
I think in time he would like to be a programmer, not a Java programmer, a C programmer, and so on. It is good to know many languages, each with a different approach to a problem.

Oh, by the way. I recommend Teach Yourself Programming in Three Days :) :p :D

HTML and CSS ARE NOT programming languages. So this will by no means be the foundation. Nor are JavaScript or PHP. They're scripting (client-side and server-side) languages. But both of them is derived from C/C++, so after getting his foot wet with either of them, he will be able to digest C-based languages (easily). I, for example, have learnt JavaScript, and then moved on to C++ (well... I had some previous, although minor, background in it). The basic language features I learnt from JS proved to be a great help while following Bruce Eckel's Thinking in C++.

Also, before moving on to a true programming language, I suggest getting Bruce Eckel and Chuck Allison's Thinking in C: Foundations for C++ and Java. It's an awesome seminar, and is available for free from MindView's web site (Bruce Eckel's web site).
 
I guess there's two ways to look at it. Picking up HTML is not useless, it is a worthwhile skill to have. If he has an interest in it, certainly don't discourage him from finishing the book. However, it is not teaching logic, problem solving, algorithms, data structures, etc. that are key to programming. As such it's more layout and presentation than actually programming. At a certain point it can be the presentation layer in a complex web application, but it's the product of programming in that case, it doesn't actually implement any of the logic.

As for PHP... i don't think it will do irreparable damage, but I would personally opt for something a little more rigid/concrete to start with. This doesn't necessarily mean something strongly typed, but... i'm just biased strongly against PHP. It has its uses, but I don't think it's as a learning language.

If he's already dealing with HTML and spending a lot of time in a browser, I think JavaScript would be a good next step since it would be building on his skills. I feel like it is a "real" programming language, not just a scripting language. If he doesn't mind "putting aside" what he's learned already, then I'd move on to something he can work on outside the browser. Which isn't that important, I always lean toward C, but I care a lot about knowing how and why things work.

-Lee
 
If you keep on using the Head First series (which, as a side note, has started out as HEAD FIRST JAVA, so if you ever want to start learning Java and enjoy the HF style, this one is worth looking at. in fact, it's the only HF book to have a second edition up to this date, and its original authors have started a parallel web site related only to Java and the HF java book), here's something I found out:

HF JavaScript is the first HF book to be written by... its author (I can't recall it, I'm too bored to check, and the name is not important at all), so it takes a formal, but different, approach to teaching you the language. What I mean is that he starts from a concept (say loops) and builds the chapter around it, the HF way.

Contrary to HF PHP, which is his second book, in which he starts from the idea of "let's show him how to connect to a database and request information" and teaches you conditional statements as a "oh, by the way: this is the IF-ELSE structure. you will need it on the next page".

If you go for off-the-browser programming, I'd suggest starting out with Python. Also, check this MIT page. It provides you a great plan to start.
 
IMO, if he's going to be a senior next year, then skip web technologies and plunge directly into C. That will give him a nice head start for college.
 
If your son is learning HTML then I would say JavaScript would be a natural and excellent next step. JavaScript will build upon, strengthen and extend what he has already learnt. HTML, CSS and JavaScript are a powerful combination and form a core skill which many professionals make a living from. JavaScript is a programming language and has the benefits of being very easy and quick to learn. JavaScript and DOM make a very powerful combination (JavaScript can manipulate the data structure of a browser window directly to display pretty much whatever you want). I have to admit that I really like JavaScript!

It's only going to take your son a few hours to go from html to understanding the basics of JavaScript - time well spent in my opinion, even if he decides to move on to C/Objective-C, SQL/PHP etc.

b e n
 
If your son is learning HTML then I would say JavaScript would be a natural and excellent next step. JavaScript will build upon, strengthen and extend what he has already learnt. HTML, CSS and JavaScript are a powerful combination and form a core skill which many professionals make a living from. JavaScript is a programming language and has the benefits of being very easy and quick to learn. JavaScript and DOM make a very powerful combination (JavaScript can manipulate the data structure of a browser window directly to display pretty much whatever you want). I have to admit that I really like JavaScript!

It's only going to take your son a few hours to go from html to understanding the basics of JavaScript - time well spent in my opinion, even if he decides to move on to C/Objective-C, SQL/PHP etc.

b e n

Thanks. Will it be hard for him to go from JavaScript to Java, Python, C/Objective-C? Or will he be hampered?

I guess there's two ways to look at it. Picking up HTML is not useless, it is a worthwhile skill to have. If he has an interest in it, certainly don't discourage him from finishing the book. However, it is not teaching logic, problem solving, algorithms, data structures, etc. that are key to programming. As such it's more layout and presentation than actually programming. At a certain point it can be the presentation layer in a complex web application, but it's the product of programming in that case, it doesn't actually implement any of the logic.

As for PHP... i don't think it will do irreparable damage, but I would personally opt for something a little more rigid/concrete to start with. This doesn't necessarily mean something strongly typed, but... i'm just biased strongly against PHP. It has its uses, but I don't think it's as a learning language.

If he's already dealing with HTML and spending a lot of time in a browser, I think JavaScript would be a good next step since it would be building on his skills. I feel like it is a "real" programming language, not just a scripting language. If he doesn't mind "putting aside" what he's learned already, then I'd move on to something he can work on outside the browser. Which isn't that important, I always lean toward C, but I care a lot about knowing how and why things work.

-Lee

Thank you Lee. Right now he's open to just about anything. He'll be finished with that book by this weekend. I just want to keep the momentum going and have something ready for him to do when he's finished.
 
"As for PHP... i don't think it will do irreparable damage, but I would personally opt for something a little more rigid/concrete to start with. This doesn't necessarily mean something strongly typed, but... i'm just biased strongly against PHP. It has its uses, but I don't think it's as a learning language."

I disagree. I learned on PHP and my entire career now involves programming..... I owe it to PHP, CSS, HTML, JavaScript and ASP.net VBScript -shudder-
 
You said he wants to write iPhone apps? Specifically? Then download or install the dev tools that came on your disk, and go to Apple and have him join the developer's connection. All he needs is right there... including TONS of videos and examples. Plus there is a great community for him to participate in. Forget HTML, C++ and all that other stuff. You said he wants to do iPhone, so let him do the iPhone. No sense wandering around the coding planet when there's a one-stop-shop for what he WANTS.
 
Thanks. Will it be hard for him to go from JavaScript to Java, Python, C/Objective-C? Or will he be hampered?

Absolutely not! JavaScript shares the same basic core language constructs and programming principals as most languages.

In the long run I doubt very much it will make any difference which language he starts with. If he likes programming he will soon find his own way. But for the few hours it will take to make the transition from html to JavaScript I think it's worth it, even if all he comes away from it is knowing how to write for loops, if statements etc.

b e n
 
If he wants to be a programmer send him to college. If it's just for fun then more power to him. But a job in the field will almost definitely require a degree in computer science.

My school started everyone off with C++. It really wasn't that hard. There was two classes to just learning the language and from then on it was theory crap.

I didn't see it mentioned before, but Perl is pretty sweet.
 
Quick update:

Thank you everyone for your advice. I have given this much thought and research, and have narrowed it down to 2 possibilities:

1. Let him learn javascript and then go to java or objective-C, since he's on that road right now.
2. Let him learn Python (with his siblings, there's a good book for children), and then go on to other languages.
 
Shouldn't your son be asking about the best way to get into programming rather than you doing it for him?

Yeah, I hear you. However, my son asked me for guidance. As I said earlier he downloaded the iPhone development kit, and realized he couldn't do anything. I don't know anything about programming, that's why I bought him a book on HTML, XHTML, and CSS. I realized that I may have made a mistake by taking him that route. So to answer your question, he is asking. However, he asking me, and I am asking you all :).
 
Yeah, I hear you. However, my son asked me for guidance. As I said earlier he downloaded the iPhone development kit, and realized he couldn't do anything. I don't know anything about programming, that's why I bought him a book on HTML, XHTML, and CSS. I realized that I may have made a mistake by taking him that route. So to answer your question, he is asking. However, he asking me, and I am asking you all :).

I think it's great that you're getting involved, but I would definitely recommend he setup an account here and post in this forum while he's cutting his teeth on things (the web programming forum might be better for javascript stuff, but i don't think it would be unwelcome here if it was about using the language and not specifically DOM manipulation), then move over to the iPhone programming forum once he goes full-bore into that.

As for the JavaScript vs. Python thing... it probably really doesn't matter at this point. He just needs to start writing code and reading about whatever language he chooses as well as a book on algorithms. Honestly, he could probably start with Java or Objective-C at this point unless you feel like he needs to "ramp-up" to those.

-Lee
 
I think it's great that you're getting involved, but I would definitely recommend he setup an account here and post in this forum while he's cutting his teeth on things (the web programming forum might be better for javascript stuff, but i don't think it would be unwelcome here if it was about using the language and not specifically DOM manipulation), then move over to the iPhone programming forum once he goes full-bore into that.

As for the JavaScript vs. Python thing... it probably really doesn't matter at this point. He just needs to start writing code and reading about whatever language he chooses as well as a book on algorithms. Honestly, he could probably start with Java or Objective-C at this point unless you feel like he needs to "ramp-up" to those.

-Lee

Good idea. I will have him set up an account here, because there will be questions that I definitely will not be able to answer. My whole thing was, he can see results as he learns HTML. I wanted him to start with a language where he could see some results as he learns. Where he can write programs and see the outcome. I'll see. He mentioned Objective-C to me last night. I might let him start with that, and see where it goes.

I just don't want the first language to sour him on computer programming, the way it did when I was in college . :( (That's why I switched majors in college).
 
I think results should come pretty fast in other languages, too, depending on what his expectations are. Hello, World! is pretty much the first thing anyone will program in any language. In any of the languages suggested, it's pretty quick and easy:
Java:
Code:
class HelloWorld {
  static public void main( String args[] ) {
    System.out.println( "Hello World!" );
  }
}

JavaScript:
Code:
<html>
  <body>
    <script language="JavaScript" type="text/javascript">
      // Hello World in JavaScript
      document.write('Hello World');
    </script>
  </body>
</html>

Python:
Code:
# Hello World in Python
print "Hello World"

I grabbed these from here:
http://roesler-ac.de/wolfram/hello.htm

In any event, it may take a bit to have a full GUI app rigged up, but if he does go with Objective-C, and really wants to dive in right away, Interface Builder makes it a snap to wire up an interface to a few methods and see results pretty fast. This page has info on getting hello, world displayed with static text using interface builder, and an example of doing it in Objective-C with a class.
http://guides.macrumors.com/Compiling_and_executing_a_Hello_World_application

It's not too many more steps to programatically fill in a text field.

If he is interested, i'd say just get him going on Objective-C. Kochan's book "Programming in Objective-C 2.0" seems to be well-received by others on this forum that have worked through it:
http://www.amazon.com/Programming-Objective-C-2-0-Developers-Library/dp/0321566157/

If you don't have Leopard, though, I think getting the prior version would be best.

-Lee
 
As an Amazon Associate, MacRumors earns a commission from qualifying purchases made through links in this post.
In any event, it may take a bit to have a full GUI app rigged up, but if he does go with Objective-C, and really wants to dive in right away, Interface Builder makes it a snap to wire up an interface to a few methods and see results pretty fast

If you go the straight-to-Objective-C route (which is a perfectly reasonable way to go), you might want to have him follow one of the tutorials on Cocoa Dev Central. They do a good job of holding your hand through creating a very simple app and giving you a sense of where all of the command line Objective-C code will eventually take you. It's also pretty fun to build your first GUI app for the Mac. I know the joy I felt of creating something that I could click and drag around (it "felt more real" than the command line apps--if that at all makes sense) was enough to push me through the very frustrating days that are inevitable when learning programming. I just wanted to mention that these tutorials are not enough to allow you to bypass learning the Objective-C language (you really should get Kochan's book for that), but moreso to wet the mental appetite to get a glimpse of things to come so-to-speak. Also, it sounds like you had an interest in programming at one point in your life; you might get a kick out of working through a few of those tutorials just to see what it's like to create a (very simple) app for the Mac.
 
I don't have any experience at all with Java, but the program written by lee1210 is not simple, compared to Python, or JavaScript, or even C++.

Also, regarding JavaScript, the program is simply document.write('Hello, World!');, or document.innerHTML = "Hello, World!";.

I would recommend starting out with JavaScript, PHP, C++ (not C) or Python. Each because of their simplicity and because they are wide-spread, so there are plenty of places you can learn from.

But there are a few catches: if he knows HTML and goes the the web way (PHP/JavaScript), he would also like to get to know CSS pretty well. This way, after moving to PHP or JavaScript, he will have the knowledge necessary in order to create User Interfaces (for the web). So I'd say it will be way more motivating to see his web sites come to life, and build web applications, instead of having to go through an entire book creating/using only the command-line interface, and, after he's done with that, he will also have to learn to use an application for building the user interface. Interface Builder in Xcode might be easy, but you can't say the same thing about Qt, for example.

By the way, how the hell is he supposed to move from HTML to Cocoa/Objective-C?? Based on the link provided by lee1210, here's the Hello, World:
Code:
#include <stdio.h>
#include <objpak.h>
int main(int argc,char **argv)
{
    id set = [Set new];
    argv++;while (--argc) [set add:[String str:*argv++]];
    [set do:{ :each | printf("hello, %s!\n",[each str]); }];
    return 0;
}
Tell me that this is what you were doing when you were in high school, and were perfectly comfortable with it...
 
I had a serious interest in programming 25+ years ago, but was turned off by how boring it was. The cards that had to be filed, the long paper in the printer, the endless hours in the computer lab. It was boring back then. Today, programming seems more interesting. I also plan to try and learn a language. So whatever, language he learns, I will probably follow.

Thanks again everyone for the response. When he starts the language, the first thing he will do is set up an account here. I find this place, and the people here to be very helpful.
 
I had a serious interest in programming 25+ years ago, but was turned off by how boring it was....

Slightly off topic, but you might want to take a look at Context Free. It's not your usual type of programming language but for inspiring and capturing the imagination it's wonderful. The language itself is very small and a bit tricky to learn, but it is very powerful. Once you get the basics you can produce some pretty amazing images in just a few lines of code. Well worth having a look at I think!

b e n

(Have a look at the gallery, you'll be surprised how few lines of code are needed for some of the images).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.