Author Topic: I'd like to learn programming.  (Read 3841 times)

0 Members and 2 Guests are viewing this topic.

Offline Guile

  • Major(1)
  • Posts: 40
  • It's better to burn out than fade away.
I'd like to learn programming.
« on: February 22, 2011, 05:39:15 am »
So the thing is that I've never seen a source code :P How does this learning thing works? I'm looking for something that teaches complete novices how to program.

Which language is the easiest to start and where can I get tutorials?


Any help is appreciated.

"They say death takes you to a better place" - Felipe Coronel

Offline thegrandmaster

  • Flagrunner
  • ****
  • Posts: 543
    • Grandy on Steam
Re: I'd like to learn programming.
« Reply #1 on: February 22, 2011, 06:04:58 am »
What type of programming are you interested in?
Different types of code are suited towards different things.

Java is quite good, simple to begin with. My first (sorta) programming was PHP and that's great for databases and websites. It gives you results straight away which is nice.

Really, you need to choose what you're interested in and go for it - most people could do programming, it's just the sitting down and spending the time learning it.

From: February 22, 2011, 06:57:00 am
I know people will disagree with me about starting with this one, but I've enjoyed the lil bit of Soldat server scripting I've done so far. It's applied - just load up server and see it.
It can be pretty unstable however, but meh
« Last Edit: February 22, 2011, 06:57:00 am by thegrandmaster »
ohgodwhydidInamemyselfthis. Just call me Grandy.

Offline Clawbug

  • Veteran
  • *****
  • Posts: 1393
  • 1184!
Re: I'd like to learn programming.
« Reply #2 on: February 22, 2011, 07:56:47 am »
It depends entirely on what you're interested in and what you want to accomplish. If you want to make websites, web services and are interested generally in the web and the technologies behind them, then some mix of a (X)HTML, PHP(+ frameworks), some SQL database thingy, JavaScript and all that.

On the other hand, if you're interested in knowing how the whole computing system with 0's and 1's and other low-level stuff, you might be interested in C and assembly. You won't be making next Minecraft with them(well, nothing stops you, but there are easier ways), but you could very well make the next popular Linux distribution with them.

Of course, if you're interested in game development, you might want to take a look at C++, Java or C#. Note that most commercial games are written in C++ and generally the game industry(console and PC) is very C++ oriented. While there has been some attempts to bring in e.g. Java and C# into commercial game development, their utilization is really more or less nonexistent in the field.

Then there's the market for mobile development which is more or less dominated by Java these days(of what I can tell). Objective-C(a C dialect, just like C++ or even C# to some extent) is Apple's brainchild and is generally used in nearly every iDevice running some form of Apple OS.

Or, of course, you could try out for example Python or Ruby. Both are used pretty much everywhere and are very powerful(but slow and somewhat complex) languages with big frameworks and features. Recommended for a newbie because of their ease of usage(it generally takes only a handful of lines to do things which could potentially take dozens and dozens of lines to achieve in languages like C or C++).

Oh, and for the low-level naysayers I can say that while x86 assembly is a pain to work with, it's generally a VERY simple "language". Because of it's simplicity it requires lots and lots of very error-prone code to do things. But by no means it's as "hard" to learn as very many programmers think. I'd go as far as claiming that it's easier to learn to count with base-2 (0's and 1's) numbers than with base-10(0-9) numbers. ;)
Fight! Win! Prevail!

Offline a-4-year-old

  • Veteran
  • *****
  • Posts: 1918
Re: I'd like to learn programming.
« Reply #3 on: February 22, 2011, 08:30:33 am »
If we hit the bullseye the rest of the dominoes will fall like a house of cards. Checkmate. -Zapp Brannigan

Offline Psycho

  • Flagrunner
  • ****
  • Posts: 678
  • Decomposing
Re: I'd like to learn programming.
« Reply #4 on: February 22, 2011, 10:23:44 am »
At my school of game development we started out with learning actionscript, which is the programming language of flash games.
I don't yet know how similar it is to the more powerful languages such as the C ones, but I heard it gives you a fairly good introduction.
Looking down from ethereal skies

Offline {LAW} Gamer_2k4

  • Flagrunner
  • ****
  • Posts: 560
  • To Wikipedia!
Re: I'd like to learn programming.
« Reply #5 on: February 22, 2011, 10:48:20 am »
If you want to put out well-structured, usable code, Java is the way to go.  Some people might decry its hand-holding, but the architecture precludes many dangerous programming errors, and it's very well documented to boot.  Furthermore, (IIRC), it was the first language to be created for the object-oriented programming model, which is used everywhere today.  Finally, once you learn Java, it'll be that much easier to learn C++, or especially C#.
Gamer_2k4

Only anime shows I've felt any interest in over the years are Pokemon (original TV series) and various hentai.
so clearly jgrp is a goddamn anime connoisseur. his opinion might as well be law here.

Best Admin: jrgp, he's like the forum mom and a pet dog rolled into one.

Offline Kazuki

  • Global Moderator
  • Camper
  • *****
  • Posts: 262
  • European Wonder
Re: I'd like to learn programming.
« Reply #6 on: February 22, 2011, 01:03:05 pm »
I would definitely tell you to learn Java first. Pretty much the only thing that sucks about starting out with Java is setting up the classpath so that you can compile and run your programs from any directory on your PC.

Other than that, yes, Java tends to hold your hand and walk you through everything, but if you're a decent programmer, you shouldn't have any problems branching out into other languages. My first languages were Java and C. I hear that Perl is pretty hot, though.

Offline {LAW} Gamer_2k4

  • Flagrunner
  • ****
  • Posts: 560
  • To Wikipedia!
Re: I'd like to learn programming.
« Reply #7 on: February 22, 2011, 01:48:17 pm »
Pretty much the only thing that sucks about starting out with Java is setting up the classpath so that you can compile and run your programs from any directory on your PC.

The Java installer doesn't do that?
Gamer_2k4

Only anime shows I've felt any interest in over the years are Pokemon (original TV series) and various hentai.
so clearly jgrp is a goddamn anime connoisseur. his opinion might as well be law here.

Best Admin: jrgp, he's like the forum mom and a pet dog rolled into one.

Offline thegrandmaster

  • Flagrunner
  • ****
  • Posts: 543
    • Grandy on Steam
Re: I'd like to learn programming.
« Reply #8 on: February 22, 2011, 01:54:34 pm »
No, it doesn't.
It can be dang annoying. Mine wasn't too bad to eventually sort out, but my friend tried the same thing and it didn't work.. we fiddled for a fair while until it worked.
Google has enough info to set it up however.
ohgodwhydidInamemyselfthis. Just call me Grandy.

Offline Guile

  • Major(1)
  • Posts: 40
  • It's better to burn out than fade away.
Re: I'd like to learn programming.
« Reply #9 on: February 22, 2011, 05:27:00 pm »
So basically it's Java, Python or Ruby? (Even tho I might be needing PHP)

Now, I might ask a pretty stupid question about the next random code I found from tha intarwebzzz:

Code: [Select]
while file_text != file_finish:
  file_text = raw_input("Enter text: ")
 
  if file_text == file_finish:
    # close the file
    file.close
    break
 
  # write out the input from the keyboard to the file
  file.write(file_text)
  file.write("\n")
 
file.close()

As I said above I've never seen a source code and I have no idea what those raw=input and file.close() stand for. I don't know when to write any of them and how. Are there tutorials for so stupid people like me, that will explain every single character that's written in the source code? Or I will just learn those trick words over time.


"They say death takes you to a better place" - Felipe Coronel

Offline jrgp

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 5037
Re: I'd like to learn programming.
« Reply #10 on: February 22, 2011, 05:35:46 pm »
What that python snippet is doing is taking text you enter in (raw_input() reads text from the keyboard and saves it in file_text when you press enter) and ends up writing it to the file, opened by file.open() (I forget the exact python syntax) which is somewhere earlier in the program you posted.

Furthermore, (IIRC), it was the first language to be created for the object-oriented programming model, which is used everywhere today. 
Er? OOP goes back a very long way. In fact, C++'s working name was "C with Classes." I assume that bjarn stroupstrup (C++'s creator) found out about "classes" from somewhere else and felt like implementing them in C.

This tells me that OOP concepts predate C++ even. :P

And yeah, I totally agree with you about Java. I've been using java for various things for a few weeks now, and as I can see, it only has two weaknesses:
 - It is a ram hog with a lazy ass garbage collector. It will easily use 3 or more times the amount of ram if it was written in C++. However it is insanely fast
 - Since it's cross platform, you can't access any of the underlying OS system calls, unlike with C++ where you have access to all the zillions of C libraries for interacting with the OS. The fact that it didn't have functionality for this was kinda disappointing.

As for myself, I learned programming languages in this order: PHP/Javascript (2005) > Python/Ruby/Pascal (2008) > Perl (2009) > Java/Bash/TCL/Delphi (2010) > C++ (2011)

I'm not sure I would recommend that order but it worked.
« Last Edit: February 22, 2011, 06:01:54 pm by jrgp »
There are other worlds than these

Offline jettlarue

  • Flagrunner
  • ****
  • Posts: 724
Re: I'd like to learn programming.
« Reply #11 on: February 22, 2011, 05:52:22 pm »
I recommend processing as a beginner language. http://processing.org/. It has a bunch of functions for everyday things, and runs as a library ontop of java so you can use all of its potential. Whats great about it is that you can get the concepts of a lot of things with the examples, like variables, functions, classes. And the syntax and documentation make it easy to read for beginners.

Offline thegrandmaster

  • Flagrunner
  • ****
  • Posts: 543
    • Grandy on Steam
Re: I'd like to learn programming.
« Reply #12 on: February 22, 2011, 06:03:30 pm »
If you want websites, PHP.
If you want games, C++.
If you want soldat scripting, Pascal.
If you want a general language, Java.

Alot of coding will appear confusing as it's likely to contain many user-defined variables and functions to make the actual main part of the code alot easier to use.

e.g. in a Java main file:
Code: [Select]
bike maibike = new bike();   

maibike.setWeight();    //method 'invoker'
This creates an instance (one occurance) of an object (called maibike) from a class (of objects) called 'bike'.
Then the code applies the method 'setWeight' to run some code (see below the code for the bike class)..

The class 'bike' has a separate java file, called 'bike.java', where all the attributes of that object are held, and any methods (things to perform on the object) are outlined and coded.
Code: [Select]
int currentWeight = 240;
int setWeight() {
(Code in here. Probably input detection so the user can set the currentWeight variable)
}

That's the basis of Java - object oriented programming language.
ohgodwhydidInamemyselfthis. Just call me Grandy.

Offline 10th_account

  • Soldier
  • **
  • Posts: 103
Re: I'd like to learn programming.
« Reply #13 on: February 22, 2011, 08:33:14 pm »
- Since it's cross platform, you can't access any of the underlying OS system calls, unlike with C++ where you have access to all the zillions of C libraries for interacting with the OS. The fact that it didn't have functionality for this was kinda disappointing.

If you want to use OS specific functionality then just use native methods. Then you can write OS specific C++ code to your hearts content. But if you need OS specific code then chances are you're not using the right language for that particular job.


Anyhoo, on topic... I'd recommend the little bugger to start with HTML5 and CSS, then some JavaScript. That should give him an easy quick start into the world of programming without having to use any compiler or interpreter.
« Last Edit: February 22, 2011, 08:35:55 pm by 10th_account »

Offline {LAW} Gamer_2k4

  • Flagrunner
  • ****
  • Posts: 560
  • To Wikipedia!
Re: I'd like to learn programming.
« Reply #14 on: February 23, 2011, 12:06:59 am »
Furthermore, (IIRC), it was the first language to be created for the object-oriented programming model, which is used everywhere today. 
Er? OOP goes back a very long way. In fact, C++'s working name was "C with Classes." I assume that bjarn stroupstrup (C++'s creator) found out about "classes" from somewhere else and felt like implementing them in C.

Of course, but the very naming of C++ proves my point.  "C with Classes" means "procedural language with OO hacked in."  Java was intended to be OO from the start.  Sure, other languages could use objects, but they're at the heart of Java.
Gamer_2k4

Only anime shows I've felt any interest in over the years are Pokemon (original TV series) and various hentai.
so clearly jgrp is a goddamn anime connoisseur. his opinion might as well be law here.

Best Admin: jrgp, he's like the forum mom and a pet dog rolled into one.

Offline jrgp

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 5037
Re: I'd like to learn programming.
« Reply #15 on: February 23, 2011, 12:43:48 am »
Furthermore, (IIRC), it was the first language to be created for the object-oriented programming model, which is used everywhere today. 
Er? OOP goes back a very long way. In fact, C++'s working name was "C with Classes." I assume that bjarn stroupstrup (C++'s creator) found out about "classes" from somewhere else and felt like implementing them in C.

Of course, but the very naming of C++ proves my point.  "C with Classes" means "procedural language with OO hacked in."  Java was intended to be OO from the start.  Sure, other languages could use objects, but they're at the heart of Java.

I still really don't agree with you. Java was in 1995.

Look at python, 1991. It was intended to be OOP (as well as other things) from the start. I'd rather not list more numerous languages that have been based around OOP before Java's existence, so look here.

Saying Java was the "heart" of a concept that's existed for decades before its creation is pure nonsense. I expect better researching skills out of you, gamer.
« Last Edit: February 23, 2011, 12:45:26 am by jrgp »
There are other worlds than these

Offline thegrandmaster

  • Flagrunner
  • ****
  • Posts: 543
    • Grandy on Steam
Re: I'd like to learn programming.
« Reply #16 on: February 23, 2011, 12:50:51 pm »
..he's saying that objects are at the heart of Java and that it was designed to revolve around them.
It is built as a full OOP, and probably the best and well-known one.

Every topic someone makes about learning programming languages descends into a brawl of people debating over small definitions of each language. He just wants to know what a good one is to start with.

My view, Java is probably a good choice if you're keen to learn one.
ohgodwhydidInamemyselfthis. Just call me Grandy.

Offline Guile

  • Major(1)
  • Posts: 40
  • It's better to burn out than fade away.
Re: I'd like to learn programming.
« Reply #17 on: February 23, 2011, 05:23:18 pm »

Every topic someone makes about learning programming languages descends into a brawl of people debating over small definitions of each language. He just wants to know what a good one is to start with.

Ye, I noticed that ;D

My view, Java is probably a good choice if you're keen to learn one.

Thanks for your replies guys. I think I will learn some programming for novices first. (Thanks Jettlaure) And then I will see how I will handle Java.

"They say death takes you to a better place" - Felipe Coronel

Offline Blacksheepboy

  • Veteran
  • *****
  • Posts: 1817
Re: I'd like to learn programming.
« Reply #18 on: February 25, 2011, 02:10:30 pm »
What's so special about OOP? It seems like everyone is gigged out about it.

Offline {LAW} Gamer_2k4

  • Flagrunner
  • ****
  • Posts: 560
  • To Wikipedia!
Re: I'd like to learn programming.
« Reply #19 on: February 25, 2011, 03:04:03 pm »
What's so special about OOP? It seems like everyone is gigged out about it.

Well, FWIW, I can't even being to think how I'd program ANYTHING I've done over the last decade without it.  Not gracefully, anyway...

OOP is just intuitive, and it fosters writing good, understandable code.
Gamer_2k4

Only anime shows I've felt any interest in over the years are Pokemon (original TV series) and various hentai.
so clearly jgrp is a goddamn anime connoisseur. his opinion might as well be law here.

Best Admin: jrgp, he's like the forum mom and a pet dog rolled into one.