Butterman
Gief Pandara
Actually, prototype first, plan second, code later.
Lunatic said:Hi, I'm a complete novice to game programming; the only thing I've ever made was a crappy Pacman clone with pygame. I'm pretty comfortable with C/C++ and Java, Python, Lua, and have been messing around with Haskell for a couple of months on and off. I guess my main problem is that I get these grandiose ideas, but don't have the experience to execute them.
Lunatic said:Hi, I'm a complete novice to game programming; the only thing I've ever made was a crappy Pacman clone with pygame. I'm pretty comfortable with C/C++ and Java, Python, Lua, and have been messing around with Haskell for a couple of months on and off. I guess my main problem is that I get these grandiose ideas, but don't have the experience to execute them.
Kurupted_Magi said:Lunatic said:Hi, I'm a complete novice to game programming; the only thing I've ever made was a crappy Pacman clone with pygame. I'm pretty comfortable with C/C++ and Java, Python, Lua, and have been messing around with Haskell for a couple of months on and off. I guess my main problem is that I get these grandiose ideas, but don't have the experience to execute them.
That is a huge setback for me right now ^^ I have four ideas for complete, shelf quality games (though all my private work will be in 16 or 32 bit graphics, love the old stuff!). I am pushing myself every day with these in mind when I should relax and have a knowledge of the langauges in mind 0.o You definitely have some languages under your belt though ^^ I am still trying to gain C++, don't know what I will hit next... -Magi
amf66 said:Hi everyone! I've made a few posts in some other threads about wanted to learn to program, and now I'm ready to start. Before, I had decided to learn C++, since I took a class in it last summer, but I've heard a lot of good things about Python recently. I've forgotten most, if not all, of what I learned at the class, so I'm thinking about started fresh with Python. Most of you seem to like C++, but say it can be confusing and unintuitive at times. I want to start out making simple programs at first, and then maybe make some games for the Pandora. What do you guys think?
proflogic said:amf66 said:Hi everyone! I've made a few posts in some other threads about wanted to learn to program, and now I'm ready to start. Before, I had decided to learn C++, since I took a class in it last summer, but I've heard a lot of good things about Python recently. I've forgotten most, if not all, of what I learned at the class, so I'm thinking about started fresh with Python. Most of you seem to like C++, but say it can be confusing and unintuitive at times. I want to start out making simple programs at first, and then maybe make some games for the Pandora. What do you guys think?
Sounds like a good idea to me.
C++ is the language of choice for some performance-critical applications (like games) for a number of reasons:
- It is object-oriented, which tends to be the more intuitive paradigm for games.
- It's a mature language with much development done in compilers. This allows object code to be better optimized.
- It is a compiled language that gives the programmer significant control over the object code.
There are some tradeoffs:
- The OOP paradigm tends to produce slower code than the procedural paradigm (C++ is slower than C, if you know what you're doing).
- It's a very complex language, making it easier to make mistakes and introduce bugs.
- Managing memory can be very tough to get right.
- The more direct access to memory must be treated with care. It's easy to introduce security holes that give up half the battle to crackers.
Haha, someone else can verify those. I actually have never used C++, but... I know there have been papers detailing the performance deficits of OOP, my professor in the compilers course echoed what Senor Quack said about C++'s commplexity, and I'm familiar with smashing the stack and other simple methods of exploitation. From what I understand of C++, the above holds true.
I would say no to C++. Sure, it's fast, and it has its advantages, but it is a really difficult language to start programming "for real" in.amf66 said:Anyone else?
const float (*GameObject::distanceGetter)(const GameObject &) = &myObject.distanceTo;
void MyObject::doSomething()
{
ref_ptr<MyOtherObject> obj = new MyOtherObject;
obj.doStuff();
//You don't have to say "delete obj;" here; the ref_ptr deletes its
//contents automatically!
}
//MyCounter.cpp:
int i = 0; //← not in a class
int MyCounter::getNextInt()
{
return ++i;
}
amf66 said:dflemstr: Your post was very informative, and now I don't think I'll learn C++ first. However, you say that Python is well-designed in the fifth paragraph, but you also say it wouldn't be at the top of your list, because it doesn't use static typing. So would you recommend Java? I took a class in Java two years ago, but I've lost all my work since my flash drive disappeared. (I now keep backups) I think I could relearn the basics quickly because of this, so maybe Java is the best for me. But, for Java you have to have a virtual machine to run the programs. Do you know if there are any JVM's for arm-linux and the Pandora? I found one called JamVM, which says it works with Linux using the ARM architecture. Have you heard of this?
Everyone, thank you for your responses and patience with me!
A small comparison thingy for those two languages:amf66 said:However, you say that Python is well-designed in the fifth paragraph, but you also say it wouldn't be at the top of your list, because it doesn't use static typing. So would you recommend Java?
//This isn't actually valid Java:
Function<Void> x = System.out.println("Hello World!");
x();
Runnable x = new Runnable {
@override
void run() {
System.out.println("Hello World!");
}
}
x.run();
import java.awt.*;
import java.applet.*;
public class MyApplet extends Applet {
public void init() {} //Empty because we don't need to do any initialization
public void stop() {} //Empty because we don't have to clean anything up at the end
public void paint(Graphics tmp) { //This is called every time the applet wants to be redrawn (e.g. when a window moves over it)
//"Graphics" is an old object that was used in Java 1.0.
//Since then, Sun has added a Graphics2D interface that
//supports more things, such as anti-aliasing, faster
//drawing, better font support, more options etc.
//However, so as not to break old code, you still have
//to use "Graphics" in the "paint()" method declaration
//We cast our "Graphics" object to a "Graphics2D" object here:
Graphics2D g = (Graphics2D) tmp;
//"g", our Graphics2D object, is now the object we use to draw things:
//Pick a color
g.setColor(Color.red);
//Fill one quarter of the screen with the color:
g.fillRect(0, 0, this.getWidth / 2, this.getHeight / 2);
}
}
int sum(int[] numbers) {
int result = 0;
for(int x : numbers)
result += x;
return result;
}
def sum(numbers):
result = 0
for x in numbers:
result += x
return result
Well, for Python you need a Python interpreter to run the programs, so it's not really that much of a difference!amf66 said:I took a class in Java two years ago, but I've lost all my work since my flash drive disappeared. (I now keep backups) I think I could relearn the basics quickly because of this, so maybe Java is the best for me. But, for Java you have to have a virtual machine to run the programs. Do you know if there are any JVM's for arm-linux and the Pandora? I found one called JamVM, which says it works with Linux using the ARM architecture. Have you heard of this?
dflemstr said:Java is really fast. According to this benchmark, only Ada (a procedural programming language), C, C++ (you know these) and Scala (a language that runs on the JVM like Java; my favorite language btw) are faster than Java. People make you believe that Java is slow, and well, it *is* slow: about 2x as slow as C, but Python is 346x slower than C (in that fannkuch benchmark) so it's all relative.
Yeah, well, they obviously use all kinds of hacks to squeeze out every last bit of performance in those benchmarks... You should see the source codeproflogic said:dflemstr said:Java is really fast. According to this benchmark, only Ada (a procedural programming language), C, C++ (you know these) and Scala (a language that runs on the JVM like Java; my favorite language btw) are faster than Java. People make you believe that Java is slow, and well, it *is* slow: about 2x as slow as C, but Python is 346x slower than C (in that fannkuch benchmark) so it's all relative.
Whoa, the fastest scala implementation uses an order of magnitude more memory than Java. In most of the benchmarks, they seem comparable, but there are a few crazy ones.