Which programming language should I learn?

Puppy related raves and general interest that doesn't fit anywhere else
Post Reply
Message
Author
User avatar
AF Branden
Posts: 165
Joined: Tue 15 Sep 2009, 10:17
Location: United States, WA

Which programming language should I learn?

#1 Post by AF Branden »

I've been wanting to learn a programming language for a long time now but i'm not exactly sure which one to choose. I know html/css and thats about it. My aim is game development on linux and windows platforms, and not much else. I wanted to start with programming some simple games for puppy. Also, one of the main reasons I still have a windows machine is because it is usually a pain in the arse to get games to work on linux, and there really aren't that many quality native linux games available imo. I would like something that I can learn fairly quickly and start pumping out some simple 2d games right away for starters. I did some research and so far it looks like a good place to start would be to learn Python am I right?

Also, is there a .pet or .pup available for chaidraw? or does anyone know how to get this tar.bz2 to work?
http://happypenguin.org/show?ChaiDraw

I downloaded it and it contains 3 non-executable files but i'm not sure what to do with them.

I'm new to the forums but have been using puppy linux for about 2 years now and have frequently visited the site.
[img]http://i56.tinypic.com/nwymax.png[/img]

Bosola
Posts: 19
Joined: Sat 25 Jul 2009, 12:45

#2 Post by Bosola »

It depends how far you want to go into it all. You might be best using a GPL 3d engine - like ioTech 3 (the open-source release of the Quake 3 engine), then building your games around that (a bit bulky for short games, though). Working around ioTech 3 would involve using C, but you've a flexible engine with lots of community support.

There's also Ogre, which has its own scripting language. As always, look at the Wiki list of open-source game engines - but, don't forget Flash. And you don't need Adobe's software to write and create .SWF files...

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

Re: Which programming language should I learn?

#3 Post by rarsa »

AF Branden wrote:My aim is game development on linux and windows platforms, and not much else.
Flash or DHTML games fall in that category.
You can certainly use OpenLaszlo to do this
http://www.openlaszlo.com

I've developed in Open Laszlo under Puppy.
usually a pain in the arse to get games to work on linux, and there really aren't that many quality native linux games available imo.
It really depends on what kind of games you want. First person shooters? No.
Board and strategy games, A lot and good quality.
I did some research and so far it looks like a good place to start would be to learn Python am I right?
Again it depends on what you want. If you want to learn how to progam using games as an excuse, then go directly to a language.

If you already know how to develop then go for a framework that allows you to focus on the game and not on the language.

In any event. To write good games, the most important parts are the visual aspects (for which you will need to learn how to manipulate images, think gimp, blender, etc) and game play, for which creativity and a lot of reading may be necessary.

For the actual mechanics of the game, there are multiple frameworks or libraries you can take advantage of.
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#4 Post by Pizzasgood »

For a 2D C or C++ game, you should look into SDL to handle the graphics.

Java is supposed to be pretty cross platform. Theoretically a Java program should "just work" on any OS with a java interpreter. I've only done a little bit of Java and haven't tested the program I made in Windows to verify it for myself yet, but I don't see why it wouldn't work. (Famous last words :lol:)

Python is also cross platform like Java, and seems pretty cool. Not sure how well it's suited for games. Blender uses Python though, so it can definitely handle 3D.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

Re: Which programming language should I learn?

#5 Post by rarsa »

AF Branden wrote:I've been wanting to learn a programming language for a long time now but i'm not exactly sure which one to choose.
Oops, I missed the first paragraph:

If you want to learn how to program and want to start by writing games Then go Python.

Python is a modern and very accessible language, clear to read, easy to learn, portable and with libraries to develop games

Here is a tutorial:

http://www.pygame.org/docs/tut/chimp/Ch ... yLine.html
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#6 Post by MU »

Vala/Genie.

I has bindings for SDL and OpenGL.
http://www.murga-linux.com/puppy/viewtopic.php?t=39560

Might be somewhat complicated for beginners.

Or SDLbasic:
http://www.sdlbasic.altervista.org/main/

Not much activity since a year, but has some great small, though stunning examples.
http://www.sdlbasic.altervista.org/main ... creenshots

The interpreter is pretty small, and like Puppybasic/GtkBasic based on wxBasic by David Cuny (small crossplatform Basic dialect).

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#7 Post by BarryK »

Ugh! I have a personal problem with Python, but that's just me.

If you want the game to run in Puppy, don't use Python. If you want max speed don't use Python. If you want tiny stand-alone game, don't use Python. If you want it to "just work" on Windows and Linux don't use Python.

My personal recommendation is Vala/Genie

http://puppylinux.com/genie
[url]https://bkhome.org/news/[/url]

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#8 Post by rarsa »

BarryK wrote:If you want the game to run in Puppy, don't use Python.
Oops. I also missed the paragraph saying that he wanted to write games for Puppy.

Maybe "learning to program" and "Games for Puppy", are somehow not a good match.

My personal experience is that people learn better by reading other people's code. And there are tons of Python examples.
If you want max speed don't use Python. If you want tiny stand-alone game, don't use Python. If you want it to "just work" on Windows and Linux don't use Python.
I stand by "If you want to learn how to program" Python is great.

So, for learning how to program in Puppy, Genie is a better option: Readily avaliable with Python syntax and existing code to use as examples

If he wants to develop games, having libraries is good because he will also understand concepts such as sprites, scenery, collision, camera angles, etc. Just by reading the documentation of the libraries he'll learn about game development.

Just reading the Vala/SDL example and comparing it with the sample code in the tutorial for pyGame, you'll see, why I think Python is better to learn how to program.

Of course, python being a scripting language will never be able to compete with a native executable in a complex game, but by the time he's ready for complex games, he'll be able to extrapolate the learning experience.

My two cents.
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#9 Post by Pizzasgood »

I agree, learning to code is more important at first than portability, efficiency, etc.


In the end, there isn't really a right or wrong answer. A lot of it is personal preference. Any of the languages we've listed will get the job done, and you aren't going to be tied into them for the rest of your life. Once you know the basics, it's pretty easy to pick up a new programming language, and a good idea to do so - different languages have different strengths. Using a bunch of languages is especially important for web developers. During my internship this last summer, I was using Bash, PHP, Perl, and JavaScript, in addition to HTML, CSS, and SVG. Being able to bounce around like that made things a lot easier, and if I couldn't have done that, I probably wouldn't have been hired for that particular job in the first place.

Video games are also good things to be linguistically nimble for. Say you make a big MMORPG. Perhaps the game engine uses C++ or Java. But the installer might use Bash. The webserver would probably have some PHP to interface with the DB so that players can visit the site and see eachother's stats. The game's scripting engine might read Lua or JavaScript (The Wolfire indie team is making a game called Overgrowth that will use a JS based scripting engine, and also are using Webkit for their user interface. This is a standalone game, not something played through the browser. And it will have a native Linux version. Check them out sometime. They're good people to pay attention to if you're interested in making games. They post a bunch of articles on elements of game design and what-not. Really interesting stuff.).


Anyway, what I'm trying to say is that you don't need to worry much if you start with the ideal language, as long as you don't take a particularly hard one (I would advise you to not start with C++ or Java). I think Rarsa probably has the right idea about Python. I've used a little of it and it seems like a pretty nice language. I probably wouldn't write a large game in it, but it seems like a good language to start with. Then once you're comfortable coding you could switch to Java or C/C++ or whatever. C/C++ would be the way to go if you want the game to be playable in Puppy with minimal dependencies. The Java runtime is nearly as large as Puppy himself (and back in "the day", Puppy was the smaller of the two!)


The most important things are to have fun and to learn. Always be learning. And as you learn to code, look at the world around you an think, "How would I implement that in code?" Good though exercises, and sometimes they can lead to new ideas for algorithms or games or whatever.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#10 Post by technosaurus »

You aren't alone Barry. Here are a few more python negatives.
I despise not being able to type ldd and determine all if not most dependencies.
Building python packages is a bear since new2dir make install won't work. (some use an equivalent python setup.py install --root=....)
If you leave just the .py files in your package to keep it small, then your save file gets filled with .pyc and .pyo files
Conversely if you distribute only .pyc files it is difficult to debug or track dependencies.

It seems that all of the best programs are written in C (some in C++), but perhaps that is because many of the best coders write in C, C++. This means that you can readily find tons of good code examples.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
AF Branden
Posts: 165
Joined: Tue 15 Sep 2009, 10:17
Location: United States, WA

#11 Post by AF Branden »

I really appreciate all of the quick and detailed responses i've gotten. You guys are great. I think I have enough information to get started now. I was looking into vala/genie but the tutorials and documentation don't look very newbie friendly, it looked pretty complicated; maybe i'll go back to it when i'm more experienced.

"Just reading the Vala/SDL example and comparing it with the sample code in the tutorial for pyGame, you'll see, why I think Python is better to learn how to program."

I see what you mean haha

I'm thinking Python is definitely the way to go for me. This website http://www.pygame.org/ that rarsa mentioned has Pygame available for download. Is there a way I can get pygame to work in puppy? Is there a pygame .pet or .dotpup? I see a tar.gz for download but i'm not sure what to do with the source. I guess I could always boot into windows but I would really like to learn with puppy. Btw that tutorial looks great rarsa, it looks like its a lot easier to understand than any of the other tutorials i've looked at.

I'm assuming all I need to get started is Python and Pygame correct?

Update: I found Python-2.5.2 .pet but not Pygame after browsing the forums.
[img]http://i56.tinypic.com/nwymax.png[/img]

dawg
Posts: 116
Joined: Sun 09 Aug 2009, 14:36
Location: still here
Contact:

#12 Post by dawg »

I don't consider myself an expert, and maybe I'm a little old-fashioned, but personally, I really like Pascal (turbo/free).
It is somewhat simple but not retarded like BASIC, it is more or less useful (I do most of my programming in Pas), and it isn't as cryptic/dubious as C/C++/Java.
I guess SDL would make a nice companion for game programming.
Also, Java and Flash are resource/CPU hogs, as far as I'm informed. I hate them, anyhow :D

Bosola
Posts: 19
Joined: Sat 25 Jul 2009, 12:45

#13 Post by Bosola »

Out of interest, the first games I produced were in BASIC. Yeah, I know.

Exactly what sort of games are you wanting to produce?

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#14 Post by rarsa »

dawg wrote:but personally, I really like Pascal (turbo/free).
Of course Pascal is a good language to learn to program, that's what it was created for. In my post above I was going to add "Equivalent in syntactical simplicity to Pascal" :)
Bosola wrote:Out of interest, the first games I produced were in BASIC. Yeah, I know.
Well, me too, That was the programming language for my first computer but even before knowing, I "knew" there was something wrong with the language. I jumped ship as soon as I learned something else (Turbo Pascal) and never looked back.
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to

User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

#15 Post by ttuuxxx »

I would say for games go with sdl, Its a small library, very common with games and there should be a host of how to build games with sdl, Where as Vala is still very new, not much documentation compared to sdl for games, actually are there even any games made for vala yet?
Or another alternative could be flash, flash games would work in puppy also without any extra libraries, which is always handy :)
Also C based games good, small and handy, like Xsoldier http://www.interq.or.jp/libra/oohara/xsoldier/
Now if you wanted to score some brownie points with a lot of forum members, add some sound to Xsoldier :) That was one of the biggest upsets of the game, or C based bejeweled game, There's one that uses lots of Gnome parts, which isn't good for puppy in general, but its GPL so you could "Borrow" the icons maybe, lol http://linux.softpedia.com/get/GAMES-EN ... 3449.shtml
anyways have fun :wink:
ttuuxxx
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)

dawg
Posts: 116
Joined: Sun 09 Aug 2009, 14:36
Location: still here
Contact:

#16 Post by dawg »

rarsa wrote:
Bosola wrote:Out of interest, the first games I produced were in BASIC. Yeah, I know.
Well, me too, That was the programming language for my first computer but even before knowing, I "knew" there was something wrong with the language. I jumped ship as soon as I learned something else (Turbo Pascal) and never looked back.
Commodore BASIC comes to mind :D (my first)

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#17 Post by rarsa »

dawg wrote:Commodore BASIC comes to mind :D (my first)
That was my second computer! :D
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#18 Post by Pizzasgood »

I started with a TI-83+ graphing calculator, which used BASIC. Much uglier than normal BASIC. Not only did it not support subroutines, but it also was limited to only 27 variables (A-Z, and also theta). If you needed any more, you had to use "lists", which were nameable arrays. Plus, variables and lists could only handle numbers. There were another six "str" variables that were specifically for strings. If you needed more, you had to encode them and store them in the lists, which was annoying because the thing had no concept of ascii, so you had to manually write an if-elseif chain for all 26 letters. And there wasn't any copy and paste either. On the plus side, you could simulate subroutines by having one program run another program. Not very convenient, but there weren't many other options.

If I ever need to write another program on that thing, I'm just going to learn z80 assembly and do it that way. It would probably be easier. And I'd get to write it on a PC with a keyboard and copy/paste, and a screen large enough to show more than 16x8 characters.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

caleb72
Posts: 57
Joined: Fri 15 May 2009, 12:44

#19 Post by caleb72 »

Personally I think Python is probably the best introduction into programming in general and also good for learning game programming. Not only because of the very readable syntax but also because of the wealth of free documentation and learning material available for it - not to mention a very large collection of libraries to program with.

Do I think it's actually the best general programming language and/or game programming language? Maybe - possibly not - depends on exactly what you're doing with it as even some very large commercial games use Python for some elements (as an example).

I'm very hopeful for the future of Vala/Genie and I reckon if you learn Python, by the time you find yourself proficient, hopefully Vala/Genie would have found its footing with more solid documentation, support etc..

Regards
Caleb

Post Reply