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 12548 times)

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: Learning Programming
« Reply #30 on: October 14, 2011, 05:05:43 am »

Given those options C++ seems the most sense to me.

I wonder, why?
Don't take it as an attack, as many do when asked why, but I always find it interesting when people say C++ over one of the newer C syntax languages. I mean there are a lot of good reasons, but good to hear one persons justification.

Virex

  • Bay Watcher
  • Subjects interest attracted. Annalyses pending...
    • View Profile
Re: Learning Programming
« Reply #31 on: October 14, 2011, 05:10:55 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.
That's what you're going to get with most books and languages. Graphics aren't an innate part of most languages (only one I can think of with graphics support in the core language are C#, Java and Racket). They also aren't an innate part of programming, but a specialist subject. Hence there are few beginners books that touch upon them.
Logged

Starver

  • Bay Watcher
    • View Profile
Re: Learning Programming
« Reply #32 on: October 14, 2011, 05:21:39 am »

Every other language(except those oddities I mentioned) is a simplification of C++.
I know what you mean, but I can't let that pass without comment.  Please consider this to be that comment. :)
Logged

Starver

  • Bay Watcher
    • View Profile
Re: Learning Programming
« Reply #33 on: October 14, 2011, 05:46:26 am »

Actually, I missed a trick, there...

Code: (Commentary) [Select]
// My comment could have been this.
/* Or this, of course */
# Or this, even for a lot of the "C-like"s and "Bash-successors", such as Perl.
; You already mentioned LISP-likes as different, I know.
! I remember this in one version of Fortran I used, long, long ago
C       But for those of a Fortran 77 bent, remember it's got to be in the first column!
* I can't remember COBOL's column requirements, any more, but pretty sure I starred stuff out
(* Delphi, anyone? *)
REM ind you of anything batch-like? <- :)
" Don't quote me on this, but I'm sure something I dabbled with used such notation.
AndOfCourseIn'Whitespace',AnythingThatIsn'tABitOfWhiteSpaceIsAComment!
<!-- This is not a programming language, of course, but I'll add it in, anyway... -->

(I don't actually know Prolog enough to remember how that comments, without looking it up, I have to admit.)





Also, I keep getting "504 Gateway Time-out" from "nginx/0.7.65" on the forums.  Anybody else get that, or is it something more my end of the equation?
Logged

Max White

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

%From memory, prolog uses comments like this.

ILikePie

  • Bay Watcher
  • Call me Ron
    • View Profile
Re: Learning Programming
« Reply #35 on: October 14, 2011, 05:57:14 am »

--[[ Poor Lua feels left out --]]

I could never understand the idea behind that notation.

e, Hurr I'm getting that time-out thing too.
Logged

Virex

  • Bay Watcher
  • Subjects interest attracted. Annalyses pending...
    • View Profile
Re: Learning Programming
« Reply #36 on: October 14, 2011, 06:13:36 am »

Actually, I missed a trick, there...

Code: (Commentary) [Select]
// My comment could have been this.
/* Or this, of course */
# Or this, even for a lot of the "C-like"s and "Bash-successors", such as Perl.
; You already mentioned LISP-likes as different, I know.
! I remember this in one version of Fortran I used, long, long ago
C       But for those of a Fortran 77 bent, remember it's got to be in the first column!
* I can't remember COBOL's column requirements, any more, but pretty sure I starred stuff out
(* Delphi, anyone? *)
REM ind you of anything batch-like? <-
" Don't quote me on this, but I'm sure something I dabbled with used such notation.
AndOfCourseIn'Whitespace',AnythingThatIsn'tABitOfWhiteSpaceIsAComment!
<!-- This is not a programming language, of course, but I'll add it in, anyway... -->

(I don't actually know Prolog enough to remember how that comments, without looking it up, I have to admit.)





Also, I keep getting "504 Gateway Time-out" from "nginx/0.7.65" on the forums.  Anybody else get that, or is it something more my end of the equation?
Among others, Python and Common Lisp also support docstrings, which allows the programmer to associate a string to a function/variable/other code segment, for interactive retrieval. For example, in CCL (a common lisp implementation), you can do the following:
Code: [Select]
(documentation 'sort 'function) ;sort is a built-in function
"Returns SEQUENCE, which has been modified to be in order.
   If sequence is a displaced array, sorts just that portion of the
   data-array which is part of SEQUENCE."
Which is useful to add comments to your program that can be retrieved without having to dig through the source code.


Edit: Matlab also uses % as a comment designator, or %{ }% for comment block. The first comment block as a function acts like a docstring, though I don't think you can alter it on the fly.
« Last Edit: October 14, 2011, 06:22:56 am by Virex »
Logged

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: Learning Programming
« Reply #37 on: October 14, 2011, 06:14:29 am »

LOL @ poll results: 2-2-2 :)

C++ is a good starter for the reason assembly is: starting at low levels will help understand why some higher level language operations and structures are slower than others.

I personally voted C# even though I don't use it myself. It's the newest of the three, and it's just the "best" language of the three. It does everything a lot of things right that Java did wrong, and is easier to learn than the "hard" C++.
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

Chattox

  • Bay Watcher
    • View Profile
Re: Learning Programming
« Reply #38 on: October 14, 2011, 07:27:22 am »

At the end of the day, what I would like is to be able to make graphical games. By graphical, I mean anything from Roguelike and upwards.

That's what you're going to get with most books and languages. Graphics aren't an innate part of most languages (only one I can think of with graphics support in the core language are C#, Java and Racket). They also aren't an innate part of programming, but a specialist subject. Hence there are few beginners books that touch upon them.

So other than C#, Java and Racket, how are graphical capabilities added to a language? Because, isn't C++ the most widely used language in the gaming industry?
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..."

Virex

  • Bay Watcher
  • Subjects interest attracted. Annalyses pending...
    • View Profile
Re: Learning Programming
« Reply #39 on: October 14, 2011, 07:28:01 am »

You use a library?
Logged

kaijyuu

  • Bay Watcher
  • Hrm...
    • View Profile
Re: Learning Programming
« Reply #40 on: October 14, 2011, 07:47:37 am »

If you wanna do graphical stuff with C++, this is where I started. Supposedly SDL's getting a little out of date, but there's a ton of tutorials and documentation for it on the interwebs, so...
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.

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: Learning Programming
« Reply #41 on: October 14, 2011, 08:05:15 am »

If you wanna do graphical stuff with C++, this is where I started. Supposedly SDL's getting a little out of date, but there's a ton of tutorials and documentation for it on the interwebs, so...
Or libtcod for roguelikes, or SFML if you're looking for something a bit less bulky than SDL. SDL does have the largest amount of good tutorials.
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

Chattox

  • Bay Watcher
    • View Profile
Re: Learning Programming
« Reply #42 on: October 14, 2011, 08:53:27 am »

Hmm, I think I'll go for C++. It seems like once I've learned that learning others will be much easier. Being the industry standard in game development helps, too. How much should I know before I can say I know the "basics", and how much will I need to have covered before I can move on to SDL? I have this book, which is now out of date (there's a third edition). Is this enough to start on?
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..."

Shades

  • Bay Watcher
    • View Profile
Re: Learning Programming
« Reply #43 on: October 14, 2011, 10:06:48 am »

Hmm, I think I'll go for C++. It seems like once I've learned that learning others will be much easier. Being the industry standard in game development helps, too. How much should I know before I can say I know the "basics", and how much will I need to have covered before I can move on to SDL? I have this book, which is now out of date (there's a third edition). Is this enough to start on?

I would recommend SFML over SDL if only because it's very similar with a slightly more modern syntax and style.

Don't take it as an attack, as many do when asked why, but I always find it interesting when people say C++ over one of the newer C syntax languages. I mean there are a lot of good reasons, but good to hear one persons justification.

In this case those three are syntactically very similar however almost any third party library is going to work with C++ and only a subset of those with C# and fewer still with Java (at least without some hackyness going on). But the main reason I suggest C++ over a number of languages is that the whole design of it is to allow you to have control over the code, occasionally I admit this leads to some weirdness (the diamond inheritance problem for example) but in general I have found it preferable. A second, and less important long term, benefit is that C++ compilers are highly developed at this point and considerably better at optimising code which in turn means the developer can write readable code without performance concerns.
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

palsch

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

I have this book, which is now out of date (there's a third edition). Is this enough to start on?
I tend to find that multiple sources and people chipping in help, but pretty much any guide is good as a core program to follow. It doesn't really matter how out of date it is, you just want to learn the core ideas behind programming on which you can bolt anything new you want to try. I found a really outdated Fotran book (around the time GOTO was first being seen as maybe not all that great) that was really helpful for a lot of the core concepts.

It's one of the reasons Fotran is still taught (OK, Fotran90 - hey, that's in Firefox's spellcheck where Fotran isn't...) in some physics degrees (like mine). The language and even specific methods you are taught don't matter so much as learning to program and the ideas behind those methods, so may as well teach a language not usually learnt elsewhere, but which still has massive amounts of code lying around from previous generations. Job security. Fewer people who can read your code the fewer people can replace you in your job. Obviously not that useful for going into a specific industry, but for people who build and maintain their own code it's not a problem.

I went from very basic DIV (a cross between BASIC and C) as a kid, to Fortran90, to LabView/G (which is arguably not really a language, but uses most of the same skillset other than typing), to some C, some C++, some Java, some C#, back to Fotran, back to LabView, to now starting to learn Lisp, with some detours into pathelogical languages as curiosities*. Oh, and I've used lots of mathematical/statistical data processing languages/packages, including Matlab, Maple, R and IDL, plus got a little addicted to AutoHotkey scripting along the way. Basically just playing with code and scripts to achieve whatever was lying in front of me at the time with whatever tools happened to hand or looked like fun to use.

* I adore SNUSP despite never having any cause or desire to do any work with it. Even Brainfuck is more useful, but SNUSP is simply beautiful. From the link, this is a multiplication function;
Spoiler (click to show/hide)
I think this is why I actually enjoyed using LabView, where a simple program/Virtual Instrument looks like this;
Spoiler (click to show/hide)
Logged
Pages: 1 2 [3] 4 5