Computer Science Canada

Second Programming Language

Author:  Anonymous [ Mon May 29, 2006 10:20 pm ]
Post subject:  Second Programming Language

My first programming experience was in Grade 10 Computer Engineering, when our teacher taught us a tiny bit of Q-Basic. Then in Grade 11 Computer Engineering, a different teacher tought us Turing for the use of parallel ports for our Gameshow. Then in Grade 11 Programming, I decided to expand my knowledge of Turing on my own, and since Turing isn't a real programming language (compared to Java or C++), I was thinking of choosing a second programming language to learn. I seem to like Python, but what would a wise choice be after Turing? And what program should I use to script for the specific language, is it free, where to download, etc.

Author:  wtd [ Tue May 30, 2006 12:16 am ]
Post subject: 

There are a huge host of languages with free cross-platform compilers or interpreters available for free.

I honestly think the biggest limitations of Turing are the fact that it's not free, and is limited to Windows. Well, that and it's general limitations as a language.

There is no reason Python is any less credible a choice than any other language. Compared to Java or C++ it's probably a more credible choice.

That said... learn something more thoroughly functional. I suggest O'Caml.

http://caml.inria.fr

Author:  md [ Tue May 30, 2006 12:36 am ]
Post subject: 

Turing has no limitations as a language. It is turing-complete, and as such can do anything any other programming language can do. It just might be less efficient or harder to do. Difficulty does not equate to impossibility however.

I'd say go with O'caml as a good language to learn. Unfortunately I'm not nearly as widely learned in languages as wtd is but from what I have been instructed over the irc channel O'caml is a pretty good language. If you want to learn something completely different try learning scheme or one of the other lisp variants. Lots of parentheses; but lots of power.

Author:  wtd [ Tue May 30, 2006 12:57 am ]
Post subject: 

Cornflake wrote:
Lots of brackets


Parentheses! Razz

Author:  md [ Tue May 30, 2006 1:06 am ]
Post subject: 

I do not know what you are talking about sir! Wink

For a nice simple language with a syntax similar to turing check out pascal. There are free compilers around (the Free Pascal Compiler comes to mind) and as Turing is partly modeled after it the syntaax would be easy to pick up. Oh, and it's wonderfully powerful as a language Wink

Author:  Martin [ Tue May 30, 2006 2:06 am ]
Post subject: 

Turing is of course a real programming language dude. What makes you think otherwise?

As for the next one, it depends on what you want to do. If you want to branch out into a completely different set of languages that will change the way you think about programming, check out O'Caml, Haskell or Lisp. If you're looking for what is essentially a more powerful version of Turing with lots of extra features, try Objective-C, Ruby or Pascal.

There's no wrong choice here, you'll end up learning languages from both sides of the table.

Author:  rizzix [ Tue May 30, 2006 2:59 am ]
Post subject: 

Objective-C is more smalltalk-ish, than pascal-ish.

Anyway.. I must add in here, while O'Caml is a nice, complex (i.e in the good sense) langauge, you might be better off learing something narrowed down, something pure and something with the powerful Haskell type system for a functional programming language: Clean.

Like Haskell (unlike O'Caml), Clean is a purely functional programming language, but it takes the "Uniqueness typing system" approach to handling side-effects in programs. This is a lot simpler than Haskell's Monads approach. Haskell's Monads approach is very complex, I don't believe any _average_ programmer would be interested in (or even capable of) mastering it. Oh, but don't get the wrong impression here, Haskell is worth the effort!

Anyway, I've only recently started learning it [Clean].. So there's not a whole lot I can say, yet. Smile

Author:  Martin [ Tue May 30, 2006 3:19 am ]
Post subject: 

I think the one problem with learning a less known programming language is the difficulty that you'd have finding help with it if you get stuck.

Author:  Cervantes [ Tue May 30, 2006 11:31 am ]
Post subject: 

I recommend learning O'Caml. At the very least, give it a try. You're brain may go through several successive explosions, but these are the good kind of explosions. Consider it a challenge: see how far you can get. If you find it too difficult, you could try Ruby or Python or some other language.

I highly suggest that you take a look at the Turing as a Functional Programming Language before you delve into O'Caml, Haskell, Ruby, Python... really anything. It will introduce you to some of the fundamental concepts of functional programming from within the comfort of an already known language.

Martin wrote:
I think the one problem with learning a less known programming language is the difficulty that you'd have finding help with it if you get stuck.


This isn't necessarily as true as it might seem. When I was dabbling with Io I joined the Io IRC channel on freenode and actually got to ask the developer some questions. Smaller communities are often more welcoming.

Author:  wtd [ Tue May 30, 2006 11:37 am ]
Post subject: 

And there are fewer people around who just think they know what they're talking about. With some of the more popular languages, this is a huge problem.

Author:  Anonymous [ Tue May 30, 2006 5:05 pm ]
Post subject: 

Martin wrote:
Turing is of course a real programming language dude. What makes you think otherwise?

As for the next one, it depends on what you want to do. If you want to branch out into a completely different set of languages that will change the way you think about programming, check out O'Caml, Haskell or Lisp. If you're looking for what is essentially a more powerful version of Turing with lots of extra features, try Objective-C, Ruby or Pascal.

There's no wrong choice here, you'll end up learning languages from both sides of the table.


It's not a real programming language according to my teacher. Plus, think about it, have you ever seen a real program written for Windows, Mac, or Linux made from Turing that is unique and not done in any other language? (eg: Word Perfect, Firefox, Photoshop) And don't be a stupid forum boy and say "Every program is a real program you n00b". You know Turing programs aren't real programs

Author:  Anonymous [ Tue May 30, 2006 5:18 pm ]
Post subject: 

wtd wrote:
There are a huge host of languages with free cross-platform compilers or interpreters available for free.

I honestly think the biggest limitations of Turing are the fact that it's not free, and is limited to Windows. Well, that and it's general limitations as a language.

There is no reason Python is any less credible a choice than any other language. Compared to Java or C++ it's probably a more credible choice.

That said... learn something more thoroughly functional. I suggest O'Caml.

http://caml.inria.fr


Ok, I downloaded it, but there's no compile button. And when I try the help menu, it gives me a french error (I know I have to download the Help menu, but why a french error?) So can you gimme a link to the download of the best O-Caml script program thingy in which I can run my program at any time to test it like Turing?

Author:  Tony [ Tue May 30, 2006 5:24 pm ]
Post subject: 

vahnx wrote:
It's not a real programming language according to my teacher.

so what's a definition of a real programming language?

Quote:
programming language
n.

An artificial language used to write instructions that can be translated into machine language and then executed by a computer.

Please ask your teacher to point out how Turing is excluded from that definition.

vahnx wrote:
You know Turing programs aren't real programs
If you're looking for a commercial quality program made in turing, then I have two words for you - Evasive Maneuvers

Author:  Anonymous [ Tue May 30, 2006 7:02 pm ]
Post subject: 

*Hint*, notice each time i said real, they were in itallics, emphasising that I do not mean they are not real, but that I mean for a programmer, it isn't the best language to really do anything useful in, other than learn.

Nice Evasive Manners game. But I found it abit difficult to read the starry text Confused

Author:  Cervantes [ Tue May 30, 2006 7:55 pm ]
Post subject: 

vahnx wrote:
*Hint*, notice each time i said real, they were in itallics, emphasising...
the word, "real". The exact meaning isn't changed by the use of italics. Besides, I can still effectively argue against your revised statement that Turing isn't a good language to make real-world programs in: Compared to BASIC, Turing is s a great language.

Anyways, that whole debate is unimportant. The meat of the thread here is what language you should learn next.

vahnx wrote:

So can you gimme a link to the download of the best O-Caml script program thingy in which I can run my program at any time to test it like Turing?

You mean an "IDE". Integrated Development Environment. I've never used a IDE specifically O'Caml myself, though some might exist. What you have to realize, however, is that there is nothing magical about the code you write. It is just text. An IDE does not change the code you write. You can use a text editor to write the code in, then execute it via the command line. This may seem cave-man-ish at first, but it's really not that bad. It's a lot easier to pick up on than learning the ins and outs of an entire IDE. Besides, you'll improve your knowledge of the command line, and will probably eventually start using it for things you would previously have done through a GUI.

So, now that all that's said, you need a good text editor. I'm going to assume you're on Windows. In that case, you've got notepad as the default choice. You could also download some other text editors. SciTE is a pretty great text editor that supports syntax highlighting out of the box for many languages (though sadly not O'Caml), among other things.

Author:  wtd [ Tue May 30, 2006 9:08 pm ]
Post subject: 

All of this ignores that O'Caml has a very nice, easy to use interactive interpreter. Smile

Author:  Martin [ Tue May 30, 2006 10:42 pm ]
Post subject: 

Cervantes wrote:
An IDE does not change the code you write. You can use a text editor to write the code in, then execute it via the command line.


Unless of course that IDE is Visual Studio .NET, in which case it is more than happy to randomly add parentheses to your code wherever it sees fit.

Author:  Tony [ Tue May 30, 2006 10:58 pm ]
Post subject: 

it's hilarious how half my class is trying to write C code in Visual Studio .Net

insidently I enjoy the consept of bellcurves Laughing

Author:  md [ Wed May 31, 2006 10:50 am ]
Post subject: 

C code can indeed be written in visual studio .net And without it being managed too. VS.net is actually not a bad ide if you only use it for the text editing and debugging stuff. And no, it does not insert random stuff if your only using it as a text editor... or it didn't in the 4 years I used it.

Author:  wtd [ Wed May 31, 2006 10:52 am ]
Post subject: 

The trouble with VS.Net can be it stealing focus when it thinks you should be using some control other than your keyboard shortcuts. If you're really in a groove coding, you can just keep on typing for a bit, in which caser you'll probably trigger some obscure keyboard shortcuts.

Author:  md [ Wed May 31, 2006 10:56 am ]
Post subject: 

Personally I've never had that happen, but if you somehow manage to get your keyboard shortcuts bound to shift + [key] then I suppose it could happen. I'm not saying VS.net is the best IDE for windows, just that people give it way less credit then it deserves for what it does do right.

Author:  MihaiG [ Wed May 31, 2006 4:31 pm ]
Post subject: 

i recommend python it forces you to learn how to indent

i.e
code:

for i in range[10]:
     print  i
     print "hello world"


is diffrent than


code:

for i in range[10]:
     print  i
print "hello world"




ie... the 1st outputs the for loop counter and hello world 10 times ....while the 2nd outputs the counter 10 times and then hello world once



its fun! Smile

Author:  rizzix [ Wed May 31, 2006 4:58 pm ]
Post subject: 

Ha! If you want to learn about indenting your code... try haskell..

Author:  Anonymous [ Wed May 31, 2006 11:01 pm ]
Post subject: 

I'm thinking of doing Python, but the thing is, school don't got it =S. I like working more at school so I can show off my awesome programming skillz! I don't mind indenting. I also like the Python colours which corrispond to your commands. Nice yellow, green, red =D.

And for OCaml, do I just type my code in Notepad, then how do I excecute it from the command line. Just type the directory and filename? I don't know any useful command line codes, only like delete and copy, etc.

Author:  wtd [ Thu Jun 01, 2006 12:44 am ]
Post subject: 

vahnx wrote:
I'm thinking of doing Python, but the thing is, school don't got it =S. I like working more at school so I can show off my awesome programming skillz! I don't mind indenting. I also like the Python colours which corrispond to your commands. Nice yellow, green, red =D.


As for what your school has available, others here have gotten around such problems.

And the colors are just syntax highlighting. Plenty of text editors can do this for a wide variety of programming languages. On Windows I find Textpad quite useful.

vahnx wrote:
And for OCaml, do I just type my code in Notepad, then how do I excecute it from the command line. Just type the directory and filename? I don't know any useful command line codes, only like delete and copy, etc.


To familiarize yourself with the language, use the interactive interpreter.

I haven't installed O'Caml on Windows for awhile, but after installing it, there should be an entry for it in Start -> All Programs.

Here's a small copy and paste from the interpreter. Here # serves as the prompt.

code:
$ ocaml
        Objective Caml version 3.08.1

# 3 + 2;;
- : int = 5
# print_endline "Hello";;
Hello
- : unit = ()
# 1 :: [2; 3];;
- : int list = [1; 2; 3]
# let a = 42 in a + 1;;
- : int = 43

Author:  Anonymous [ Thu Jun 01, 2006 5:12 pm ]
Post subject: 

Quote:
As for what your school has available, others here have gotten around such problems.


Well I downloaded the installer. Then I chose to install it on my H: drive. But then when I log out and back in, I get an error message when trying to run it... And if I install on the C:/, deepfreeze erases it when computer is restarted. Plus if it's a huge file, the computer technician will remove it from my H:/ drive, or lock my H:/ drive.

Author:  Tony [ Thu Jun 01, 2006 5:24 pm ]
Post subject: 

vahnx wrote:
And if I install on the C:/, deepfreeze erases it when computer is restarted.

But it works until then, doesn't it?

Incidentally, flash drives are awesome.

Author:  Cervantes [ Thu Jun 01, 2006 5:41 pm ]
Post subject: 

You could ask your network admin to allow you to install it on your computer. If you explain yourself properly ("I would like to do this to learn more about computer science..."), you might get deepfreeze removed from that computer. That's what I did, and now I'm booting into Linux every compsci class. Smile

Author:  md [ Fri Jun 02, 2006 12:03 am ]
Post subject: 

many school computers don't have their bios' locked out so you can change the boot order; then boot a livecd and yoru good. If your really creative you can repartition teh drive and install linux natively (like we did at my old high school). Then you just need a grub cd to boot into linux.

Author:  Martin [ Fri Jun 02, 2006 1:44 am ]
Post subject: 

vahnx, I would recommend something a little beefier than notepad, but not an IDE. Check out notepad2. If you're willing to put some effort into learning how to use an more powerful text editor, ViM is well worth the effort.

Also, since you're programming - install Cygwin (or Linux Wink)

Author:  Anonymous [ Fri Jun 02, 2006 1:03 pm ]
Post subject: 

Cornflake wrote:
many school computers don't have their bios' locked out so you can change the boot order; then boot a livecd and yoru good. If your really creative you can repartition teh drive and install linux natively (like we did at my old high school). Then you just need a grub cd to boot into linux.


The school is kinda techy, although most computers are Windows ME. They have their bios password protected, and it wont let me boot to knoppix or any live distro of Linux. Plus, the XP computers dont have cd drives.

Author:  Anonymous [ Fri Jun 02, 2006 1:05 pm ]
Post subject: 

Tony wrote:
vahnx wrote:
And if I install on the C:/, deepfreeze erases it when computer is restarted.

But it works until then, doesn't it?

Incidentally, flash drives are awesome.


Yeah it does work until reboot. But it takes a few minutes to install ,and I dont wanna do that every time. As for my flash drive, its only 128 and I use it mostly to transfer Turing, plus Flash Drives are slow at transfering data. Especially if you try creating a .exe on it using Turing lol. Im not sure if I could convince the Computer Technician to put Python on the P:/ drive because Id be the only one using it.

Author:  wtd [ Fri Jun 02, 2006 1:24 pm ]
Post subject: 

If you have the ability to print decent quantities of material at school, then I would highly recommend printing off some good programming tutorials/books and reading them at school, then experimenting at home.

Might be the best way to use the time, sicne school IT departments are often... intransigent.


: