Author Topic: What programming language would you reccomend?  (Read 22584 times)

0 Members and 1 Guest are viewing this topic.

Offline Dullstar

  • Posts: 2092
    • View Profile
    • Leafwing Studios Website (EXTREMELY OUTDATED)
What programming language would you reccomend?
« on: June 09, 2009, 11:08:53 PM »
Hey.  I'm working on two game projects, an action/adventure game and an RPG.  While I could use game development software, it wouldn't be a good idea since I need it to work on at least Windows and Mac (because of crashing issues, I don't want to force my players to use Windows!  Also, while this may not happen for a while, my next computer will probably be a Mac).  I understand this would require edits, but what programming language is easiest to use that would be able to do both OSes with the least amount of change between the two versions of the coding?

Keep in mind that I need something that is very basic to learn, as I am new to the programming field.  If anyone knows any way to convert a .exe file for Windows into something that would work with Mac, that will do, too.

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: What programming language would you reccomend?
« Reply #1 on: June 09, 2009, 11:25:25 PM »
Cross-platform support can be tricky in general, and definitely limits the programming languages you should consider.

I'm not an expert at this though.  I know Java is designed to be platform-independent (Lemmini uses it), so it's a good choice in terms of that requirement, but I'm not sure whether it counts as "very basic to learn".

There's also BlitzMax, which is based on BASIC, so it might be easier to learn.  It does cost you $80 US dollars though, and I think you actually need a Mac to compile your program for the Mac.

I'm definitely not an expert on this, so hopefully someone else can chime in with better ideas.  Who knows, maybe there is some game development software out there that supports both PC and Mac.

If anyone knows any way to convert a .exe file for Windows into something that would work with Mac, that will do, too.

I can tell you that definitely won't happen.  There are just way way too many differences to bridge.  You generally need some sort of emulator like WINE to run Windows programs on a Mac, and be prepared that things won't be 100% compatible (kinda like how not all DOS games work well in DOSBox).

Offline Dullstar

  • Posts: 2092
    • View Profile
    • Leafwing Studios Website (EXTREMELY OUTDATED)
Re: What programming language would you reccomend?
« Reply #2 on: June 09, 2009, 11:29:53 PM »
Ouch.

Offline GuyPerfect

  • Posts: 363
    • View Profile
Re: What programming language would you reccomend?
« Reply #3 on: June 10, 2009, 02:30:01 AM »
because of crashing issues, I don't want to force my players to use Windows!
Well, so much for us Linux users. Oh, and if you don't want crashing, don't code something that will crash. Two and two, man!

Your best bet for cross-platform would be C, as it's generally the first language supported on new architectures. Its cousin, C++, is a bit easier to use, but at a hefty expense to performance because it takes care of a lot of memory management in overhead that you'd otherwise do yourself in C.

Keep in mind that things like windows, sound, graphics output and network interactions will need different code depending on the target operating system, even if you're using a programming language that is supported on all your target systems.

Your best bet for ease of learning is BASIC, though support for that language tends to be minimal at best, and often commercial. What I recommend is that you learn the basics (no pun intented) of programming in BASIC, then shift over to C to make programs with more control over what the computer actually does. The best C programmers have a good understanding of what the computer will physically do when it runs their compiled code.

Another word of advice is that you DO NOT look into a language for the purpose of completing your projects in the quickest and most effortless manner possible. If you're only looking into programming because of the end result of what you could do with it, you've already doomed yourself to fail.

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: What programming language would you reccomend?
« Reply #4 on: June 10, 2009, 04:23:35 AM »
Your best bet for cross-platform would be C, as it's generally the first language supported on new architectures. Its cousin, C++, is a bit easier to use, but at a hefty expense to performance because it takes care of a lot of memory management in overhead that you'd otherwise do yourself in C.

There is a specific reason why I did not recommend C or C++.  The C syntax can look a little crazy for beginners (sure, not as "bad" as something like Perl, but still), and more importantly, it is easy to do things in that language that works on one platform but doesn't in another, or even stuff that only works on specific compilers, even ignoring all the windows/sound/graphics/network stuff.  In other words, it takes a little bit of care to avoid doing stuff in ways that are not platform-independent.  C++ might be slightly better in that regard but since you can still do C things in C++, you can still run into these issues.

Also, it's a toss-up to say whether C++ is really "easier to use" than C.  In my experience, some of the additional features in C++ supports add a whole other layer of subtle bugs and gotchas in your programming if you aren't careful.  It is definitely a more powerful language, but that extra power comes with extra care in learning and using the language.  In other words, probably not something for a beginner.

And as sound and graphics are bread and butter for game programming, you are not getting platform independence if you really need very different code for different target OSes.  Fortunately, C and C++ are so widely used that there should be a number of libraries like SDL that goes a great way towards making sound and graphics programming mostly platform independent in C/C++.

Keep in mind that things like windows, sound, graphics output and network interactions will need different code depending on the target operating system, even if you're using a programming language that is supported on all your target systems.

This is one reason I mentioned Java and BlitzMax.  Those languages include platform-independent support for things like sound and graphics that are bread and butter for game programming.  I don't programming much with those languages so I can't say how well the platform-independence work in practice, but at least we know that they design the whole thing with platform independence in mind.

Quote
Another word of advice is that you DO NOT look into a language for the purpose of completing your projects in the quickest and most effortless manner possible. If you're only looking into programming because of the end result of what you could do with it, you've already doomed yourself to fail.

I sorta know what you're trying to say, but surely, one of the great things about programming is in fact the end result, the new programs that you can write to do the things you want done! :P

Offline Dullstar

  • Posts: 2092
    • View Profile
    • Leafwing Studios Website (EXTREMELY OUTDATED)
Re: What programming language would you reccomend?
« Reply #5 on: June 10, 2009, 05:23:54 AM »
Since the game is freeware, I need to stay on a minimal budget.  Even the website is backed by free web hosting.  Without ads!

Also, I must point out, I am not screwing Linux users.  I would love it if it worked on Linux, but I want to take care of Mac and Windows first.

And by the way, it's being released in a version 1.1.0, the first after all the testing releases.  I will modify code to fix bugs through the whole thing.
For anyone who's interested, releases are in an x.y.z format, in which x is the episode (game) number (since it's a long storyline, and we don't want to constantly be updating graphics and the engine every time we make a sequel), y is the major release number, hitting 1 after the first complete release, and z being the code version number (for minor changes).

Is there a good Java coding program at very little or no cost?

Offline GuyPerfect

  • Posts: 363
    • View Profile
Re: What programming language would you reccomend?
« Reply #6 on: June 10, 2009, 05:39:28 AM »
[...] it is easy to do things in [C] that works on one platform but doesn't in another, or even stuff that only works on specific compilers, even ignoring all the windows/sound/graphics/network stuff.

I don't follow you here. To me, saying something like "StringsByID = malloc(NumStrings * sizeof(void *));" is going to be the same no matter what system you're running. Anything that's even remotely platform-specific is going to be pulling off of libraries designed specifically for the platform itself, so you're not going to accidentally do anything that will trip you up when you try to compile.

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: What programming language would you reccomend?
« Reply #7 on: June 10, 2009, 08:32:16 AM »
I don't follow you here. To me, saying something like "StringsByID = malloc(NumStrings * sizeof(void *));" is going to be the same no matter what system you're running.

Well for starters, if you start writing things to files and you want the files to be binary compatible across platforms, forget doing something like

fwrite((void *)arrayOfInts, sizeof int , numElementsInArray, file);

fwrite((void *)&mystruct, sizeof(mystruct), 1, file);

Problems?  Well let's see:

1) the bytes that make up an int are stored differently on different platforms.  Intel (x86) use little-endian, meaning least significant byte first.  Other CPUs such as PowerPC and Motorola 68xxx (for Macs) use big-endian, meaning most significant byte first.  Reading and writing the bytes out directly like the code above means files created by your program on one platform will not read with the correct values on another.

2) struct is another example.  Here the problem is that the C language leaves the alignment of members within a struct up to the compiler.  Meaning the members in a struct don't have to come in consecutive bytes; there could be unused bytes between members to optimize perf based on the CPU.   In other words, given a struct

struct a
{
    char a;
    int b;
}

Even sticking to one particular CPU where int is 4 bytes, sizeof(struct a) can still differ depending on compiler and compiler settings.  For example, it's likely that the compiler will try to align the int to 4-byte boundary by adding 3 unused bytes between char a and int b, making the struct 8 bytes.

3) speaking of ints, guess what the language says about sizeof(int)?  Absolutely nothing.  You are saved mainly by the fact that most people currently has 32-bit CPUs, where sizeof(int) is likely 4 bytes.

Another area where C is notorious unspecific relates to order of operations.  Again this is not even a cross-platform issue; it can vary between compilers.  For a sampling, consider the following examples from the C FAQ:

Code: [Select]
3.1 Why doesn't this code:

a = i++;
work?

3.2 Under my compiler, the code

int i = 7;
printf("%d\n", i++ * i++);
prints 49. Regardless of the order of evaluation, shouldn't it print 56?

3.3 I've experimented with the code

int i = 3;
i = i++;
on several compilers. Some gave i the value 3, and some gave 4. Which compiler is correct?

3.7 Why did

printf("%d %d", f1(), f2());
call f2 first? I thought the comma operator guaranteed left-to-right evaluation.

The danger here is that if you are unaware of these sorts of things and don't take care to avoid these sort of unspecified expression evaluation order in your code, you can end up writing something that works fine on one compiler (say, the one you are using to compile for x86), but inexplicably works differently on another compiler (say, the one you use for compiling for Mac/PowerPC).

Finally, many popular compilers (like Visual C++ from Microsoft) often add a lot of extra stuff on top of the standard, such as compiler-specific preprocessor directives, extra library functions outside of the standard, etc.  It is possible for someone to learn C using a specific compiler and unaware that some of the things they are using are compiler-specific or runtime-library specific, and then end up with source code that fail to compile on another compiler, or worse, compile but doesn't work properly during runtime.  This is especially easy to do with runtime library functions, since it's easy for someone to look up one in their compiler's help documentation and use it, without paying attention to whether that library function is actually in the standard and therefore supported by all standard-compliant compilers.

============

In summary, it is possible to write portable code in C, but it is not automatic from merely learning to program in C; you need to be conscientious of these "gotchas" hidden in the language that can work against you in code portability.

Offline The Doctor

  • Posts: 301
  • Jason the Human
    • View Profile
    • zapzupnz.com
Re: What programming language would you reccomend?
« Reply #8 on: June 10, 2009, 11:38:21 AM »
My recommendation is C#, in Mono and using MonoDevelop. Why?

It's available for Linux, Mac OS X, and Windows (and Windows can of course run the software against the .NET Framework). You run Linux, so there we go. To do the game parts, you could use SdlDotNet (also for all three of the aforementioned platforms). This is a check against your list.
From my experience coding my current clone, I don't need to make too much changes from one to the other so that is another check against your list. I have it in Windows and Mono at the moment with no trouble.

C# is also very easy to learn, I have found. There's a wealth of knowledge on C# in many popular learning series (for Dummies, teach yourself in x minutes, etc). It is an object-oriented language, which makes things so much much simpler in large projects. It also has garbage collection, which means you don't need to deal with some of the nitty gritty details like memory management.

Many people will say that perhaps there are more powerful languages, or blah blah blah. Well, I think C# is plenty powerful and further more hits that button which is quite important: easy to learn. Remember, you'll get alot of suggestions Dullstar, pick whatever YOU think matches YOUR needs. Don't let people tell you that you need "x feature" and "y feature". Get what you want, mate!
This Lemmings forum is simply *fabulous*!

Offline Dullstar

  • Posts: 2092
    • View Profile
    • Leafwing Studios Website (EXTREMELY OUTDATED)
Re: What programming language would you reccomend?
« Reply #9 on: June 11, 2009, 01:01:44 AM »
I'm probably best with Linux, Windows XP (Mr. K helped reinstall it so it works), and a version of Mac OS X (Tiger?).  I can test on these.

I haven't used Linux recently, actually, though I still have it, assuming Mr. K's idea of backing up the partition worked (it hasn't been checked yet).

For the points ccexplore brought up, I think I should do the "Hello World" program with Jason's suggestions as a check to see if it will work.

I'm okay with making changes as long as they don't get too complicated.

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: What programming language would you reccomend?
« Reply #10 on: June 11, 2009, 01:29:45 AM »
I still think it's worthwhile to try and see if there're game development software that are cross-platform, like a cross-platform version of GameMaker or something.  Graphics and sound programming is often the trickiest and most time-consuming part of game programming, and if someone's already done the work out there (like a GameMaker type thing), why reinvent the wheel?

Offline GuyPerfect

  • Posts: 363
    • View Profile
Re: What programming language would you reccomend?
« Reply #11 on: June 11, 2009, 06:08:27 AM »
Forward: This post is largely in disagreement to ccexplore's last post. Apologies in advance. (-:

Quote from: ccexplore
1) the bytes that make up an int are stored differently on different platforms.

I will concede that this is a consideration that will not be apparent to new developers, but I always encourage using only char arrays when dealing with any kind of streaming I/O. It avoids the problem altogether as well as enforces strict and consistent formatting.

Quote from: ccexplore
2) struct is another example.  Here the problem is that the C language leaves the alignment of members within a struct up to the compiler.

This is a feature of the language. The C specification makes no guarantee that elements within structs fall sequentially in memory, on a given byte boundary or even in the same order as the definition in the source code. This falls into the category of "know what you're using."

Quote from: ccexplore
3) speaking of ints, guess what the language says about sizeof(int)?  Absolutely nothing.

Like the above, the sizes of most data types are not guaranteed and ALL processing that needs to know how big they are should use the sizeof operator. Like my example in my previous post, I use sizeof(void *) because there's no way to determine how many bytes are used for pointer variables. This is a fundamental consideration in programming with C: it's not something a developing programmer should be unaware of unless they're doing their own research and overlook it.

Quote from: ccexplore
Another area where C is notorious unspecific relates to order of operations.  Again this is not even a cross-platform issue; it can vary between compilers.

This is simply incorrect. The C standard explicitly defines lexical conventions such as the order of processing and the activity carried out by all operators in the language.

Code: [Select]
3.1 Why doesn't this code:

a = i++;
work?

It does work, so long as a[] has enough indeces to write the value of i. i will be incremented after a[i] is written.

Code: [Select]
3.2 Under my compiler, the code

int i = 7;
printf("%d\n", i++ * i++);
prints 49. Regardless of the order of evaluation, shouldn't it print 56?

++, as it appears after a variable, is executed last after all other operations. If I = 7 and A = I++, A == 7 and I == 8 after the assignment. To increment the value before any other processing, use ++ before the variable. If I = 7 and A = ++I, A == 8 and I == 8 after the assignment. In the printf() call above, 49 is the correct output, and i is incremented twice to have a new value of 9 afterwards.

Code: [Select]
3.3 I've experimented with the code

int i = 3;
i = i++;
on several compilers. Some gave i the value 3, and some gave 4. Which compiler is correct?

Assuming the state of i after the i = i++ statement, the correct value for i will be 4. First, i is assigned the value of i (3). Second, the value of i is incremented to become 4.

Code: [Select]
3.7 Why did

printf("%d %d", f1(), f2());
call f2 first? I thought the comma operator guaranteed left-to-right evaluation.

As with the above examples, the compiler that calls function f2() first is defiant of the C specification. All parameters of a function should be evaluated in order from left to right.

Quote from: ccexplore
The danger here is that if you are unaware of these sorts of things and don't take care to avoid these sort of unspecified expression evaluation order in your code, you can end up writing something that works fine on one compiler (say, the one you are using to compile for x86), but inexplicably works differently on another compiler (say, the one you use for compiling for Mac/PowerPC).

While I agree that the above are indeed legitimate causes for distress by code being interprated in multiple ways by various compilers, it's not because of the C programming language; it's because of the compilers failing to adhere to the C specification. Though to be honest, I can't think of any code I've written that uses i++ except as a statement by itself, and I've never used ++i.

Quote from: ccexplore
It is possible for someone to learn C using a specific compiler and unaware that some of the things they are using are compiler-specific or runtime-library specific, and then end up with source code that fail to compile on another compiler, or worse, compile but doesn't work properly during runtime.

Again, any extensions to the standard C specification are not C; they are simply add-ons and should not be treated as parts of the language.

Again, sorry to be all "No, you're wrong!" here, but the general premise behind the exceptions you cited boil down to whether or not the program and compiler adhere to the C specification.

Offline The Doctor

  • Posts: 301
  • Jason the Human
    • View Profile
    • zapzupnz.com
Re: What programming language would you reccomend?
« Reply #12 on: June 11, 2009, 06:38:13 AM »
Very interesting points all around, but may I just suggest we stick to the topic of finding a relatively easy to learn programming language for Dullstar? :P

I'll probably get shot for suggesting such a terrible thing, lol. :P
This Lemmings forum is simply *fabulous*!

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: What programming language would you reccomend?
« Reply #13 on: June 11, 2009, 02:06:24 PM »
(Sorry in advance for the long post.)

Forward: This post is largely in disagreement to ccexplore's last post. Apologies in advance. (-:
There's a reason I quoted the C/C++ Faq.  I suggest you take some time to read it.

Quote from: ccexplore
1) the bytes that make up an int are stored differently on different platforms.

I will concede that this is a consideration that will not be apparent to new developers, but I always encourage using only char arrays when dealing with any kind of streaming I/O. It avoids the problem altogether as well as enforces strict and consistent formatting.

Char arrays doesn't exactly "avoid the problems altogether", at the end of the day, you still need to learn to turn an int into bytes in a platform-independent manner.  Either you learn about endianness and have different code for serializing ints in different platforms, or you learn to do it arithmetically using shifts and bitwise-logic operators.  You need to solve the problem if if there's a chance that your program produces files in one platform that may be consumed in another (eg. a savegame emailed from a PC user to a Mac user, say).

It would've been a better suggestion if you suggest to avoid binary file formats.

Quote from: ccexplore
2) struct is another example.<snip>

<snip>This falls into the category of "know what you're using."

And my point is, I feel there're a lot of "you better know what you're using" in C.  Hence maybe not a top recommendation for beginners. ;P

Quote from: ccexplore
3) speaking of ints, guess what the language says about sizeof(int)?  Absolutely nothing.

Like the above, the sizes of most data types are not guaranteed and ALL processing that needs to know how big they are should use the sizeof operator.

Remember I'm still talking in the context of file I/O.  Notice that I used sizeof(int) in the example code, but that still means your code can end up writing (say) 4 bytes to the file in one platform and (say) 8 bytes in another, and so files produce in one platform may not be consumed correctly in another.  The most logical thing to use (sizeof operator) actually works against you in this case.

Quote from: ccexplore
Another area where C is notorious unspecific relates to order of operations.  Again this is not even a cross-platform issue; it can vary between compilers.

This is simply incorrect. The C standard explicitly defines lexical conventions such as the order of processing and the activity carried out by all operators in the language.

Please read the examples I quoted from the C FAQ.  That webpage has the correct answers to the questions; I think you'll learn a thing or two, based on your response to those questions.

Obviously I don't mean that there are no order of operations whatsoever, but there are plenty of cases where the standard actually specifically leaves the ordering open (unspecified) to a certain extent, for compilers to do what's best/easiest on the target platform.  Particularly operators with side effects.

Though to be honest, I can't think of any code I've written that uses i++ except as a statement by itself, and I've never used ++i.

That's exactly what I mean when I say "take care to avoid these sort of unspecified expression evaluation order in your code".  You learn to write your code in ways that make the ordering as explicit as needed.  Then again, printf("%d %d", f1(), f2()); doesn't exactly look like there's a problem on first glance does it?

Again, any extensions to the standard C specification are not C; they are simply add-ons and should not be treated as parts of the language.

Yes, but people usually don't learn C by reading the standard C specification.  For a beginner learning C, depending on how they learn the language, they may not be consistently aware of what is part of the standard and what isn't.  Think of my example of someone looking up a function from the help documentation.

Again, sorry to be all "No, you're wrong!" here, but the general premise behind the exceptions you cited boil down to whether or not the program and compiler adhere to the C specification.

My general premise is that C has a number of gotchas that can work against a beginner, especially in the context of making sure their code works correctly cross-platform.  That said, you can turn this around and say it'd be a good exercise for someone to learn to use the language properly.

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: What programming language would you reccomend?
« Reply #14 on: June 11, 2009, 02:14:39 PM »
For the points ccexplore brought up, I think I should do the "Hello World" program with Jason's suggestions as a check to see if it will work.

That's traditionally what they start with for teaching programming to someone.  Definitely go through the "Hello World" exercise, but make sure at some point you also do a more enhanced "Hello World" that involves graphics and sound, to get yourself familiar with whatever language/platform/library you end up using for graphics and sound programming.  Good luck with your game projects!

Offline GuyPerfect

  • Posts: 363
    • View Profile
Re: What programming language would you reccomend?
« Reply #15 on: June 11, 2009, 04:57:12 PM »
There's a reason I quoted the C/C++ Faq.  I suggest you take some time to read it.

I started looking around, but didn't get very far knowing it was a freelancer's work and glorified IRC log. Forming arguments on a subjective work while ignoring official documents won't help people be informed on the matter. I recommend consulting the C standard instead.

My general premise is that C has a number of gotchas that can work against a beginner, especially in the context of making sure their code works correctly cross-platform.  That said, you can turn this around and say it'd be a good exercise for someone to learn to use the language properly.

The main issue I have with this is that you're asserting potential difficulties as being the fault of the C language itself, while my 15 years of experience, researching and academics suggest otherwise. It's true, however, that the programmer may need to be aware of inconsistencies between their target platforms and their compilers. Having said that, I don't think it's appropriate to put C's name on those inconsistencies and draw a fanged face on it with a crayon.

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: What programming language would you reccomend?
« Reply #16 on: June 11, 2009, 08:26:02 PM »
There's a reason I quoted the C/C++ Faq.  I suggest you take some time to read it.

I started looking around, but didn't get very far knowing it was a freelancer's work and glorified IRC log. Forming arguments on a subjective work while ignoring official documents won't help people be informed on the matter. I recommend consulting the C standard instead.

I suppose you don't care for Wikipedia either.  It is amazing though that you'd dismiss something as "subjective work" without so much as a look on it.  If you read one of the answers you may notice that they usually quote the relevant sections in the various standards and more official documents to back their explanations.

Anyway, it doesn't change the fact that you're wrong in the questions I quoted from the website related to expression evaluation.  Look at Annex C in the standard you referenced for a list of sequence points defined by the standard, and look at what the standard says in example 7 in section 5.1.2.3, which comes quite close to one of the expressions from the C FAQ whose value is unspecified by the standard.

The main issue I have with this is that you're asserting potential difficulties as being the fault of the C language itself, while my 15 years of experience, researching and academics suggest otherwise. It's true, however, that the programmer may need to be aware of inconsistencies between their target platforms and their compilers. Having said that, I don't think it's appropriate to put C's name on those inconsistencies and draw a fanged face on it with a crayon.

 :D You know, you're sounding almost like I've offended your religion or something.  No one's "blaming" the language for its "difficulties".  The language cannot read the programmer's mind; it's always the responsibility of the programmer to make sure that the code they've written reflects the functionality they intend.  I'm only stating my belief that it takes a little more for a beginner to properly use C to write and debug programs that work on multiple platforms, as compare with other languages out there that have been designed from ground up to more explicitly support platform independence.  These little issues I mentioned about C are but merely one of the points I raised in my original post explaining why I disprefer C/C++ in answering DullStar's question.  I never imagine you would drag this one point out into an off-topic discussion.

There's actually one other thing which I haven't even begin to touch on, which you're surely aware of.  C and C++ gives the programmer complete control over memory management.  And of course, in practice in the industry, this is where you have your source of things like memory leaks that eventually slows down the computer, and buffer overruns that lead to security vulnerabilities.  Again, certainly not the language's "fault" by any means, nor am I "drawing a fanged face" over explicit memory management.  But consider that we have professional programmers, not a beginner, working in an industry where such issues cost valuable time and money, and still customers run into these issues.  Now consider a language that doesn't directly expose pointers and have garbage collection.  I believe it would be justified for a beginner to choose the latter language, if it is good enough for the programs he wishes to write (eg. performant enough for the game being written).

[And lest you decide to start another off-topic discussion around this, yes, I know that garbage collection doesn't solve memory leaks completely, and your program still fails (albeit at least not so silently) if it access an array or similar data structure out-of-bounds.]

Offline Dullstar

  • Posts: 2092
    • View Profile
    • Leafwing Studios Website (EXTREMELY OUTDATED)
Re: What programming language would you reccomend?
« Reply #17 on: June 11, 2009, 09:46:01 PM »
Yeah.
STAY ON TOPIC.

If this strays too far, summer will be over before I even know what programming language I'm going to use!

Offline Dullstar

  • Posts: 2092
    • View Profile
    • Leafwing Studios Website (EXTREMELY OUTDATED)
Re: What programming language would you reccomend?
« Reply #18 on: June 12, 2009, 07:01:19 AM »
My recommendation is C#, in Mono and using MonoDevelop. Why?

It's available for Linux, Mac OS X, and Windows (and Windows can of course run the software against the .NET Framework). You run Linux, so there we go. To do the game parts, you could use SdlDotNet (also for all three of the aforementioned platforms). This is a check against your list.
From my experience coding my current clone, I don't need to make too much changes from one to the other so that is another check against your list. I have it in Windows and Mono at the moment with no trouble.

C# is also very easy to learn, I have found. There's a wealth of knowledge on C# in many popular learning series (for Dummies, teach yourself in x minutes, etc). It is an object-oriented language, which makes things so much much simpler in large projects. It also has garbage collection, which means you don't need to deal with some of the nitty gritty details like memory management.

Many people will say that perhaps there are more powerful languages, or blah blah blah. Well, I think C# is plenty powerful and further more hits that button which is quite important: easy to learn. Remember, you'll get alot of suggestions Dullstar, pick whatever YOU think matches YOUR needs. Don't let people tell you that you need "x feature" and "y feature". Get what you want, mate!

Trying it right now!  Personally, I feel a good way to choose a good language would be to try it!  Suggestions are quite helpful, and the vast majority recommend C#.  And as for x feature/y feature, I don't think I'll run into problems like that.  I mean, really, the MMF website has a tutorial for writing an OS in MMF2 (like that'll work considering it builds Windows programs :P), C# can probably do important game functions.

EDIT:  Windows version won't run, so I'm going to have to get the Ubuntu partition up and running again.

Offline The Doctor

  • Posts: 301
  • Jason the Human
    • View Profile
    • zapzupnz.com
Re: What programming language would you reccomend?
« Reply #19 on: June 12, 2009, 11:27:29 AM »
If you wish to use Windows, you can also use Visual C# 2008 Express Edition (google for it, it's free).

 I find it useful to edit the interface of my program using that, and then test my program in MonoDevelop (MD can open VC#2k8 solution files) to see how it runs on OS X and Linux. (That, and MonoDevelop doesn't have a Windows Forms editor, only a GTK# editor which is no good to me...)

Also, check this out: Click here for a quick C# tutorial.
This Lemmings forum is simply *fabulous*!

Offline Dullstar

  • Posts: 2092
    • View Profile
    • Leafwing Studios Website (EXTREMELY OUTDATED)
Re: What programming language would you reccomend?
« Reply #20 on: June 12, 2009, 10:16:57 PM »
Working on getting Ubuntu back up.  I'll get back to this then.

Should of updated earlier, because I've finished getting Ubuntu back up a while ago.

Offline Dullstar

  • Posts: 2092
    • View Profile
    • Leafwing Studios Website (EXTREMELY OUTDATED)
Re: What programming language would you reccomend?
« Reply #21 on: July 16, 2009, 10:58:53 PM »
Update:  I have chosen a programming language and have gotten farther than I ever did in C#.

Python's pretty easy.  I got past the hello world tutorial for once, and I've heard it's quite powerful.  I'm still figuring out how to make programs that work in Linux and Mac OS X (it is possible), but there are many tutorials out there for that, so I might find one that works eventually.

This is the Hello World program in Python:
Code: [Select]
print "Hello World"Compare that to any form of C and you'll see what I mean.

Offline The Doctor

  • Posts: 301
  • Jason the Human
    • View Profile
    • zapzupnz.com
Re: What programming language would you reccomend?
« Reply #22 on: July 20, 2009, 01:50:23 PM »
Console.WriteLine("Hello World") in C#

and

NSLog(@"Hello world")

2 points to whoever works out what languages those are.
This Lemmings forum is simply *fabulous*!

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: What programming language would you reccomend?
« Reply #23 on: July 20, 2009, 07:37:47 PM »
Console.WriteLine("Hello World") in C#

I don't know Python but if Dullstar's talking about a complete program, in C# you definitely need more than just that one line.

Offline Dullstar

  • Posts: 2092
    • View Profile
    • Leafwing Studios Website (EXTREMELY OUTDATED)
Re: What programming language would you reccomend?
« Reply #24 on: July 20, 2009, 11:42:13 PM »
It's a really simple programming language to learn.  Besides, all the non-coding problems were the exact same ones a ran into before, namely figuring out how to get it to run.

No matter how a programming language needs to be done to test, I cannot figure out how to do it.

Compilers work for some people with C#, but a bunch of random babble errors come up in the compilers.  At least in Python I'm starting to find some possible solutions for getting it to run.

Offline The Doctor

  • Posts: 301
  • Jason the Human
    • View Profile
    • zapzupnz.com
Re: What programming language would you reccomend?
« Reply #25 on: July 21, 2009, 12:04:14 AM »
Hehe yup. I say use whatever language you want, as long as it suits your needs. My needs are that I can use it at university, and they only support C# and Java. :/

ccexplore was right. Here's a full C# implementation of Hello World.

using System;
namespace HelloWorld
{ class MainClass
{ public static void Main (string[] args)
{
Console.WriteLine("Hello World");
}
}
}

... My favourite programming language at present is Lolcats.
This Lemmings forum is simply *fabulous*!

Offline Dullstar

  • Posts: 2092
    • View Profile
    • Leafwing Studios Website (EXTREMELY OUTDATED)
Re: What programming language would you reccomend?
« Reply #26 on: July 21, 2009, 12:07:17 AM »
Oh yeah.  LOLCODE.  There's actually a Wikipedia article on that.  I don't know how usable it is though.

Offline Dullstar

  • Posts: 2092
    • View Profile
    • Leafwing Studios Website (EXTREMELY OUTDATED)
Re: What programming language would you reccomend?
« Reply #27 on: July 27, 2009, 06:18:30 AM »
I learned how to make this with a tutorial.  The actual program I wrote for the tutorial is in a different .py file though.  Don't forget to extract it, though!  Download is at bottom of post.
This is my fully functional calculator applying what I learned from the tutorial, but coded without a tutorial.  I had a little help getting it fully functional and at the time being have not yet made Windows and Mac OS X ports, though it should be easy to do.  Please note that I don't know if the program will automatically be able to execute.  If it can't, you should be able to find the answer on Google.

For Ubuntu and its variants, you can do it by putting:

Code: [Select]
chmod +x /this/is/the/path/to/calc.py
into the terminal.
Replace /this/is/the/path/to/ with the directory the file is in.

calc.py.zip

Offline The Doctor

  • Posts: 301
  • Jason the Human
    • View Profile
    • zapzupnz.com
Re: What programming language would you reccomend?
« Reply #28 on: July 27, 2009, 06:20:01 AM »
Easy on OS X. Just double clicked, it ran. :-) Ran into an error when I attempted to enter invalid data into the input system. Next step, error checking. :P

Here's my adaptation of your calculator in C#. Boy howdy, does it look different, lol.
Attached is also the binary executable. You can simply double click this to run in Windows.
On Linux or Mac OS X, make sure you have Mono installed. Then open a command line, navigate to
the folder containing the EXE file, and run this command.
mono ConsoleCalc.exe

DOWNLOAD HERE!!

Code: [Select]
/*
 * Name: ConsoleCalc
 * By: Jason Ryfle (zapzupnz)
 * Date: 27 07 2009
 *
 * Description: a simple calculator-like utility for the command line
 * written in C# using the .NET libraries and Mono.
 *
 * License and credits in credits() method.
 * Alternatively, run the software and hit the 4 key and press return.
 *
 * */

using System;

namespace ConsoleCalc
{
   class MainClass
   {
      public static void Main (string[] args)
      {
         sbyte todoSignedByte = 0;
                  
         Console.Clear();
         Console.WriteLine("Welcome to ConsoleCalc\nChoose a function from the list below by entering the number.\n\n");
         Console.WriteLine("1. Calculation\n2. Area\n3. Powers\n4. Credits\n\n");
         try
         {
            todoSignedByte = sbyte.Parse(Console.ReadLine());
         }
         catch
         {
            todoSignedByte = sbyte.Parse(Console.ReadLine());
         }
         
         if (todoSignedByte == 0)
         {
            Console.WriteLine("Terminating...");
            return;
         }
         else if (todoSignedByte == 1)
         {
            calculator();
         }
         else if (todoSignedByte == 2)
         {
            area();
         }
         else if (todoSignedByte == 3)
         {
            powers();
         }
         else if (todoSignedByte == 4)
         {
            credits();
         }
         else if (todoSignedByte > 4)
         {
            Console.WriteLine("Terminating...");
            return;
         }
      }
      
      public static double Evaluate(string expression) 
       { 
           System.Data.DataTable table = new System.Data.DataTable(); 
           table.Columns.Add("expression", string.Empty.GetType(), expression); 
           System.Data.DataRow row = table.NewRow(); 
           table.Rows.Add(row); 
           return double.Parse((string)row["expression"]); 
       }
      
      static void calculator()
      {
         Console.Clear();
         Console.WriteLine("Write your calculation:");
         try
         {
         string problemString = Console.ReadLine();
         Console.WriteLine("Answer is: " + Evaluate(problemString));
         }
         catch
         {
            Console.WriteLine("Invalid formula. Press any key to try again.");
            Console.ReadKey();
            calculator();
         }
      }
      
      static void area()
      {
         Console.Clear();
         Console.WriteLine("Choose a shape from the list by number." +
                           "\n" +
                           "\n1. Rectangle" +
                           "\n2. Circle" +
                           "\n3. Triangle" +
                           "\n4. Trapezoid" +
                           "\n5. Square or Rhombus" +
                           "\n6. Parallelogram" +
                           "\n\n");
         sbyte shapeSignedByte = sbyte.Parse(Console.ReadLine());
         if (shapeSignedByte == 0)
         {
            Console.WriteLine("Terminating...");
            return;
         }
         else if (shapeSignedByte == 1)
         {
            rect();
         }
         else if (shapeSignedByte == 2)
         {
            circle();
         }
         else if (shapeSignedByte == 3)
         {
            triangle();
         }
         else if (shapeSignedByte == 4)
         {
            trapezoid();
         }
         else if (shapeSignedByte == 5)
         {
            rect();
         }
         else if (shapeSignedByte == 5)
         {
            rect();
         }
      }
      
      static void rect()
      {
         Console.WriteLine("\nHow long is this shape?"); double length = double.Parse(Console.ReadLine());
         Console.WriteLine("How wide is this shape?"); double width = double.Parse(Console.ReadLine());
         Console.WriteLine("Answer is: " + (length * width));
      }
      
      static void circle()
      {
         Console.WriteLine("\nWhat is the diameter of this circle?"); double diameter = double.Parse(Console.ReadLine());
         double radius = diameter / 2;
         Console.WriteLine("Radius is: " + radius.ToString());
         Console.WriteLine("Answer is: " + (radius * radius * Math.PI));

      }
      
      static void triangle()
      {
         Console.WriteLine("\nWhat is the length of the base?"); double length = double.Parse(Console.ReadLine());
         Console.WriteLine("How tall is the triangle?"); double height = double.Parse(Console.ReadLine());
         Console.WriteLine("Answer is: " + (length * height / 2));
      }
      
      static void trapezoid()
      {
         Console.WriteLine("\nWhat is the length of the one of the bases?"); double base1 = double.Parse(Console.ReadLine());
         Console.WriteLine("What is the length of the other base?"); double base2 = double.Parse(Console.ReadLine());
         Console.WriteLine("How tall is the trapezoid?"); double height = double.Parse(Console.ReadLine());
         Console.WriteLine("Answer is: " + (height*(base1+base2)/2));
      }
      
      static void powers()
      {
         Console.Clear();
         Console.WriteLine("What number shall we multiply?"); double toMult = double.Parse(Console.ReadLine());
         Console.WriteLine("To what power shall we do this?"); double powerToMult = double.Parse(Console.ReadLine());
         Console.WriteLine("Answer is: " + (Math.Pow(toMult, powerToMult)));
      }
      
      static void credits()
      {
         Console.Clear();
         Console.WriteLine("A loose adaptation of Dullstar's calculator, " +
                           "\nconverted to C# using the .NET libraries" +
                           "\nDeveloped in MonoDevelop for Mac OS X" +
                           "\nCompiled with Mono" +
                           "\nYou are free to share and modify this source code");
      }
   }
}
This Lemmings forum is simply *fabulous*!

Offline Dullstar

  • Posts: 2092
    • View Profile
    • Leafwing Studios Website (EXTREMELY OUTDATED)
Re: What programming language would you reccomend?
« Reply #29 on: July 29, 2009, 10:06:39 AM »
I might try learning how that works.  I find that Python appears to be losing its advantage after the calculator.

Looks like it handles multiple lines better than Python (well, to my knowledge, anyways...)

Offline The Doctor

  • Posts: 301
  • Jason the Human
    • View Profile
    • zapzupnz.com
Re: What programming language would you reccomend?
« Reply #30 on: July 29, 2009, 10:09:52 AM »
Oh I don't know. It has it's advantage, being an interpreted language makes it fairly simple for the beginner. I started with QBASIC. I think QBASIC is interpreted.
This Lemmings forum is simply *fabulous*!

Offline Dullstar

  • Posts: 2092
    • View Profile
    • Leafwing Studios Website (EXTREMELY OUTDATED)
Re: What programming language would you reccomend?
« Reply #31 on: July 29, 2009, 10:13:14 AM »
I'm starting to see how C# works, so I might end up just finding advantage with it after all.  For one thing, if I recall correctly, you have to download python to use it, another thing is that it would help for if I ever take a programming class.

Offline The Doctor

  • Posts: 301
  • Jason the Human
    • View Profile
    • zapzupnz.com
Re: What programming language would you reccomend?
« Reply #32 on: July 29, 2009, 10:16:44 AM »
It's still a good solution for the crossplatform software, with simplicity in mind. Of course, if you would like a hand learning C#, I'd happily help.
This Lemmings forum is simply *fabulous*!

Offline Dullstar

  • Posts: 2092
    • View Profile
    • Leafwing Studios Website (EXTREMELY OUTDATED)
Re: What programming language would you reccomend?
« Reply #33 on: July 29, 2009, 10:24:47 AM »
Thanks.  Did you get the personal message I sent you about contacting me?

Offline The Doctor

  • Posts: 301
  • Jason the Human
    • View Profile
    • zapzupnz.com
Re: What programming language would you reccomend?
« Reply #34 on: July 29, 2009, 10:28:17 AM »
Got it. Did you get mine.
This Lemmings forum is simply *fabulous*!

Offline Dullstar

  • Posts: 2092
    • View Profile
    • Leafwing Studios Website (EXTREMELY OUTDATED)
Re: What programming language would you reccomend?
« Reply #35 on: July 29, 2009, 11:14:02 PM »
I'm basically trying to redo the calculator in C# using yours as a base, but I'm going to try adding on a GUI.

Offline Dullstar

  • Posts: 2092
    • View Profile
    • Leafwing Studios Website (EXTREMELY OUTDATED)
Re: What programming language would you reccomend?
« Reply #36 on: September 08, 2009, 03:03:04 AM »
It's certainly been a while since I've came to this stuff, so I'm going to figure out what the most adaptable multiplatform programming language is without straying far from the checks...  I want it to run on as many platforms as possible, after all.   :D

Reason for editing post:  Poor word choice corrected.

Offline GuyPerfect

  • Posts: 363
    • View Profile
Re: What programming language would you reccomend?
« Reply #37 on: September 08, 2009, 06:38:02 PM »
If that's the case, C is your friend. C can go where C++ can't.

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: What programming language would you reccomend?
« Reply #38 on: September 09, 2009, 12:07:47 AM »
I'll grant you that because of the comparatively simpler semantics, you will find more platforms with C compilers available as opposed to C++ (although the comparison is a little off the point, since Dullstar has been using C# so far not C++).  But that completely ignores the fact that not only the language itself needs to be multi-platform, but also any libraries you used for critical things like graphics, audio, etc, which aren't part of the language.  Keeping that in mind, and you might find that other language's support for the most "common" target platforms are quite acceptable.

In any event, your program's multiplatform support is only as good as the number of platforms it has actually been tested on.

Offline Dullstar

  • Posts: 2092
    • View Profile
    • Leafwing Studios Website (EXTREMELY OUTDATED)
Re: What programming language would you reccomend?
« Reply #39 on: September 09, 2009, 10:24:47 PM »
I'm still learning to program, so the project is not yet ready to be tested.  I should be able to get it tested on the three major ones:  Linux, Mac OS X, and Windows.

Offline Dullstar

  • Posts: 2092
    • View Profile
    • Leafwing Studios Website (EXTREMELY OUTDATED)
Re: What programming language would you reccomend?
« Reply #40 on: October 05, 2009, 03:05:56 AM »
Progress report!  I'm going to try this tutorial!

http://www.cprogramming.com/tutorial/
The C part, anyways.  I've been afraid of C++.  Don't ask why.

However, I must ask...  when I dip into things such as GUI's, what should I use?  It has to be cross-platform!  Linux is your friend...

Also, I've heard about OpenGL, I'd like some information about where it goes into programming.



Awesome, my favourite Linux text editor has C syntax highlighting.  Now, whether or not it can save C files, I do not know.

Offline GuyPerfect

  • Posts: 363
    • View Profile
Re: What programming language would you reccomend?
« Reply #41 on: October 05, 2009, 10:12:51 PM »
Every operating system is going to have its own GUI, and even on Linux you'll find completely different UI libraries depending on the desktop environment/window manager you've got installed, so the only surefire way to use something that will be the same on various platforms is to implement it yourself.

Even Mac OS X supports the X Window System, so you should be good to go implementing that and a window handler for Microsoft Windows. What I've done is written an API with functions that behave the same on both platforms (and therefore only require me to write my code once), but the back-end code behind those functions is different for Windows and X. It's a little extra work up-front, but I can make things easily cross-platform that way.

OpenGL is a standardized graphics library (hence the "GL") that's supported on any operating system that cares anything about supporting standards. You can learn about using it at NeHe Productions.

Offline Dullstar

  • Posts: 2092
    • View Profile
    • Leafwing Studios Website (EXTREMELY OUTDATED)
Re: What programming language would you reccomend?
« Reply #42 on: October 05, 2009, 10:16:57 PM »
Thanks!  And I'm happy to report that I can nearly write a calculator in C - I have to test it out, though.

Offline Minim

  • Posts: 1724
    • View Profile
Re: What programming language would you recommend?
« Reply #43 on: November 10, 2009, 06:42:13 PM »
My first post of this thread.

I'm happy to report that I can nearly write a calculator in C - I have to test it out, though.

Have you done it yet? I can't wait to see.

I'm starting to ask this question as well. I am currently doing A Levels (which on oth subjects I'm struggling with to pass) and so I should be looking at different types of jobs, not just the one I'm sticking with: Being a building surveyor in a locally small company; and now this idea came into my head thinking that I should do some programming. It would be good for me to get some practice on this as well. Being in a forum like this gives me some good examples on how posts are presented. I've also started a Wikipedia account. Wikipedia I think takes programming one step further but isn't very difficult once you get the hang of it for the next several days.

So, I haven't finished school yet, but at the moment I'm looking at programming. Any ideas yet?

Level Solving Contest creator. Anybody bored and looking for a different challenge? Try these levels!

Neolemmix: #1 #4 #5 #6
Lix: #2  #7
Both Engines: #3

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: What programming language would you reccomend?
« Reply #44 on: November 10, 2009, 09:06:12 PM »
I'm not sure what you mean by "any ideas yet?" ??? If you're talking about  "which language", you have the 3-page history of this thread as a guide, albeit probably not a very good one.  Frankly, since you're only in exploratory stages right now, any language just to get you feet wet would be fine.  A lot of programming concepts, especially the most basic ones, doesn't really care which language you use.  Technologies can change at a fast pace, so it's probably more important to learn the fundamentals, to know enough so that you can easily learn a new language whenever the time comes.

I must take my leave now since as you know, I can't be posting at a thread where GuyPerfect might also be posting to, or very bad things will happen. ;P  I'm frankly hesitant to even post this.

Offline Dullstar

  • Posts: 2092
    • View Profile
    • Leafwing Studios Website (EXTREMELY OUTDATED)
Re: What programming language would you reccomend?
« Reply #45 on: November 10, 2009, 09:53:54 PM »
Hmm, I might look at Java again for cross platform stuff.

Offline GuyPerfect

  • Posts: 363
    • View Profile
Re: What programming language would you reccomend?
« Reply #46 on: November 10, 2009, 10:45:03 PM »
The absolute easiest programming language to learn, in my opinion, is BASIC or one of its variants.  You can learn about it at any number of sites, such as Pete's QBASIC Site, which includes tutorials.

I've attached QBASIC 4.5 to this post. It will load up and run in the MS-DOS Promt well enough, though you may want to use DosBox for performance reasons.

Here's a simple, fundamentalist-style calculator program I wrote up:

Code: [Select]
'Declare variables
DIM NumA AS SINGLE, NumB AS SINGLE, Result AS SINGLE
DIM Operator AS STRING

'Clear the screen
CLS

'Get the first number
INPUT "Enter a number: ", NumA

'Get the operator
DO
    INPUT "Enter an operator (+, -, * or /): ", Operator

    'Check to make sure the operator is valid
    IF Operator = "+" THEN EXIT DO
    IF Operator = "-" THEN EXIT DO
    IF Operator = "*" THEN EXIT DO
    IF Operator = "/" THEN EXIT DO

    'If we're still in the loop, the operator was invalid
    PRINT "Invalid operator. Try again."
LOOP

'Get the second number
INPUT "Enter another number: ", NumB

'Perform the calculation
SELECT CASE Operator
    CASE "+": Result = NumA + NumB
    CASE "-": Result = NumA - NumB
    CASE "*": Result = NumA * NumB
    CASE "/": Result = NumA / NumB
END SELECT

'Output the result
PRINT LTRIM$(STR$(NumA));
PRINT " " + Operator + " ";
PRINT LTRIM$(STR$(NumB));
PRINT " = " + LTRIM$(STR$(Result))

Offline Pooty

  • Posts: 359
    • View Profile
Re: What programming language would you reccomend?
« Reply #47 on: November 10, 2009, 11:07:48 PM »
Wow, QBASIC! That's a blast from the past. I spent the majority of my teenage years playing about with that language, using a machine with a 50MHz processor. Good fun it was, too. One thing I loved was the Help system. I was clicking with it, and sometimes, I explored it in the same way as many of us explore Wikipedia.
SEGA Master System version
100% on 110/120 levels (92%). Other levels [Lemmings lost]:
Fun 03 [3], 06 [2], 18 [5]   
Taxing 19 [5], 27 [1], 28 [3]
Tricky 15 [5], 17 [2]
Mayhem 19 [7], 26 [10]

Offline Minim

  • Posts: 1724
    • View Profile
Re: What programming language would you reccomend?
« Reply #48 on: November 11, 2009, 09:14:46 PM »
I'm sorry about this, but QBasic runs in DOS and I can't get the Dosbox to work.

I should keep looking at the posts displayed earlier in the forum.
Level Solving Contest creator. Anybody bored and looking for a different challenge? Try these levels!

Neolemmix: #1 #4 #5 #6
Lix: #2  #7
Both Engines: #3

Offline GuyPerfect

  • Posts: 363
    • View Profile
Re: What programming language would you reccomend?
« Reply #49 on: November 11, 2009, 09:28:24 PM »
If you're running Windows, you'll be able to run QBASIC without DosBox.

Offline covox

  • Posts: 100
    • View Profile
Re: What programming language would you reccomend?
« Reply #50 on: November 15, 2009, 11:29:19 AM »
Another vote for Python! It's fun and easy to learn, and very powerful for rapid prototyping.

For quick introductions, I can recommend this set of tutorials or this site. The latter is very good about teaching the basic building-blocks of computer science, but for the love of God IGNORE EVERYTHING IT SAYS ABOUT VBSCRIPT. Seriously, don't even entertain the idea of learning VB. That's a great way to screw you up good. For the more complex stuff, the Python docs contain just about everything, explained (remarkably enough) in English.

Some more links:  Pygame is a popular wrapper around the SDL multimedia library. Python Challenge is a pretty cool online puzzle which can only be solved through lots of Python hacking.

Offline Dullstar

  • Posts: 2092
    • View Profile
    • Leafwing Studios Website (EXTREMELY OUTDATED)
Re: What programming language would you reccomend?
« Reply #51 on: November 15, 2009, 10:37:43 PM »
for the love of God IGNORE EVERYTHING IT SAYS ABOUT VBSCRIPT

What the **** is VBSCRIPT anyways?

Offline Minim

  • Posts: 1724
    • View Profile
Re: What programming language would you reccomend?
« Reply #52 on: November 16, 2009, 04:19:12 PM »
Another vote for Python! It's fun and easy to learn, and very powerful for rapid prototyping.

Python! covox, you've just reminded me of something.

Anyway, I've tried the download but unfortunately I don't know what to do next. :-\ I've got the file on my Windows saying "ActivePython-2.6.4.8-win32-x86.msi". I just wonder if there are any additional stuff to download that goes with it. Maybe that file is a tutorial page?
Level Solving Contest creator. Anybody bored and looking for a different challenge? Try these levels!

Neolemmix: #1 #4 #5 #6
Lix: #2  #7
Both Engines: #3

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: What programming language would you reccomend?
« Reply #53 on: November 16, 2009, 07:49:20 PM »
Anyway, I've tried the download but unfortunately I don't know what to do next. :-\ I've got the file on my Windows saying "ActivePython-2.6.4.8-win32-x86.msi".

".msi" is a Windows installer package, you should be able to just double-click to run it and it should launch an installation program to install whatever it contains (ie. Python).

Offline Dullstar

  • Posts: 2092
    • View Profile
    • Leafwing Studios Website (EXTREMELY OUTDATED)
Re: What programming language would you reccomend?
« Reply #54 on: November 16, 2009, 10:52:23 PM »
Another thing I'm wondering - do game development suites always use platform specific code, or could the code for the exe's they produce be decompiled and recompiled under another OS?

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: What programming language would you reccomend?
« Reply #55 on: November 17, 2009, 01:24:03 AM »
Another thing I'm wondering - do game development suites always use platform specific code, or could the code for the exe's they produce be decompiled and recompiled under another OS?

Unless the suite is specifically designed to work cross-platform, there's nothing you can do to get around its "platform-specificity".  Programs compiled for different platforms are generally as different as, say, Spanish vs. Romanian, even for platforms that work on the same processor architecture.  This is because (roughly speaking) programs rely on the OS for a lot of essential functionalities, and the way to invoke these OS-provided functions are completely different from OS to OS (not to mention the set of functions themselves are totally different).

Cross-platformness takes real effort to achieve.  Basically someone has to provide a sort of common interface/library for the various functionalities normally covered by the OS/platform (files, sounds, graphics, etc.).  You program against that interface/library, instead of against a specific OS or platform.  Then for each platform/OS the common interface/library supports, there are code specific to that platform/OS, that implements the features in the common interface/library using what functionalities that particular platform/OS provides.

In other words, a cross-platform library or suite or whatever saves you from having to write separate programs for each platform, by having the work done for you--it abstracts out all those functionalities that must be implemented differently in different platforms, provides all the different code for each supported platform, and then slaps a common interface on top of it that your program talks to.  The provided platform-specific code translates the functionalities your program requires (expressed as function calls into the common interface) into the functionalities provided by the specific OS/platform.

Using the rough language analogy, the cross-platform interface/library would be a common language like English.

Because providing cross-platform support takes more effort to achieve, it's not surprising that most game development suites would just pick the most "popular" platform, like Windows.

Offline mobius

  • Posts: 2754
  • relax.
    • View Profile
Re: What programming language would you reccomend?
« Reply #56 on: October 25, 2013, 04:46:02 PM »
I'd like to start learning C++ using this tutorial: http://www.cplusplus.com/doc/tutorial/

what is doesn't mention is what kind of compiler should I get? And is this something I can download easily for free? I have downloaded a Python compiler in the past but there's a huge selection it seems for C++. What do you recommend?
And, do I really need this? I thought I remember hearing somebody making programs in C++, in Windows using only a notepad somehow.

unrelated: what language are batch files written in?
everything by me: https://www.lemmingsforums.net/index.php?topic=5982.msg96035#msg96035

"Not knowing how near the truth is, we seek it far away."
-Hakuin Ekaku

"I have seen a heap of trouble in my life, and most of it has never come to pass" - Mark Twain


Offline Simon

  • Administrator
  • Posts: 3879
    • View Profile
    • Lix
Re: What programming language would you reccomend?
« Reply #57 on: October 25, 2013, 05:24:07 PM »
For C++ under Windows, I've used MinGW, it's free software. Hunt around the web for that, I recall that one needs to install several things from their site. An alternative is Cygwin, but I've never used that.

A text editor is not a compiler. You can write code in Notepad if you insist, but you will want a more powerful editor quickly.

Batch files are shell commands that get executed one after another. :-)

Useful links for later:
sgi's STL reference for std::string, std::vector, ...,
C++ FAQ lite for style/avoiding concocted use of language features,
and cplusplus.com, which you already know.

-- Simon

Offline GuyPerfect

  • Posts: 363
    • View Profile
Re: What programming language would you reccomend?
« Reply #58 on: October 26, 2013, 04:13:10 AM »
For C++ under Windows, I've used MinGW, it's free software. Hunt around the web for that, I recall that one needs to install several things from their site.

It works just fine with just the mingw-get-setup.exe file linked to on their SourceForge page. I think what you have in mind is MSYS, which is an additional package that contains a Windows version of the make utility among other things.

I'd go with MinGW, möbius. It exposes the gcc and g++ commands to the Windows command prompt, and it's what you're most likely to run into out there in the real world (at least, the real world that isn't married to Microsoft).

Offline mobius

  • Posts: 2754
  • relax.
    • View Profile
Re: What programming language would you reccomend?
« Reply #59 on: October 26, 2013, 04:52:12 PM »
thank you  :)

I've downloaded the MinGW installer package and it seemed to install fine and I feel silly asking, but how do you open the compiler and start typing?  :-\  There's no quick link or anything... All I can see easily is the installer which all it does is install things. There's nothing that stands out in my MinGW folder. What am I missing?

Also; there's such a huge amount of items in the installer list of the installer package. How much of this do I need to install as a beginner? I've installed the 'typical' install i think (including several compilers).
everything by me: https://www.lemmingsforums.net/index.php?topic=5982.msg96035#msg96035

"Not knowing how near the truth is, we seek it far away."
-Hakuin Ekaku

"I have seen a heap of trouble in my life, and most of it has never come to pass" - Mark Twain


Offline ccexplore

  • Posts: 5311
    • View Profile
Re: What programming language would you reccomend?
« Reply #60 on: October 26, 2013, 07:28:42 PM »
I think you may be better off with an integrated development environment based on your prior experiences.  Anyone has any to recommend?  Most of what I've used previously are paid products.  Microsoft's Visual Studio Express is free, though obviously it is geared more towards Windows programming (but should be non-issue for the sort of things you'd to following a C++ tutorial).

Background info for mobius:  the compiler technically is just the program that converts your source files, ie. "the files of source code that you type in", into machine code such as an executable binary like an EXE file in Windows.  No matter what you use, it is almost always possible to just use your favorite text editor to type in the source code, and then separately run the compiler and related tools afterwards to turn them into the program you can actually run.  An integrated development environment (IDE) is more like what you're probably used to with Python etc., where you are presented one program that includes the text editor as well as the compiler and other tools, so you just type in code in the IDE and then do "compile" or "run" from a menu or toolbar in the IDE.

Offline Simon

  • Administrator
  • Posts: 3879
    • View Profile
    • Lix
Re: What programming language would you reccomend?
« Reply #61 on: October 26, 2013, 08:12:17 PM »
IDE: Under Windows, I've used Codeblocks, a free and cross-platform IDE for C++ and others. cc's proposal of Microsoft Visual Studio Express should also work nicely.

Some consider bloated what others consider essential, so you have to choose if/which IDE to use yourself in the end. Guyperfect will likely recommend not using an IDE at all, and just doing everything with the command line. (-: You might learn some fundamentals that way, and it is not hard either.

Without IDE: Use any text editor, write a hello world program, and save it somewhere with .cpp as the extension. Open a command line, switch to the file's directory and type g++ yourfile.cpp. If you get no console output, everything works, and there will be a generated executable in the same directory.

If you get compiler errors, fix the source. If you get "g++: command not found" or similar error, see whether there is an executable named g++ among the executables installed by MinGW. If there is none, but there is g++-win32 or similar, copy that and name it g++. If the command is still not found even though g++ exists, add the directory containing the MinGW executables to your PATH variable. Hunt around the web for how to do that on your Windows system.

I'm sitting in IRC, should you need quick help.

-- Simon

Offline Simon

  • Administrator
  • Posts: 3879
    • View Profile
    • Lix
Re: What programming language would you reccomend?
« Reply #62 on: October 28, 2013, 10:26:08 PM »
Quote from: moebius in IRC
[21:13] <apple_stack> I hit cancel and command prompt says:   g++: error: hello.cpp no such file or dir g++fatal error: no input files compilation terminated.

MinGW and g++ seem correctly installed and callable from the command line. You can proceed with or without an IDE.

-- Simon