top | item 2735528

Ask HN: I want to start programming - Should I start BASIC?

12 points| Spock | 14 years ago | reply

I have tried hundreds of times to learn how to code and I fail everytime. You name the language and I've probably had a go. My question is, should I dig out my Sinclair Spectrum and start with BASIC and work my way up? Where should I begin?

The problem I face is remembering what I read in tutorials/books and/or putting what I've learned into practice!

22 comments

order
[+] jechen|14 years ago|reply
One of the best ways to learn programming is to start a project and just follow through with it. Start with something small; I began making my own Pong clones in Java. Also, Stack Overflow should be your best friend.

If you want some solid beginner reference materials, I'd suggest Learning Python the Hard Way (http://learnpythonthehardway.org/). I'm a strong proponent of teaching introductory programming with Python. Others are just a Google query away.

It'll be a long and arduous (and ultimately rewarding) journey. Best of luck!

[+] pvarangot|14 years ago|reply
I'm repeating some of my advice given on another post that was pulled down due to a downmodded parent.

If you want to do something a little different you can also try subsetting Haskell as per in most of the courses found in http://www.haskell.org/haskellwiki/Haskell_in_education#Hask... That is the approach they take in the University I studied CS, and it's an interesting one to combine with learning Python as a fist language.

[+] BlackJack|14 years ago|reply
Everyone has an opinion on what language to start with, and I suspect that there is no clear answer. However, I would recommend you start with Scheme/Lisp and read "The Structure and Interpretation of Computer Programs" (http://mitpress.mit.edu/sicp/full-text/book/book.html).

This book is a classic and outlines various fundamentals of computer science and programming. Scheme is the type of language that lets you just code without worrying about all the unnecessary things that hinder the beginner.

From there you should move to C++ so you can get used to object oriented programming and have a better idea of what "modern" languages are like, but I contest that SICP is the best book to use to start programming.

[+] serichsen|14 years ago|reply
+1 for SICP, but I cannot really recommend C++, since it does only pseudo object orientation (plus it has a syntax jungle from hell).

I would recommend to learn Common Lisp instead.

[+] evo_9|14 years ago|reply
Basic is really not terribly relavent or useful at this point. I'd consider good old Javascript. Its syntax is derived from C and gives you a foot in the web-world. It's also easy to get started as you can start with any text editor, a browser and there is no compiling or development environment to configure (a huge obstacle I think other programs forget btw - setting up and getting your IDE working is not so simply for a beginner).

From Javascript you can use your knowledge and move to just about any other langauge (C/C++, Java, C#, Actionscript are examples of other 'C' derived languages). Plus, Javascript's popularity is on the rise and it's a good skill for any programmer to have in his toolbelt (you are bound to run into it at some point in your programming experience down the road).

As far as putting programming skills to practice, I agree with the sentiment of others - come up with a pet project, even a simply one to learn the ropes. For example I use to always start by writing a simple contact/address book program; it contain all the elements you'd need to know for most business apps (a list of records (addresses), the ability to view 'details', add new records, delete records and edit existing data).

You should also consider taking a computer programming class at your local community college. That way you are assigned simply programs, have other classmates to work with and talk about sticking points with; of course the teacher is always an option to get some real feedback when you are stuck which is something a book alone can't provide.

[+] noblethrasher|14 years ago|reply
I don't want to be too prescriptive about which language to use but I do suggest first making useful command line programs rather than graphical interface applications. The problem with GUI apps is that you have to learn too many orthogonal concepts at once (plus a lot of GUI programming involves writing tedious boilerplate code). Python is a good modern language.

Also avoid (for now) any project that requires a relational database and instead opt for saving things to files. You'll end up learning a bunch of bad habits if you try to learn a general purpose language and an RDBMS at the same time; you might start to think that an RDBMS is the only option for storing and retrieving data even when simple reads and writes to the file system will suffice (the hacker news website does not use a relational database for instance).

Some suggestions for projects:

* Some kind of light accounting program.

* Something that reads RSS feeds, looks for keywords and notifies you of relevant links.

* Something that manages your media library.

* A TODO list (this is popular among even experienced programmers, you can easily add a GUI part later as well as graduate to using an RDBMS).

As someone else mentioned, use Stackoverflow.com. I especially enjoy helping new programmers there, my contact info is in my profile.

[+] sixtofour|14 years ago|reply
I agree completely with this answer, especially every word of the first paragraph.

I'm teaching programming to my 13 year old son, using Python. He's doing well with it.

[+] leibniz|14 years ago|reply
Python is a good language to start. You should definitely avoid BASIC. Quoting E. Dijkstra:

"It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration."

[+] pvarangot|14 years ago|reply
Iwould also definitely give Python a try, I have personally seen Python as a basic language to start learning how to code in action and it is very effective to teach the basics of program. Zed Shaw's book is a very interesting way to learn progamming with Python, though I don't have any references about it's effectiveness... http://learnpythonthehardway.org/

If you want to do something a little different you can also try subsetting Haskell as per in most of the courses found in http://www.haskell.org/haskellwiki/Haskell_in_education#Hask... That is the approach they take in the University I studied CS, and it's an interesting one to combine with learning Python as a fist language.

Also, be wary of EWD quotes about teaching computer science, since they are sometimes a bit cocky.

[+] GoldenMonkey|14 years ago|reply
youtube.com has some great classes by Google on python. search for 'google python class'.
[+] mdoyle|14 years ago|reply
Earlier in my career I concentrated learning how to construct software irrespective of language. I remember a good book I read probably 10 years ago, called "Code Complete". Its still on my shelf.

I also don't recommend copying other people's code until you are familiar with the language in question and can debug and enhance the code.

Choose a language - nothing wrong with Basic for learning purposes - get a book that takes you from Hello World to building a small app and read it cover to cover. And be patient. Don't copy other people's code for now. I think you'll get more reward this way and will be able to build upon your learnings instead of spending your time trying to make your current mashups work.

[+] namank|14 years ago|reply
This reminds me of me and calculus. I used to read the book and then get super frustrated on assignment questions. I read the book, so was I not able to solve the problems?

It was because I didn't do examples thoroughly. Soon I realized that doing examples was actually more important than reading the book.

By the sounds of it, you are in the same boat!

Start by figuring out how to compile/run a hello world program. Then figure out what all the code means. Do that a couple of times with a couple of different (and small!) examples before you can expect yourself to come with the code.

Practice, practice, practice!

[+] waynecolvin|14 years ago|reply
There are many dialects of BASIC and many old ones on old micro-computers had poor features like GOTO or 2-character variable names...

Nevertheless, for as long as you do grow out of it and move on... Why not! Don't forget to move on, that's important.

It's possible to find really old books with like scientific/financial calculations in BASIC, but don't get under the illusion that you can easily do anything "practical". For play/practice, go ahead! But please do move on it you keep at it.

[+] tobylane|14 years ago|reply
I wouldn't bother learning a language that isn't of general use, I also wouldn't learn an odd/heavily-non-standard language within the first or five (so you don't learn bad habits). As I understand VB and Basic are common examples of this. There are a lot of ways to improve on what you already know, e.g. lua would build on your javascript knowledge.

If you've failed so often, don't keep trying, but read some motivational/self-improvement books. Ask HN for them, I haven't read any.

[+] chipsy|14 years ago|reply
From what you've said you have a good command of syntax. So the second half you are missing is general CS knowledge - how to make algorithms and data structures work for you. From there it's just a matter of finding resources to work on CS-type problems; you could work through TAOCP, Project Euler, a college CS 101's posted exercises...
[+] DanielStraight|14 years ago|reply
What do you mean by "fail"?
[+] Spock|14 years ago|reply
Well I sort of get 'writers block'. For example I set out learning PHP a few months ago and created a meme site which would store image locations in MySQL, pull them out in ascending order and have arrow buttons to flick between the images. A random button for an image at random, an upload script, a login script, and a crappy admin area. Doing all tha took me weeks of trail and error and a lot of copying other people's code then all of a sudden I hit a brick wall and couldn't progress. For a month or two I get a rush of enthusiasm and motivation, I start off great and start thinking logically in my everyday life and I start thinking about how something is coded; I even start thinking algorithms for everyday life. But then I just stop dead and can't progress; anything better than command line input/output apps just eludes me!
[+] mbrzuzy|14 years ago|reply
If you want to train your logic skills as well as basic programming concepts, I would go with c++.