I have a question is there any advice for learning Ruby?
We code up about 60% of our backends with python. I am not best friends with the language, but it is plenty powerful for the real world. When you need high performance, you can drill down to C or assembly, but you are actually more productive when writing the other 90% of your code with a high level language.
"Never let the truth get in the way of a good story." TwitterRegarding Python, if you get a decent engine that uses Python as a scripting language—I use Panda3D, myself—then you might be surprised at the quality that can be achieved.
(That said, it might be worth noting that as far as I'm aware, Panda's internal workings are handled by C++. Additionally, highly intensive features—elements that involve fast iteration over thousands of objects, for example—might be better handled on the C++ side, too.)
edited 26th Jan '15 6:02:03 AM by ArsThaumaturgis
My Games & WritingThousands of objects are fine with python. I have never found python code to be the constraint before network or database I/O became a problem.
"Never let the truth get in the way of a good story." TwitterIt might depend on the machine, and what other constraints you have. I haven't dealt much with databases or networks in my own projects, but do seem to recall having large loops, repeated on each update, slow things down a bit in the context of a game. That was on a somewhat weak machine, I will admit.
For the sake of clarity, I should perhaps mention that a once-off (or infrequent) large loop may well be fine; attempting to implement a particle engine in Python might be a bit much if required to iterate over thousands of particles each frame, I feel, especially if paired with a non-trivial game taking up at least some CPU-time.
edited 26th Jan '15 9:08:30 AM by ArsThaumaturgis
My Games & WritingFor learning programming, something like Scratch might be useful. It uses snap-together blocks so you don't have to worry about typos at first, but still uses variables, expressions, etc, in a traditional manner.
As far as practical languages, I am a solid fan of the Lua+C combo. (Lua makes writing modules in C very straightforward.)
Do you highlight everything looking for secret messages?@Tangent: I haven't used Lua, let alone in combination with C: does the combination reduce the complexity, and handle the low-level issues (pointers, etc.) that usually come with C? My concern is that, as I recall it, C is not a wonderfully beginner-friendly language.
My Games & WritingMostly, yes. When Lua calls into your C functions, it's set up such that Lua "owns" pretty much every pointer you deal with, so if you use it idiomatically, then everything is garbage-collected by Lua for you.
Lua itself is a pretty high-level language, first-class functions and all. It uses a single complex data type for everything, the "table", which is basically a key-value map. Use integer keys if you need an array, store functions in it if you want an object with methods, it actually works pretty well. ("metatables" let you intercept undefined mappings for more classical object-class behavior.)
So basically, take the good pats of Javascript, remove most of the wtfs, give it Pascal syntax, and code the interpreter to run on almost every computing platform in the world.
edited 26th Jan '15 6:00:11 PM by Tangent128
Do you highlight everything looking for secret messages?Ah, that's pretty cool! Without having seen it myself I'm hesitant to recommend it, but based on your description it does sound like it could be pretty beginner-friendly. ^_^
My Games & WritingOne thing I REALLY had to get used to when writing Python was the importance of whitespace. Every other language I write in just ignores it.
Heh, that can take some getting used to—but I do like it, and think that it may make Python especially good as a language for beginners by virtue of instilling a habit of indenting one's code.
edited 1st Feb '15 8:42:31 AM by ArsThaumaturgis
My Games & Writingi don't like the whitespace thing because a tab is interpreted differently than spaces but you can't see the difference with your eyes.
"Never let the truth get in the way of a good story." TwitterI actually just taught myself a bit of Python just now. I wrote a program to give me a list of Green Stars to get in a playing session each time I run it.
edited 1st Feb '15 5:08:00 PM by Linhasxoc
Heh, you remind me of little applications of Python that I've made in the past, in particular a brute-force approach to solving a particular word-puzzle from The Fool's Errand, and printing out a set of steps to solve a larger Towers of Hanoi puzzle than I cared to solve by hand (which was presented in another game)...
My Games & WritingVim is my primary driver and while it can do that, the reason I learned vim was because at my previous job, I was spinning up a new virtual machine every few hours for testing and had to play with them over ssh rather than through a gui. At that point you force yourself to be as lean as possible.
Same deal at my current job, kinda. If I want to whip up a script on one of our production read boxes or someone else's dev machine, I don't want to install anything beyond what is already there, nor do I want to touch any settings.
It's kind of a weird reason, but yeah. between that, the inconsistent naming in fire core libraries, the obnoxious ternary statement, and various other things, I'm not really friends with python, but I am otherwise okay with using it every day.
"Never let the truth get in the way of a good story." TwitterFair enough, that makes sense, I believe.
In my case, I use Stani's Python Editor—not perfect, but quite usable, I've found. I think that I have it set to automatically convert tabs to spaces.
I'll confess that I looked up the ternary operator (my terminology may be a little rusty ^^; )—I take it that you mean the "?:" operator? It's not one that I would be likely to use—I find it a little counterintuitive, I suppose—but, having looked it up, I do think that I see what you mean, in that it seems to be rather different to the usual syntax.
My Games & WritingFor the record, I recommend against starting with Python. It has a special syntax that isn't really shared by any other language, and it hides a lot of rather important stuff inside black boxes. The latter might not be such an issue for someone who just wants to do simple game programming and doesn't care about the more intricate parts of computer science and algorithm design, but both characteristics will make it harder to move to any other language later on.
Join my forum game!I'm curious about which black boxes you mean.
personally, I find I learn best when I see what a wheel is supposed to do before I try to reinvent it. Or sometimes I just want to learn how to build a cart.
"Never let the truth get in the way of a good story." TwitterI think it depends on your philosophy towards teaching programming and/or computer science. I lean towards the school of "start with the high-level concepts, then make your way down as you go." So for an aspiring programmer, I'd start out with something that doesn't make you think about low-level details like Python. (Java is OK too, but it has some issues.) Once you've mastered the high-level concepts I'd move on to something like C, and from there a bit of computer architecture. Once you get the whole picture, you can then better understand more advanced topics.
Yes, that exactly how my college's CS department structured their curriculum, why do you ask?
There are, but the same can be said about java, and java is pretty accepted in the classroom. even c++ comes standard with the vector structure.
"Never let the truth get in the way of a good story." TwitterI'm inclined to agree with Linhasxoc, I believe: it seems to me to be a good idea for a beginner to start with a language that allows them to learn the fundamentals of programming without having to worry about too many various low-level concerns; to start with a relatively simple environment in which to work. Thus, when they move on to more difficult languages they already know the basics and can concentrate on picking up the complexities.
(And yes, that was how my Computer Science degree taught it too, starting with Java before moving on to C++, as I recall.)
edited 5th Feb '15 6:43:04 AM by ArsThaumaturgis
My Games & WritingIt almost seems like people are making their suggestions based on how they personally learned to code.
Except for me, it would be the opposite. I actually picked up C first, then C++, then Java, then Python (not in college, but from a startup company I was involved in part-time).
edited 5th Feb '15 7:19:31 AM by KylerThatch
This "faculty lot" you speak of sounds like a place of great power...I started really learning with Forth and Javascript.
Anybody who knows Forth will find that a probably hilarious combination, but it was effective
Do you highlight everything looking for secret messages?
Python is a good starter language. You can make some decent games with it, but you obviously shouldn't expect something along the lines of a AAA Ubisoft game. I just finished my Python course last semester and I'm making a second go at C++. C++ is a considerably more difficult language, but it's also much more versatile.