PDA

View Full Version : New Programmer



Spr0k3t
November 15th, 2010, 03:19 AM
My son is kind of young but understands computers quite a bit. He's now wanting to get into programming but doesn't know where a good place would be to start. I recommended to him something along the lines of scripting languages which could be compiled (python, ruby, etc). However, he wants a second opinion.

So, to help a new programmer along... name some good languages to learn for a new beginner. I don't know how well he would like .Net as he's very much hard core into Ubuntu and the open source movement so he doesn't like the corporations and their products very much.

Other bits of question for him, what would you guys recommend for a good starting project.

kwyto
November 15th, 2010, 03:25 AM
You should asking what kind of applications he would like to develop and take from there.
As you probably know pretty much all of the schools teach either C++ or Java as a starting up language. Maybe he should start there.

Spr0k3t
November 15th, 2010, 04:12 AM
Around here, the schools are very heavily dependant on and firmly planted around the base of Microsoft... so all things starting programming spiral around visual basic. It's not until college level that they teach anything but around here... and my son isn't even in 7th grade yet, so he's got a ways to go.

austinprete
November 15th, 2010, 04:28 AM
I echo your own thoughts on learning Python or Ruby in the first place, but as far as a second option goes I guess it's really up to him. Not really familiar with the .NET platform however, so I don't know as far as that. C seems to be a really good language to learn first although it is difficult. If he could understand C I'm sure he could build on top of that to really anything. My list of alternatives to scripting languages is pretty much just C, C++, and Java. Don't really know what besides those I'd recommend to start out on. Maybe try to explain to him the differences between them, and what there uses are. Then he can decide. Starting project really depends how fast he learns, and where he's at when he wants to start doing projects on his own. Could really be anything from a little web application to a small game. Whatever he feels comfortable with.

worseisworser
November 15th, 2010, 07:11 AM
JavaScript is fun (and increasingly relevant); it tends to be JIT compiled to native code these days; http://mrdoob.com/projects/chromeexperiments/ball_pool/

(..I'm not sure whether that particular HTML5 example works in IE; perhaps IE9..)

TheBuzzSaw
November 15th, 2010, 07:49 AM
I just want to preempt other possible posts by saying: C++ is not a bad first language. I learned it as a young boy. I turned out OK. It serves as a solid foundation. Just because C++ contains complex topics (particularly pointers and memory manipulation) doesn't mean someone can't use its simpler side and transition slowly.

bitscarre
November 15th, 2010, 08:08 AM
Python, Java, C++. This is the order I recommend.

lobralleo
November 15th, 2010, 08:30 AM
Python is definitely a good choice to start with and has a strong community support (which your son will love if he wants to stick to an open philosophy); it has many additional modules to expand its capabilities.

Perl is also a nice scripting language with a large array of libraries for all kinds of purposes. It's versatile and really easy to read and code.

Java also makes a good starting choice, being possibly the most widespread cross-platform language in use.

If he wants to delve more into the nuts and bolts of programming, then go for C/C++: the learning curve might be a bit steeper but, as TheBuzzSaw said, it builds strong programming foundations.

Hope to be of help!

bitscarre
November 15th, 2010, 08:34 AM
This article might be of help:


http://www.catb.org/~esr/faqs/hacker-howto.html

saulgoode
November 15th, 2010, 12:16 PM
http://game-editor.com (http://game-editor.com/Main_Page)

lykeion
November 15th, 2010, 01:50 PM
Python, Java, C++. This is the order I recommend.
I'd agree with this.
Personally my first language was BASIC on a Sinclair ZX81. A horrible language but it hasn't stopped me.

ziekfiguur
November 15th, 2010, 02:27 PM
Python, Java, C++. This is the order I recommend.
I would skip Java. I learned Java first myself, and Python and C++ after that.

I found that Java is too restrictive as it forces you to use classes and you can't use function pointers (ore something similar). I hardly ever use Java anymore, and, while learning C++ I noticed that Java had left me with a lot of bad habits.

So, I would suggest either Python or C++, Python might be easier to learn at first but, as TheBuzzSaw said, C++ can serve as a solid foundation and when you know C++ learning any other language won't pose much of a problem anymore.

Also, you're not a real programmer until you can write programs instead of scripts.

worseisworser
November 15th, 2010, 02:44 PM
..and when you know C++ learning any other language won't pose much of a problem anymore.

Why do people say this? It isn't true at all.

Learning C++ means you'll have an easier time learning similar languages like Java and C# -- since C++, Java and C# really are similar to each other when you consider a much broader set of languages.

Examples are Lisp, Haskell, Forth, Factor, Erlang ... knowing C++ will not help you in any special or particular way here.

edit:
To put pressure on this; C++ is not the be all and end all of programming languages; it isn't even particularly interesting or ground breaking in any way whatsoever. It certainly isn't intellectually challenging; it isn't esthetically pleasing; it isn't interesting academically either. People use C++ because it represents a boring, valid and practical compromise and choice in certain special cases.

matt_symes
November 15th, 2010, 02:51 PM
Hi


Python, Java, C++. This is the order I recommend.Excellent choice for a number of reasons.

Python is scripting language that is easy to learn. It is also class based and uses inheritance so will prepare him for java and c++.

Java will introduce him to syntax that is similar to c++ but hides alot of the complexities of c++.

C++ last because it requires an understanding of how the computer works, having to deal with memory management, raw pointers, patterns and idioms, etc.

An _excellent_ choice for a young child!!!

I am a developer myself

Kind regards

TheBuzzSaw
November 15th, 2010, 04:24 PM
HA! I knew it. Here comes the anti-C++ cavalry.


To put pressure on this; C++ is not the be all and end all of programming languages; it isn't even particularly interesting or ground breaking in any way whatsoever. It certainly isn't intellectually challenging; it isn't esthetically pleasing; it isn't interesting academically either. People use C++ because it represents a boring, valid and practical compromise and choice in certain special cases.
It's not groundbreaking because (A) it is very old, and (B) it is what is used to build just everything else you hold dear. I'm not sure what implanted this deep hatred toward C++ in you. Just about every "superior" language was built using C/C++. In other words, by using one of these more modern languages, you make massive compromises in performance and low-level control. If you're writing a business app, fair enough. Performance is usually a non-issue. If you're building any kind of real-time software, C++ is the way to go.

And the earlier statement is true. I don't know where you get off claiming otherwise, but I have done it firsthand. Knowing C++ makes learning any other language a cakewalk. I found it to be true. My colleagues all found it to be true. Meanwhile, I know many people who learn other languages first and then whine and complain about having to learn C++.



C++ last because it requires an understanding of how the computer works, having to deal with memory management, raw pointers, patterns and idioms, etc.
Completely false. I used C++ for years before I knew an ounce of what went on underneath. Also, avoiding C++ because you "have to deal with memory management and raw pointers" is like avoiding math because you "have to deal with integrals and derivatives". There is a fun/easy side to C++, you know. As I said above, I learned it as a child. Sure, I didn't touch pointers and whatnot till I as a bit older, but I was able to get comfortable with the language fine otherwise. The concept of scope, control structures, etc. are all expressed very well in C++.

And no, you do not have to know "patterns and idioms" to use C++... however, I find it ironic you mentioned those items because I hope any decent programmer would be using patterns/idioms in any language he/she uses. How you managed to tie that to specifically C++ is beyond me.



Again, I won't be offended if the child does not go with C++ first. There are plenty of great languages out there. I'm simply hoping that C++ is not tossed out the window based on these FUD-centric reasons.

matt_symes
November 15th, 2010, 04:33 PM
Hi

+1 TheBuzSaw for most of it.

I have been using C and C++ for 15 years and is my main development language, so i am _not_ anti C or C++.

With C and C++ you need to know memory management (no garbage collection), You need to pointers and how to use them properly,, pointer arithmetic etc. You need to know proper thread management, contention and re-entry etc. You need to know idioms, smart pointers, RAII etc etc etc etc.

I have used all three. But the most powerful are C and C++. However they are the hardest to master.

This is why i would suggest a progression for a young person to learn the various concepts inherent in each.

Most languages that have been developed have a place somewhere and field a solution to some problem.

However, i would not write an operating system in any other language but C or C++ with a small bit of assembler. And don't forget C++0x is coming. Even more power.

Kind regards

TheBuzzSaw
November 15th, 2010, 04:46 PM
With C and C++ you need to know memory management (no garbage collection), You need to pointers and how to use them properly,, pointer arithmetic etc. You need to know proper thread management, contention and re-entry etc. You need to know idioms, smart pointers, RAII etc etc etc etc.

I still take issue with this statement here. You don't need memory management if you're not going to make a memory mess in the first place. Having to manage memory implies you are having to allocate memory in the first place. All these advanced topics do not even remotely apply here. Do you honestly think this will be the kid's first lesson?


int* data = new int[1024];

Again, a student can go a long way without ever having to deal with all those things you listed. However, when the time is right, it's not that hard to learn.

matt_symes
November 15th, 2010, 05:16 PM
Hi

Buzz


However, when the time is right, it's not that hard to learn.Now that statement i really agree with. (with my emphases) I would advocate learning to walk before running.

The progression of those languages will teach concepts inherent in modern programming and that will be one the benefits of it.

It would give a good base understanding in a scripting language, a byte interpreted language and compiled language.

I do not inherently disagree with you, however it is alot easier to write a good python program that a C++ one and its easier to learn.

And to write any industrial strength application in C++ you _need_ these concepts.

anyway int* p = new int[1024]; is more C and less C++. C++ would use the std libraries.

Maybe we should agree to disagree :) After all these are only opinions

I have stated my case and will leave it at that.

Kind regards

worseisworser
November 15th, 2010, 05:27 PM
HA! I knew it. Here comes the anti-C++ cavalry.

I do not view myself as part of any group; I honestly do not care; these are your problems. If you're looking to start some sort of fight you've picked the wrong person tbh.; you can't win.



It's not groundbreaking because (A) it is very old,

That's not really the cause; there's plenty of languages older and even much older than C++ which are way more interesting etc..




and (B) it is what is used to build just everything else you hold dear.

Err. No, not really.



I'm not sure what implanted this deep hatred toward C++ in you.

The abundantly amount of ignorant and noisy C++ users helps. I know plenty C++'ers who are not though, and of course these tend to agree with me; these also tend to know several languages besides C++ and the languages in the same family as C++.



Just about every "superior" language was built using C/C++.

Again, no, not really; at this point a suspicion that you do not know what you're talking about is dawning. I'll probably ignore anything further you have to say on this subject now.

edit: ..and in addition, for the cases where this is true, it is still totally irrelevant in all ways you can imagine even only considering those particular cases; i.e. ignoring statistics. You lacking this fundamental and very basic realization probably means I shouldn't be having this conversation with you at all.



In other words, by using one of these more modern languages, you make massive compromises in performance and low-level control.

Within reason; no, not really -- I'm not thinking Python here.



If you're building any kind of real-time software, C++ is the way to go.

I can agree with this; perhaps C even more so.



And the earlier statement is true. I don't know where you get off claiming otherwise, but I have done it firsthand. Knowing C++ makes learning any other language a cakewalk. I found it to be true. My colleagues all found it to be true.

Then both you and your colleagues are wrong or you are lying.

Again knowing C++ will not help you more vs. knowing e.g. Java when you are moving to a language in a totally different category/family than the category/family shared by C++ and Java.



Meanwhile, I know many people who learn other languages first and then whine and complain about having to learn C++.

Well of course; this tends (depending on the language) to be huge step backwards, but a necessary evil in some cases.

TheBuzzSaw
November 15th, 2010, 05:51 PM
you can't win.
Wow, this is gonna be rich...


That's not really the cause; there's plenty of languages older and even much older than C++ which are way more interesting etc..
Why are you discussing how "interesting" a language is?


Err. No, not really.
Well, I guarantee your operating system and many of its major apps were not written in Pascal...


The abundantly amount of ignorant and noisy C++ users helps. I know plenty C++'ers who are not though, and of course these tend to agree with me; these also tend to know several languages besides C++ and the languages in the same family as C++.
What... Really? "Only ignorant people disagree with me"? That coupled with your opening statement is murder. Who do you think you are? You're not even making arguments anymore. You're just saying, "Well, I'm right. End of discussion."


Again, no, not really; at this point a suspicion that you do not know what you're talking about is dawning. I'll probably ignore anything further you have to say on this subject now.
Enlighten me. What is the JVM written in? Why is Python written in? What is .NET and C# written in? And don't say ASM as that is an intrinsic component of high level C++.


edit: ..and in addition, for the cases where this is true, it is still totally irrelevant in all ways you can imagine even only considering those particular cases; i.e. ignoring statistics. You lacking this fundamental and very basic realization probably means I shouldn't be having this conversation with you at all.
Again, bring out your facts rather than just march around parading how amazing you think you are.


Within reason; no, not really -- I'm not thinking Python here.
I'm not sure why you're combating this particular point. I figured you'd say something more along the lines of "I don't need low level control for this". Instead, you drastically weaken your position. Exactly how would you code a driver, for instance???


I can agree with this; perhaps C even more so.
Fair enough.


Then both you and your colleagues are wrong or you are lying.
Uhhh, what? Are you serious? Again, this isn't even an argument. "Well, you disagree with me, so, you're wrong." What am I supposed to respond with? "NUH UH!!!"


Again knowing C++ will not help you more vs. knowing e.g. Java when you are moving to a language in a totally different category/family than the category/family shared by C++ and Java.
I can agree with this, but how big of a leap are we talking here? Like jumping to SQL? I'm just not sure how it's relevant because we're discussing the basics of programming, not programming in a specific area.


Well of course; this tends (depending on the language) to be huge step backwards, but a necessary evil in some cases.
Backwards? Moving to a language with infinitely more control is a step backwards?

worseisworser
November 15th, 2010, 06:11 PM
There's nothing really interesting or not already known to me in your response here; I'll follow my own advice and ignore you.

CptPicard
November 15th, 2010, 07:24 PM
IMO if I had a kid, I'd get him interested in either Python or, better yet if he is more academically minded kind of person, Scheme.

C++ is just way too slow going for no corresponding benefit in terms of how much computational understanding and conceptuals are implanted in the young mind in a given time period. I would want to create a kind of thinking, not necessarily particular skills in, say, C++. Those details can always be learned later on if needed, but it is my experience -- both from personal development and from talking to a lot of programmers -- that growing the general "patterns and idioms" (not for example the OOP ones specifically forced by the likes of Java/C++, mind you) of computation at large is a tougher slog. It must be easier to understand continuations at 10 years old than 30... nope, C or C++ doesn't "help" you to actively understand a lot of the ideas elsewhere at all. That we hear those kinds of statements just betrays the limited exposure of the one making the claim.

In particular I would have felt like I had lost in my mission if my offspring actually believed that high-level-languages' ideas are somehow "hosted" on lower-level languages and "come from" there... ;)

TheBuzzSaw
November 15th, 2010, 09:05 PM
Understand that I'm not suddenly offended that someone does not choose to use C++ as a first language. There are plenty of valid ways to start programming. I just take issue with the misconception that starting on C or C++ is "too complicated" or that it has "big bad evil scary memory management".

Also, knowing where the prospective programmer wants to end up is another vital aspect.

elenzo
November 15th, 2010, 09:33 PM
The first programming language I could be able to understand was BASIC (when in high school). I think this is a good starting point since you can easily explain the fundamentals of statement processing: sequence, selection, iteration. From there, as some said above, it would be good to transition to C, so your son could learn advanced concepts such as data structures, pointers and memory management, and then move to C++ or Java to learn object-oriented programming. Although this whole process could take more than a year, it builds solid programming foundations. Enjoy the ride!:popcorn:

Some Penguin
November 15th, 2010, 11:26 PM
I would skip Java. I learned Java first myself, and Python and C++ after that.

I found that Java is too restrictive as it forces you to use classes and you can't use function pointers (ore something similar). I hardly ever use Java anymore, and, while learning C++ I noticed that Java had left me with a lot of bad habits.


In Java, you can quite trivially create a Function interface w/ an apply method, and then build quite a bit of functional-style code over it (chaining functions together, lazily evaluating them on Iterables, and the like). The one thing that you really can't do is create entirely new functions at runtime, unless you're willing to play around with custom class loaders and byte code.

Spr0k3t
November 16th, 2010, 04:42 AM
Okay, so my kiddo had read through the entire thread skipping over the drivel which states C++ is a gateway drug... er I mean, gateway language towards a better understanding of coding in general.

Here's the scoopage. He doesn't want to use programming as a career choice, rather something extra in his educational endeavors. His ultimate goal in careers is something along the lines of a thermal nuclear physics engineer... but I veto'd the particle accelerator and atom smasher for his birthday. His primary goal in life is to be able to accurately produce, replicate, and harness the power found inside of a black hole (scary for a twelve year old if you ask me). He knows learning programming will help him through college at the early levels while he works heavily in math/physics.

From the sound of it, he's chosen to start with Python and will be on that for a few years. I can easily teach him the ropes of what he needs to do... I've taught a few college intro programming courses in the past.

CptPicard
November 16th, 2010, 06:12 AM
I just take issue with the misconception that starting on C or C++ is "too complicated" or that it has "big bad evil scary memory management".

It is a very recurrent bookkeeping problem that is not particularly interesting (or scary in itself), but still is the most common source of issues in particularly new programmers' code -- for no good reason really. Using a debugger can come later...



Also, knowing where the prospective programmer wants to end up is another vital aspect.

I'm not sure there is such a thing as ending up somewhere, although most programmers have specialties. Optimally one wants to be quite well-rounded and to understand things to a degree where moving between languages / solution patterns is easy. And here is where I maintain that for example static-typed imperative programming is just one part of the picture.


Okay, so my kiddo had read through the entire thread skipping over the drivel which states C++ is a gateway drug... er I mean, gateway language towards a better understanding of coding in general.

But.. that was the good part :( How is he ever going to become a proper nerd if he can't discuss important things? :confused:


His primary goal in life is to be able to accurately produce, replicate, and harness the power found inside of a black hole (scary for a twelve year old if you ask me).

Hmm... an interesting goal. A good start is to consider the actual nature of a gravitational singularity, and what that means regarding "harnessing" anything (matter-energy) that is particularly inside the event horizon.

However, the gravitational field produces some impressive effects on stuff that is nearby but not inside... tidal effects, gravitational slingshots, heating on accretion discs... :)

But if I were him, I'd look into fusion for energy production ;)

DangerOnTheRanger
November 16th, 2010, 07:14 AM
I recommend Python; it's easy to learn, and has tons of libraries pre-installed. It's open-source, too.

It's will also serve him later; it's not just for beginners. Google uses it extensively with GWS.

P.S:
Python isn't a scripting language; just because it's interpreted doesn't make it a scripting language. It's high-level, but it's just interpreted. Java's interpreted, too.

worseisworser
November 16th, 2010, 10:06 AM
I recommend Python; it's easy to learn, and has tons of libraries pre-installed. It's open-source, too.

It's will also serve him later; it's not just for beginners. Google uses it extensively with GWS.

P.S:
Python isn't a scripting language; just because it's interpreted doesn't make it a scripting language. It's high-level, but it's just interpreted. Java's interpreted, too.

Actually; Java is JIT-compiled to native code.

While CPython is interpreted, there are JIT-compilers for Python also.

"Scripting language" doesn't really have a clear meaning anymore; it never did in a strict sense actually, except in a somewhat defacto sense. Take JavaScript for instance; people use it for web applications (not scripts) on the server side now -- and it too is JIT-compiled.

Spr0k3t:
After the added information, Python, Common Lisp (built in transparent bignums and support for complex numbers), Haskell and even Fortran (still) etc. etc. are probably way better options than my previous JavaScript suggestion.

slooksterpsv
November 16th, 2010, 10:14 AM
I think Python would be a good place to start personally. Its a solid foundation for programming, is used in a lot of technical fields, plus its simple. After that move towards C++ or Java and showcase it's polymorphism, inheritance, and abstraction.

Python has a lot of great toolkits too such as pygame for games, gtk and wxpython for graphical user interfaces, etc.

worseisworser
November 16th, 2010, 10:20 AM
I think Python would be a good place to start personally. Its a solid foundation for programming, is used in a lot of technical fields, plus its simple. After that move towards C++ or Java and showcase it's polymorphism, inheritance, and abstraction.

Python (and other languages) has much better capabilities than C++ or Java for these things; it'd probably make sense showcasing it there.

matt_symes
November 16th, 2010, 01:15 PM
Hi


Okay, so my kiddo had read through the entire thread skipping over the drivel which states C++ is a gateway drug... er I mean, gateway language towards a better understanding of coding in general.

Here's the scoopage. He doesn't want to use programming as a career choice, rather something extra in his educational endeavors. His ultimate goal in careers is something along the lines of a thermal nuclear physics engineer... but I veto'd the particle accelerator and atom smasher for his birthday. His primary goal in life is to be able to accurately produce, replicate, and harness the power found inside of a black hole (scary for a twelve year old if you ask me). He knows learning programming will help him through college at the early levels while he works heavily in math/physics.

From the sound of it, he's chosen to start with Python and will be on that for a few years. I can easily teach him the ropes of what he needs to do... I've taught a few college intro programming courses in the past.

Wow!!! I'm impressed.

Python is a good choice.

Might i also suggest he get familiar with some maths based packages like matlab etc. (In due course ofcourse)

Kind regards

matt_symes
November 16th, 2010, 01:31 PM
but I veto'd the particle accelerator and atom smasher for his birthday

He can always ask Santa at Christmas :)

bitscarre
November 16th, 2010, 04:30 PM
Okay, so my kiddo had read through the entire thread skipping over the drivel which states C++ is a gateway drug... er I mean, gateway language towards a better understanding of coding in general.

Here's the scoopage. He doesn't want to use programming as a career choice, rather something extra in his educational endeavors. His ultimate goal in careers is something along the lines of a thermal nuclear physics engineer... but I veto'd the particle accelerator and atom smasher for his birthday. His primary goal in life is to be able to accurately produce, replicate, and harness the power found inside of a black hole (scary for a twelve year old if you ask me). He knows learning programming will help him through college at the early levels while he works heavily in math/physics.

From the sound of it, he's chosen to start with Python and will be on that for a few years. I can easily teach him the ropes of what he needs to do... I've taught a few college intro programming courses in the past.

It's a very good choice for him.