Starting out

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

User avatar
fishyfish777
Posts: 375
Joined: Mon Jan 28, 2008 4:29 pm UTC

Starting out

Postby fishyfish777 » Fri Oct 10, 2008 10:46 pm UTC

So, I read somewhere else on this forum that a good time to start programming would be around the start of High school. I am a 14-year-old freshman who is looking for something productive to do in my free time.

Now, I've heard stuff that Python is easier to use than the other languages (C++, Basic), is this true? If so, how can I start on this? What are any good resources I can find - Book, or Internet(s)? Is Lua okay too?

Currently my pastime is CSS surfing. Ahoy.

[EDIT]I run vista x64 on a G50V laptop[/EDIT]
[EDIT 2] 100th post ahoy!
Neon Rain wrote:And somehow we humans can invent scanning-probe microscopes that can "see" individual atoms, yet still can't invent a machine that can reliably scan tests not taken with a #2 pencil.

User avatar
Kurushimi
Posts: 841
Joined: Thu Oct 02, 2008 12:06 am UTC

Re: Starting out

Postby Kurushimi » Sat Oct 11, 2008 12:37 am UTC

I think this a perfect time to start. Especially since you may not get a chance later, being bombarded with more homework, finding colleges, etc. I started around that time.

I learned C++, don't know much about other languages, though. It doesn't seem too difficult to me to tell you the truth. But, there is A LOT to learn. Especially when you get into APIs like OpenGL. But if you're thinking of learning C++, as I've heard time and time again, you should start off with learning to program with C, without classes.

User avatar
Berengal
Superabacus Mystic of the First Rank
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway
Contact:

Re: Starting out

Postby Berengal » Sat Oct 11, 2008 2:44 am UTC

Python is a good starting point.

Official python tutorial. Get a python implementation first, then sit down with the tutorial, the interpreter, and a text editor (the windows implementation comes with IDLE, which is a light-weight python IDE that's both a wrapper around the interpreter and a simple text editor with support for writing python scripts. I think it's pretty nice for a beginner). Try experimenting in the interpreter as you're reading, so you'll become more familiar with the syntax and the interpreter itself and won't be completely lost in the woods when you start doing more advanced things. And you should start doing more advanced things than trying random things in the interpreter rather quickly. It doesn't take much programming knowledge or skill to make a program that calculates the area of a circle, or the volume of a cube, or even finds the roots of quadratic equations, and you should be able to do so after only going a few pages into the tutorial.

Expect the first few days to be full of frustration as the interpreter coughs up syntax errors left and right, and you have no idea what's going on. This will solve itself shortly, and you'll be left with bigger, but less frustrating and more interesting problems to deal with.
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.

User avatar
Rippy
Posts: 2101
Joined: Sun Jul 22, 2007 11:27 pm UTC
Location: Ontario, Can o' Duh

Re: Starting out

Postby Rippy » Sat Oct 11, 2008 3:10 am UTC

I started on C++ around the same time as you. I considered switching to python a year or so in, but never did, so I can't say anything about it. I do really like C++ though. Usually you hear that C++ is a more advanced programming language, and that you should start with VB or Python first, etc. I disagree. If you're the type who likes programming and is good at problem-solving, you can pick up pretty much any language you want to, short of assembly. C++ doesn't HAVE to be super-complicated, you can start with simple things and work your way up.

So, if programming scares you, I'd say Visual Basic. If programming looks fun to you (which I will assume), I'd say C++ or Python, with my bias towards C++. Nothing says you can't shop around though, so pick one to start, then look around at some other languages and see how they compare once you know a little about programming.

User avatar
headprogrammingczar
Posts: 3072
Joined: Mon Oct 22, 2007 5:28 pm UTC
Location: Beaming you up

Re: Starting out

Postby headprogrammingczar » Sat Oct 11, 2008 12:50 pm UTC

I would also like to recommend that you learn Java too, if only because the compiler errors are less bizarre so you can learn to avoid them. One of the bigger errors in Python is using an operation that a particular object type does not support. Because it is dynamically typed, it doesn't give you an error until you run it because the editor can't determine what the object is beforehand. An example; Python strings are lists of strings, but they aren't actually lists, so a lot of list operations are missing. Try removing the letter j from a string to see what I mean.

Edit: This is not a religious war. Learn them both at the same time. They are similar enough that you can, and it will prepare you for learning more languages quickly.
<quintopia> You're not crazy. you're the goddamn headprogrammingspock!
<Weeks> You're the goddamn headprogrammingspock!
<Cheese> I love you

User avatar
Berengal
Superabacus Mystic of the First Rank
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway
Contact:

Re: Starting out

Postby Berengal » Sat Oct 11, 2008 1:43 pm UTC

Yeah, I thought about recommending Java too, simply because of better compiler errors. Python doesn't have particularly bad errors, but because of dynamic typing, they can be somewhat nonsensical at times. I opted for python ultimately because it's interpreted, and therefore it has an interpreter (duh) which can be run interactively.

But yes, learn several languages. The smartest thing I did when I started out programming was learning both Java and Python right away. If I'd been even smarter, I'd have learned even more languages.
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.

qbg
Posts: 586
Joined: Tue Dec 18, 2007 3:37 pm UTC

Re: Starting out

Postby qbg » Sat Oct 11, 2008 3:08 pm UTC

There is a best language for n00bs thread over in religious wars; some of it may be useful.

Python is probably a good language to start with. Java might also be good to experience early on to expose you to something with more of a bondage-and-discipline style, plus many of my higher-level college CSci courses use it, so you are going to see it sometime anyway.

Scheme has/is used in introduction courses in college. If you are feeling adventurous, you can learn some Scheme, read Structure and Interpretation of Computer Programs (SICP) online, and watch some of the video lectures that follow the first edition (but are still very good). Note that SICP really isn't about Scheme, but programming in general.

If you explore Scheme and like it to some degree, you might want to take a look at Common Lisp; it is like Scheme but it is an industrial-strength lisp with many more goodies built-in (particularly several iteration constructs besides recursion). Main two downsides would be that library can be lacking in some cases (but still rather good), and it increases the chances you will become a Smug Lisp Weenie with all other programming languages feeling painful.

User avatar
DrProfessorPhD
Posts: 55
Joined: Sat Oct 11, 2008 5:35 pm UTC

Re: Starting out

Postby DrProfessorPhD » Sat Oct 11, 2008 5:42 pm UTC

Hey, I registered (finally) because this thread (plus me finally getting to the very, very basic section of programming in my intro to computers class) was enough for me to ask for advice.

I garnered an interest in programming beginning of HS, and took the only programming course that was offered. I found it no challenge at all. Two years later, and I still haven't picked up any actual languages. I'm interested in learning some, but a combination of laziness and other things in life interfered with me learning things for so long.

Do any of you have any advice for someone in my position (that is, starting any real languages a few years late)?
I am probably a swordfighting octopus. In case you can't tell.

chibu
Posts: 15
Joined: Sat Oct 11, 2008 4:38 pm UTC

Re: Starting out

Postby chibu » Sat Oct 11, 2008 6:00 pm UTC

I agree with the learning multiple languages sentiment, however I don't know that I'd personally recommend learning them at the same time. Pick one to begin with. I recommend using whatever language you can get setup with the easiest. Python and Java have pretty easy installers for windows. I actually think that Java might be a better language to learn with than Python. I don't prefer to use Java if there is another alternative, but it has syntax closer to other languages than Python. And as both are interpreted languages, either should be fine. The most important thing is to learn the basic principals of programming, so that you can keep those with you when you move on to a new language. Make sure to pay attention to things like loops and arrays and the other big ideas in programming as these will always be with you, no matter the language.

It's never too late to start learning to program. It's never too early either. Today is a pretty good day to start. Good luck with whatever you decide to do.

User avatar
Berengal
Superabacus Mystic of the First Rank
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway
Contact:

Re: Starting out

Postby Berengal » Sat Oct 11, 2008 7:31 pm UTC

Java isn't interpreted. It's bytecode is, but it's still compiled to bytecode. Okay, so python is compiled to bytecode as well, but it's a much simpler transformation. The point is, java doesn't come with an interpreter, and python doesn't come with a compiler.

And yes, don't learn several languages at the same time, but don't wait too long either. A few weeks learning the syntax and other basics is enough.
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.

qbg
Posts: 586
Joined: Tue Dec 18, 2007 3:37 pm UTC

Re: Starting out

Postby qbg » Sat Oct 11, 2008 10:00 pm UTC

Berengal wrote:Java isn't interpreted. It's bytecode is, but it's still compiled to bytecode.
Unless you JIT the bytecode

User avatar
fishyfish777
Posts: 375
Joined: Mon Jan 28, 2008 4:29 pm UTC

Re: Starting out

Postby fishyfish777 » Sun Oct 12, 2008 2:42 pm UTC

Hmm, thanks guys. Now I'm more confused than ever :D

Seems like people side either with C++ or Python or Java.

My first thought when I posted this was to go with Python - My friend loves it, and it seems like Randall likes it too.

But I thought, what is the practicality level for both programs? For instance, if I would want to write a simple timer that runs on Windows, which language would I use to code it? C++ seems to be more supported by Windowze than Python, that's for sure. I don't feel like running recovery and destroying all my data just to make another partition to run linux on...

http://www.dmh2000.com/cjpr/
According to this, C++ is pretty hard to learn, and Java, as stated in the "Which language for n00bs" thread, is the easiest.

...I don't know which one to start on. I think I'll choose Java to start, for the time being. Just to start.

[EDIT] :| not understanding anything, even in a simple "hello world" program, java compiler doesn't work
Neon Rain wrote:And somehow we humans can invent scanning-probe microscopes that can "see" individual atoms, yet still can't invent a machine that can reliably scan tests not taken with a #2 pencil.

User avatar
OOPMan
Posts: 314
Joined: Mon Oct 15, 2007 10:20 am UTC
Location: Cape Town, South Africa

Re: Starting out

Postby OOPMan » Mon Oct 13, 2008 7:25 am UTC

I'd recommend Python and C.

C++ is useful, but also somewhat arcane and not entirely forgiving.

Java is monolithic in the extreme and possibly harmful to learn ;-)

IMHO, Python is great to start with because it's extremely easy to pick up
and get going with but is also extremely powerful. The fact that it is a
dynamic language is also useful, as these will serve you well in the long
term.

C is worth learning simply for the pointers and low-level natue of it.
Being able to code at a low-level is just as important today as it
was 10 years ago.

Finally, once you've got some stuff under your belt, it'll be time to hit
Common LISP and/o Scheme :-)
Image

Image

User avatar
tetsujin
Posts: 426
Joined: Thu Nov 15, 2007 8:34 pm UTC
Location: Massachusetts
Contact:

Re: Starting out

Postby tetsujin » Mon Oct 13, 2008 4:42 pm UTC

fishyfish777 wrote:So, I read somewhere else on this forum that a good time to start programming would be around the start of High school. I am a 14-year-old freshman who is looking for something productive to do in my free time.


The sooner the better, really. You won't necessarily always have the kind of free time you do now, so make the most of it - whether that means learning to program or pursuing other interests...

My big thing with regard to this kind of question is this: to me, programming isn't something you learn just to know how to do it (and learning something with the goal of knowing how to do it doesn't really get you to that level of understanding...) So to me the important thing is find something you want to do with this skill first - then let that guide your choice of tools.

For instance: if you want to write a program that uses a GUI, then in my opinion that has a huge impact on your choice of languages. Additionally, you're working in Windows, so a fair number of your good options aren't free. (Java would be one free option - probably some form of the GCC compiler with the GTK library would be another...) If you're OK writing programs that will run in a terminal window, that's a lot easier in terms of the choice of tools. (You mentioned Linux - I love Linux and would recommend learning it some day. If today isn't the day, you might want to install Cygwin on your Windows machine. You don't need Cygwin either, really - but it's an easy way to experiment with the kinds of tools that are common on Linux. It's one way to run the GCC compiler on Windows, as well...)

C and C++ are sort of considered "respectable" languages - the sort you'd expect to see on a resume and use in a job. I think everybody should be competent with these two languages these days - in part because when you get down to business, particularly with C, they encourage you to think of the problems in ways that fit the computer. (It took me several years to understand this about C - you can use C and C++ and put everything behind layers of abstraction - but if you do that all the way to the lowest levels of the problem, then I think you've missed the point of using C...) But using C or C++ also forces you to deal with all kinds of details that are sort of incidental to the problem you're really trying to solve.

I always think of Python as being sort of like legos, except in code. Python's a fun language to tinker in... It's well-suited to interactive sessions (if you don't know what I mean by that, there are languages that aren't well suited to interactive sessions - languages like C that must be compiled, or languages like Haskell where the interpreter can't accept declarations...) and the way classes and objects are implemented gives you all kinds of control over things. It's chaotic in a way (especially when dealing with the implications of the fact that there is no "compile-time" type checking, and that type mismatch errors can happen at any point during runtime...) but what I really enjoy about Python is that out of that chaos, it gives you a good set of basic datatypes, the organizational framework of classes and modules (and it gives you very fine control over those mechanisms, too) and utility libraries to do all sorts of different jobs... And that's actually enough to make it a nice language to write things in. From that perspective it's actually a very simple, coherent, and consistent language.

But anyway - what sorts of things are you interested in writing? Almost any language can be used for almost any task - but knowing what you want to write might have a significant impact on the best choice of tools to write it.

(*) - I call Cygwin a "good" command-line environment because the traditional Microsoft command shells, tracing their lineage back to COMMAND.COM from the DOS days, are pretty much junk by Unix standards. But Microsoft also has "Powershell", which I think could also be a good environment for experimentation... With the .NET version of, say, Python (IronPython, they call it), you could write Windows GUI stuff, you could interface with all aspects of the Windows system (registry, for instance...), and you could interact with Powershell in meaningful ways... It may be another option to consider.
---GEC
I want to create a truly new command-line shell for Unix.
Anybody want to place bets on whether I ever get any code written?

Kirby54925
Posts: 36
Joined: Thu Dec 13, 2007 3:43 pm UTC

Re: Starting out

Postby Kirby54925 » Mon Oct 13, 2008 9:11 pm UTC

I see a whole bunch of C++, Java, and Python. While I think they're all nice (although with C++ you need to do a bit more work than in Java, but not that much; still waiting for Python 3.0 to come out before I get my feet wet in it), I personally feel you should start off with Scheme. There are two good books that introduce programming concepts that use Scheme: How to Design Programs and The Structure and Interpretation of Computer Programs. Yes, Scheme isn't as widely used as the other, more popular languages, but I find the syntax insanely easy to pick up, so you'll be able to focus more on the big ideas such as recursion, data structures (the use of lists is emphasized in Scheme), higher-order functions, and data abstraction. There's a good reason why Berkeley and MIT teach Scheme in their introductory programming courses.

User avatar
Berengal
Superabacus Mystic of the First Rank
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway
Contact:

Re: Starting out

Postby Berengal » Tue Oct 14, 2008 2:40 am UTC

MIT changed to python a few years ago, you know...

But yes, Scheme is also a valid choice, and not too bad for a first language. Its insanely easy syntax took me five minutes to get, while other languages took at least a day to get into, and a couple of days to get comfortable with.
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.

mrkite
Posts: 336
Joined: Tue Sep 04, 2007 8:48 pm UTC

Re: Starting out

Postby mrkite » Tue Oct 14, 2008 5:10 am UTC

If you're feeling really creative, you can use Inform 7.
It's is designed for Interactive Fiction. so I guess you can call it a Domain Specific Language.

Here's a snippet of actual source code

Code: Select all

    The mouse is in the teapot.
    Every turn when the mouse is in the teapot, say "A tail hangs out of the spout."
    Instead of taking the mouse:
        say "The mouse slips from your hand and disappears into the teapot!";
        now the mouse is in the teapot.


The best part is the errors.... here's an actual compiler error:

Code: Select all

Problem. You wrote 'A starting pistol is in the cup' , but in another sentence 'A Panama hat is on the cup' : the trophy cup cannot both contain things and support things, which is what you're implying here. If you need both, the easiest way is to make it either a supporter with a container attached or vice versa. For instance: 'A desk is here. On the desk is a newspaper. An openable container called the drawer is part of the desk. In the drawer is a stapler.'


Friendliest programming language ever.

User avatar
OOPMan
Posts: 314
Joined: Mon Oct 15, 2007 10:20 am UTC
Location: Cape Town, South Africa

Re: Starting out

Postby OOPMan » Wed Oct 15, 2008 7:20 am UTC

Yeeech!

That looks very....verbose ;-)

On a side note, I'm really not so sure about people recommending C++ and Java. It's not that they're necessarily difficult to learn, it's just that you can pick up a lot of bad habits if you don't learn them "right".

Also, having worked as a Java web developer for 1.5 years, I just can't recommend the language to a beginner on the simple basis that it takes the joy out of coding.

In Java, EVERYTHING is more painful... ;-)
Image

Image

User avatar
wr3cktangle
Posts: 75
Joined: Tue Aug 01, 2006 5:03 pm UTC

Re: Starting out

Postby wr3cktangle » Wed Oct 15, 2008 6:13 pm UTC

OOPMan wrote:In Java, EVERYTHING is more painful... ;-)


Except the documentation.
Maxim 33. When faced with the unusual, self-destruct.
My blog


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 11 guests