Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Poll

Which programming language is best for beginners?

Java
C#
C++
Other (Please specify)

Pages: 1 [2] 3 4 5

Author Topic: Learning Programming  (Read 12553 times)

ILikePie

  • Bay Watcher
  • Call me Ron
    • View Profile
Re: Learning Programming
« Reply #15 on: October 13, 2011, 12:45:05 pm »

Haven't read this one, but it looks damn fine: http://landoflisp.com/
Lisp isn't your average programming language, but it does deserve being mentioned.

I'd go with either a Lisp, or something interpreted like Python.
Logged

Starver

  • Bay Watcher
    • View Profile
Re: Learning Programming
« Reply #16 on: October 13, 2011, 01:59:19 pm »

Yep, LISP (and LISP-likes) inhabit certain slots in the programming world (e.g. the GIMP-programming language (probably because it makes for easy machine interpretation (as opposed to reading easily (though)))).

But if you don't like LISP, then I say "go FORTH among the heathens, brother"... :)
Logged

Virex

  • Bay Watcher
  • Subjects interest attracted. Annalyses pending...
    • View Profile
Re: Learning Programming
« Reply #17 on: October 13, 2011, 02:18:52 pm »

It's not like a stack-based language is hard to read to a new programmer or anything. Besides, the reason LISP-likes (except for Dylan) use so many parenthesis is because that makes it easier to pass code around as data, which is necessary for the macro system. A good example is the Loop macro in Common Lisp, which is a macro that turns for example
Code: [Select]
(loop for x from 1 to 20 do (format t "~a~%" x)) ;This prints out the numbers 1 to 20, each on a new line. Everything after a semicolon is a comment.
into (comments added by me)
Code: [Select]
;Expanded with Clozure Common lisp, results may look different on other implementations
(BLOCK NIL ;We're in the nil block, so that we can break out of the loop with (break), which is the same as (break nil)
      (LET ((X 1)) ;Introduce X as a variable and give it the value 1
        (DECLARE (TYPE NUMBER X)) ;Tell the compiler that x is a number, so it can do some optimizations.
        (TAGBODY ;We're going to do some jumping so we'll need some tags
          ANSI-LOOP::NEXT-LOOP (FORMAT T "~a~%" X) ;At tag  ANSI-LOOP::NEXT-LOOP , the compiler places the following code in order: Print x,
                               (SETQ X (1+ X)) ;Set x to x+1
                               (IF (> X '20) (PROGN (GO ANSI-LOOP::END-LOOP))) ;If x>20, jump to ANSI-LOOP::END-LOOP. the progn is there in case we introduced cleanup code in the loop definition.
                               (GO ANSI-LOOP::NEXT-LOOP) ;else, jump back
          ANSI-LOOP::END-LOOP))) ;we're done

Anyone who's ever worked with a BASIC-like or assembly language will probably recognize the latter as a simple goto-based loop implementation, while the first is like a loop declaration in a high-level language. You'll also note that the variable declaration and the code to execute every cycle has been smeared out all over the place in the code eventually generated, which the preprocessor can do because before compilation or interpretation, lisp code is essentially a list of code elements. (If you're wondering why the format is still there, loop is a macro, which gets expanded prior to compilation/interpretation, while format is a function that gets called during execution.)


Anyway, if you want to dive into a LISP-like without shelling out, Practical Common Lisp is a pretty good introduction.
« Last Edit: October 13, 2011, 02:40:36 pm by Virex »
Logged

Chattox

  • Bay Watcher
    • View Profile
Re: Learning Programming
« Reply #18 on: October 13, 2011, 06:29:47 pm »

@MorleyDev I only just started my degree, but it's looking like it might get dropped by the uni before I get to actual languages. Thing is they can do this because students sign up on a module to module basis, not an entire degree.
Logged
"10 z levels down, 10 tiles north is some blood, i shall go clean it before it drives me to insanity with it's crimson color"
The setting of Half-Life 2 Episode 3's release: "It is the 41st Millennium. For more than a hundred centuries the Gabe has sat immobile on the..."

ILikePie

  • Bay Watcher
  • Call me Ron
    • View Profile
Re: Learning Programming
« Reply #19 on: October 13, 2011, 06:36:11 pm »

Anyone who's ever worked with a BASIC-like or assembly language will probably recognize the latter as a simple goto-based loop implementation
If you wanna look cool, assembly can be an interesting place to start. I've seen a few schools that teach assembly at first, and then move up to a higher-level language.
Logged

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: Learning Programming
« Reply #20 on: October 13, 2011, 06:39:58 pm »

I don't know, teaching assembly first sort of seems like teaching how to drive a mining excavator first, then moving onto automatic car.

kaijyuu

  • Bay Watcher
  • Hrm...
    • View Profile
Re: Learning Programming
« Reply #21 on: October 13, 2011, 06:44:49 pm »

Eh, it's more like having to build your own functional car before being able to drive one.

I technically started with c++ (and even more technically ZZT-OOP), but assembly was the first language I really grasped. It's fun and easy for small stuff, like romhacking NES and SNES games. It's hellish for anything bigger. Also, I feel it taught me some not-so-great habits... I can't stand c++ switch statements because I'm always feeling the urge to use gotos to different cases. That's the sort of optimization I'd use in assembly for redundant code, instead of functions. Plus scope sometimes really annoys me.
Logged
Quote from: Chesterton
For, in order that men should resist injustice, something more is necessary than that they should think injustice unpleasant. They must think injustice absurd; above all, they must think it startling. They must retain the violence of a virgin astonishment. When the pessimist looks at any infamy, it is to him, after all, only a repetition of the infamy of existence. But the optimist sees injustice as something discordant and unexpected, and it stings him into action.

MorleyDev

  • Bay Watcher
  • "It is not enough for it to just work."
    • View Profile
    • MorleyDev
Re: Learning Programming
« Reply #22 on: October 13, 2011, 08:26:00 pm »

tbh I don't think you can learn programming in a formal environment like at university. It really is something I feel the best way to learn is to be left to your own devices. The way I think universities should (and from what I've seen and heard, don't) teach is instead to 'just' tell you what books are good, give you ideas for things to work on as you learn, have people in the know around for students to bounce ideas for solutions off, and have people in the know to go over what you've done and offer advice/critiques and help if you get stuck by running through it with you so you reach the answer by yourself with minimal prompting from them. It should be the students job to not only learn but to track down the nuts and bolts of languages.

It doesn't really work otherwise.
« Last Edit: October 13, 2011, 08:28:12 pm by MorleyDev »
Logged

Derekristow

  • Bay Watcher
    • View Profile
    • Steam ID
Re: Learning Programming
« Reply #23 on: October 14, 2011, 12:12:15 am »

I don't know about that.  I learned programming through a high school program at DigiPen (specializes in art, game programming, and game design degrees), and it worked out pretty well for me.  We started out in C++ using their ProjectFUN software to make games without having to do too much coding (it's terrible, never use it), then we moved on to Java for a brief time before ending up in C# using XNA.  Classes can work out really well if the teacher knows what they are talking about, and really has a passion for programming.
Logged
So my crundles are staying intact unless they're newly spawned... until they are exposed to anything that isn't at room temperature.  This mostly seems to mean blood, specifically, their own.  Then they go poof very quickly.

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: Learning Programming
« Reply #24 on: October 14, 2011, 12:14:09 am »

How did you feel about XNA?
I have been using it a bit, and for some things I think it is a god send, other times I wonder what they were smoking at microsoft.

Derekristow

  • Bay Watcher
    • View Profile
    • Steam ID
Re: Learning Programming
« Reply #25 on: October 14, 2011, 12:42:47 am »

How did you feel about XNA?
I have been using it a bit, and for some things I think it is a god send, other times I wonder what they were smoking at microsoft.

I haven't used anything else really, so I don't have much of a point of comparison (other than the already mentioned terrible software).  It seems to be really convenient to me though, takes care of a lot of the code you'd just copy and paste from one project to the next.  We haven't gotten into 3D stuff yet (I'm taking the class again as a second year), so I haven't really used it for what it seems to have been made for yet.
Logged
So my crundles are staying intact unless they're newly spawned... until they are exposed to anything that isn't at room temperature.  This mostly seems to mean blood, specifically, their own.  Then they go poof very quickly.

Reiina

  • Bay Watcher
    • View Profile
Re: Learning Programming
« Reply #26 on: October 14, 2011, 01:52:39 am »

Personally I would recommend C++ because if you know C++ you can code with pretty much any language(except oddities like lisp and prolog). Every other language(except those oddities I mentioned) is a simplification of C++.

Note that I'm not saying those other languages are bad, simplification has its uses. Python is absolutely awesome if you want to quickly code something for example. C# offers a very good api for windows gui applications, so if you want to code that it's good. On the other hand c# has no portability, requires a framework to be installed(but then again, if that's not an issue...). Java has portability, a decent api(nowhere near as good as c# if you want to code a gui app imo).

And XNA is just an additional library for C# btw. Frankly I coded a few applications using directX in C++, dunno why anyone would want a library on top of that, it's very easy to use.
Logged

Chattox

  • Bay Watcher
    • View Profile
Re: Learning Programming
« Reply #27 on: October 14, 2011, 03:04:01 am »

I'm getting so many different answers here :P Going to add a poll to get a better idea of what everyone thinks..

At the moment, I'm leaning towards Java, but C# does also look tempting... I did try to learn C++ a long time ago and I made a couple of console based applications. However, the book I was reading from never even touched on anything graphical, or anything beyond just the console, so that didn't really help much.
Logged
"10 z levels down, 10 tiles north is some blood, i shall go clean it before it drives me to insanity with it's crimson color"
The setting of Half-Life 2 Episode 3's release: "It is the 41st Millennium. For more than a hundred centuries the Gabe has sat immobile on the..."

nenjin

  • Bay Watcher
  • Inscrubtable Exhortations of the Soul
    • View Profile
Re: Learning Programming
« Reply #28 on: October 14, 2011, 04:45:53 am »

Well I think with a sound foundational grasp of C++, you can extend your learning beyond through the internet pretty easily. From there you learn libraries and starting dealing with engines. There are also a few basic game tutorials for C++ I've seen but not tried yet because I'm not done doing the basics.
Logged
Cautivo del Milagro seamos, Penitente.
Quote from: Viktor Frankl
When we are no longer able to change a situation, we are challenged to change ourselves.
Quote from: Sindain
Its kinda silly to complain that a friendly NPC isn't a well designed boss fight.
Quote from: Eric Blank
How will I cheese now assholes?
Quote from: MrRoboto75
Always spaghetti, never forghetti

Shades

  • Bay Watcher
    • View Profile
Re: Learning Programming
« Reply #29 on: October 14, 2011, 04:55:53 am »

Given those options C++ seems the most sense to me. But whichever you learn moving between those three will be trivial.
Logged
Its like playing god with sentient legos. - They Got Leader
[Dwarf Fortress] plays like a dizzyingly complex hybrid of Dungeon Keeper and The Sims, if all your little people were manic-depressive alcoholics. - tv tropes
You don't use science to show that you're right, you use science to become right. - xkcd
Pages: 1 [2] 3 4 5