How should I learn to program?

Associate
Joined
18 Jun 2005
Posts
736
Location
Canterbury, UK
I want to learn to program, with a specific purpose in mind. I've entered into a code-cracking competition where the codes get harder each week, and although it's perfectly possible at the start to work out the codes manually it gets to the point where you will need a computer to do it for you. This is expected, it's not cheating. I need to learn how to program so that I can start this week with a simple program that takes a text input and outputs the character frequency analysis (ie how many times each letter comes up) but that I can add to later when the program gets harder. I don't want to simply download programs to do this for me (although I'm sure it's possible), I want to do it myself, as I am applying for a Computer Science course for uni and need to be able to talk about what programming I've done when it gets to interview stage.
I have no idea about languages, but if theres something that will provide a good foundation for programming in harder languages in the future (C++, etc) then that would be good.

Thanks for your help.
 

Una

Una

Associate
Joined
26 Nov 2004
Posts
2,471
Location
Reading / Lake District
Well it depends what you really want to do. There is a lot of difference between languages. Pick a language and stick with it. Read everything you can get hold of, and keep practicing.

Python is a good beginners language to learn and is very simple. Your likely to study an imperative language and a functional language doing CS (We do Java and Haskell).

Doing letter frequency analysis is pretty easy, if you know how to turn your ideas into code. Easily possible in a week.
 
Last edited:
Associate
Joined
15 May 2006
Posts
224
Perl would also be a good language to try, particularly if you're going to be writing code that uses quite a bit of string handling. I must add that I've never really used Python so can't compare it's string handling capabilities to Perl.

A copy of ActiveState's Perl (which is free from their website) and the O'Reilly book "Learning Perl" (rather than their Programming Perl book) would get you going pretty quickly.

Jim
 

~J~

~J~

Soldato
Joined
20 Oct 2003
Posts
7,558
Location
London
JIMA said:
I must add that I've never really used Python so can't compare it's string handling capabilities to Perl.

It handles strings VERY very good. I've used Python for nearly a year now and whilst it's 'power' is no where near as good as C++, as a language it's absolutely gorgeous.
 
Associate
Joined
15 Oct 2005
Posts
647
My recommendation would be VB.NET. Very easy to pick up and extremely powerful.
 

~J~

~J~

Soldato
Joined
20 Oct 2003
Posts
7,558
Location
London
durbs said:
My recommendation would be VB.NET. Very easy to pick up and extremely powerful.

I'm with you mate, fancy hiding behind this brick wall whilst we await the c# fanatics. :p
 
Soldato
Joined
2 Aug 2004
Posts
2,941
Location
London, UK.
A good foundation (and more basic language with excellent principles) is Pascal.

It's an industrial language but is more often used throughout education now.

While it's procedural (not OO) you'll not be getting to grips with OO. However, it still teaches you plenty of programming techniques that you'll use later and much of the syntax is derived into C# / Java etc.

Being procedural you'll also get a taste of this style and appreciate the benefits of OO magic.

Good to see someone thinking about learning from the beginning and getting the fundamentals in place.

(edit - if you don't actually want something basic and want to jump in at the deepend - I'd advocate C#, purely because it's a hottie.)
 
Associate
Joined
25 Aug 2006
Posts
64
Location
Stoke-on-Trent
Personally if you're a beginner to programming i would say go for a language that pretty much takes care of string handling for you. Although C++ does add the data type for strings it takes alot more practice than say VB.Net or Java. I would go for VB.Net considering your requirements. It will cut down the amount of time to actually get something working considerably.
 
Associate
Joined
6 Jul 2004
Posts
465
A vote for C# / Java.

Very similar, but both provide a good object-orientated platform for leaping onto other o-o languages. If you know one, it doesn't take much to know the other.

I, personally, would avoid VB as I get annoyed with all the syntax stuffs. Its a step backwards! :p
 
Associate
Joined
27 Oct 2002
Posts
952
I suggest java as it is taught universally in first year computer science courses.
 
Soldato
Joined
20 Oct 2002
Posts
5,469
Another idea would be learn awk then learn java or python so you can use pyawk or jawk.
 
Soldato
Joined
9 Jul 2006
Posts
3,322
Location
London
Any language would do really, to a certain extent. Just get a 'Getting started' sort of book, and away you go!
 

Una

Una

Associate
Joined
26 Nov 2004
Posts
2,471
Location
Reading / Lake District
Yeah to be honest the language does not matter very much. So long as you understand the concepts of programming it is quite easy to learn another language in future. You say your applying for Computer Science degree, well none of them require any previous programming experience. You are best to learn your maths well because those are the sort of interview questions you will get. (I was asked to do a proof by induction for some recursion)
 
Soldato
Joined
12 Apr 2004
Posts
11,788
Location
Somewhere
~J~ said:
I'm with you mate, fancy hiding behind this brick wall whilst we await the c# fanatics. :p
BURN THEM AT THE STAKE!!

:p

But yes, C# or VB.NET would probably be well suited to this, as the .NET Framework comes packed with all kinds of tools to help you out, so you can concentrate on the task at hand. I agree, though, that this is easily doable in any language, and it's really up to you :)
 
Last edited:
Top Bottom