Computer Programming Discussion

Post » Sun Dec 13, 2009 5:01 pm

It's the case with most dynamically typed languages. The price you have to pay for their flexibility, if you will. I've always found a simple text editor and an interpreter to be good enough.

I'm actually using IDLE right now <_<
User avatar
Rik Douglas
 
Posts: 3385
Joined: Sat Jul 07, 2007 1:40 pm

Post » Sun Dec 13, 2009 6:17 pm

Why not, Max? I thought most commercial games were programmed in C++?

Well last night I got on a roll and now I'm set up with using MinGW as my compiler, Code::Blocks as my IDE, and Allegro for my GUI. It's very straightforward. Thanks for your words of wisdom, though.
User avatar
Ymani Hood
 
Posts: 3514
Joined: Fri Oct 26, 2007 3:22 am

Post » Sun Dec 13, 2009 12:20 pm

Why not, Max? I thought most commercial games were programmed in C++?

That's true, but GUI != games. Games draw everything by hand using DirectX/OpenGL, including what interface there is, while ordinary GUI programs use OS-defined controls. For the latter, it's really a waste of effort to code your own GUI each time. Higher level languages allow you to stop worrying about memory management and low level optimization since you don't need efficiency in GUI programs anyways.
User avatar
My blood
 
Posts: 3455
Joined: Fri Jun 16, 2006 8:09 am

Post » Sun Dec 13, 2009 9:07 am

It may not be a straight answer to your question, but it's not really worth learning GUI libraries in C++.
I am sort of in two minds about this. I see where you are coming from, but with that argument you could also argue that there is no point learning C as there are other languages that do everything better. (For example, fortran has the possablilty for being slightly faster in some cases due to stricter pointer rules, plus it has loads more maths libraries iirc)

I would say that it was probably worth learning either wxWidgets or QT (as the two major FOSS cross platform libraries). The majority of C++ gui libraries are very transferable. You can find wxWidgets for every language under the sun (Haskell to Python) and they don't vary much as they are just a wrapper around an shared library. I am sure this is the same for QT.

There're languages that have built-in GUI libraries/designers which make the whole process a breeze. Since you know C++, you can probably learn C# fairly easily. It comes with an excellent GUI designer, even in the free version of its IDE (http://www.microsoft.com/express/vcsharp/).
QT and wxWidgets both have design tools to allow you put together GUIs fast. QT has an entire IDE that looks quite nice.

That's true, but GUI != games. Games draw everything by hand using DirectX/OpenGL, including what interface there is, while ordinary GUI programs use OS-defined controls. For the latter, it's really a waste of effort to code your own GUI each time. Higher level languages allow you to stop worrying about memory management and low level optimization since you don't need efficiency in GUI programs anyways.

However game editors are sometimes written in C++ and use the OS GUI functions (or a wrapper around them in the case of QT and other cross-platform libraries), usually because it is easier than putting together a C#/Whatever wrapper.
User avatar
mike
 
Posts: 3432
Joined: Fri Jul 27, 2007 6:51 pm

Post » Sun Dec 13, 2009 10:09 am

I am sort of in two minds about this. I see where you are coming from, but with that argument you could also argue that there is no point learning C as there are other languages that do everything better. (For example, fortran has the possablilty for being slightly faster in some cases due to stricter pointer rules, plus it has loads more maths libraries iirc)

Well, Fortran is hardly usable for any kind of real applications outside math nowadays, while C has aged quite gracefully. It's still the fastest among modern languages.

I would say that it was probably worth learning either wxWidgets or QT (as the two major FOSS cross platform libraries). The majority of C++ gui libraries are very transferable. You can find wxWidgets for every language under the sun (Haskell to Python) and they don't vary much as they are just a wrapper around an shared library. I am sure this is the same for QT.

I haven't used either of those in C++, but the main strength of C++ is performance, and in GUI programs you almost never need it. Why burden yourself with the problems of C++ (manual memory management) when you are not using the main strength of that language?

QT and wxWidgets both have design tools to allow you put together GUIs fast. QT has an entire IDE that looks quite nice.

Yeah, the Qt IDE is quite nice, but when you go down to the actual code, you'll still be talking C++ with it.

However game editors are sometimes written in C++ and use the OS GUI functions (or a wrapper around them in the case of QT and other cross-platform libraries), usually because it is easier than putting together a C# wrapper.

Yeah, but that was not really the question. :P In any case, .NET is gaining a lot of ground in that area. I was browsing through Blizzard's job openings recently, and all their tools programmer positions ask for .NET experience first and foremost.
User avatar
Chelsea Head
 
Posts: 3433
Joined: Thu Mar 08, 2007 6:38 am

Post » Sun Dec 13, 2009 8:39 am

However game editors are sometimes written in C++ and use the OS GUI functions (or a wrapper around them in the case of QT and other cross-platform libraries), usually because it is easier than putting together a C#/Whatever wrapper.


Nowadays a lot of companies in the games industry are using C# to write their tools, as it is easy to use for GUIs, is more simple and faster to write a program with than C++, and is very easy to interface with C++.
User avatar
Unstoppable Judge
 
Posts: 3337
Joined: Sat Jul 29, 2006 11:22 pm

Post » Sun Dec 13, 2009 6:13 am

I haven't used either of those in C++, but the main strength of C++ is performance, and in GUI programs you almost never need it. Why burden yourself with the problems of C++ (manual memory management) when you are not using the main strength of that language?

Your main code base is in C++? You can't use another language? You want a binary that will run without any external dependencies?

I am sort of hoping that D takes off, C++ but better. Optional GC, array bounds checking and a syntax that is actually possible to parse.

Yeah, the Qt IDE is quite nice, but when you go down to the actual code, you'll still be talking C++ with it.
True. But at least it isn't PHP


Yeah, but that was not really the question. :P In any case, .NET is gaining a lot of ground in that area. I was browsing through Blizzard's job openings recently, and all their tools programmer positions ask for .NET experience first and foremost.

:nod: I do like C# far more than most other languages I have used (Haskell and Python are up there as well) and I doubt low level compiled languages are the way forward, the JVM does a far better job at allocating memory than I ever could in C++. The only places where languages like C# or Java really falls down is where you don't have much memory or want to allocate everything in advance.

C# is also leaps and bounds ahead of Java, which still hasn't got closures <_<. I just wish there was an up to date cross platform .net implementation with a standard gui library.


Nowadays a lot of companies in the games industry are using C# to write their tools, as it is easy to use for GUIs, is more simple and faster to write a program with than C++, and is very easy to interface with C++.
Thats why I put sometimes in ;)
User avatar
ONLY ME!!!!
 
Posts: 3479
Joined: Tue Aug 28, 2007 12:16 pm

Post » Sun Dec 13, 2009 12:44 pm

Thats why I put sometimes in ;)


I wasn't arguing against your point, I was actually kind of reinforcing it.
User avatar
jeremey wisor
 
Posts: 3458
Joined: Mon Oct 22, 2007 5:30 pm

Post » Sun Dec 13, 2009 1:05 pm

Your main code base is in C++? You can't use another language? You want a binary that will run without any external dependencies?

These aren't that hard to address. Interfacing with C++ from most languages is simple, so the codebase point is rarely a problem. Not being able to use another language is probably a problem with your platform in the first place. As for dependencies, if you're writing a GUI, chances are you'll have to include dynamically loaded libraries anyway.

I am sort of hoping that D takes off, C++ but better. Optional GC, array bounds checking and a syntax that is actually possible to parse.

I've read through the D docs a long time ago and it did look like a polished version of C++. Still, I don't see it gaining much popularity. It's been out for quite a while, and I'm yet to meet anyone who uses it for real programs.

True. But at least it isn't PHP

I quite like PHP. It was my favourite language while I was working on web projects (and had not learned Python yet). It may be hacky and not object oriented, but I've never seen a better documented language/standard library.

C# is also leaps and bounds ahead of Java, which still hasn't got closures <_<.

I prefer C# to Java by far as well, but I still cringe whenever I have to write something like "Point pt = new Point()" or even worse "Dictionary dict = new Dictionary()" when in Python that would be "dict = {}".
User avatar
Motionsharp
 
Posts: 3437
Joined: Sun Aug 06, 2006 1:33 am

Post » Sun Dec 13, 2009 5:12 pm

I took a Java class in school, but due to circumstances I was not in class 75% of the time, so I didn't learn much.

I also dabbled in visual basic with my cousin, and we made a simple slot machine game.
User avatar
Chris Cross Cabaret Man
 
Posts: 3301
Joined: Tue Jun 19, 2007 11:33 pm

Post » Sun Dec 13, 2009 9:56 am

These aren't that hard to address. Interfacing with C++ from most languages is simple, so the codebase point is rarely a problem. Not being able to use another language is probably a problem with your platform in the first place. As for dependencies, if you're writing a GUI, chances are you'll have to include dynamically loaded libraries anyway.

Even statically linking the gui library into the binary leads to a smaller overall download size, and is far less annoying, than having to ask the user to install .net/java/cpython.


I've read through the D docs a long time ago and it did look like a polished version of C++. Still, I don't see it gaining much popularity. It's been out for quite a while, and I'm yet to meet anyone who uses it for real programs.
It lacks a big backer (As in IBM/Google/Microsoft), which is a problem. It also lacks development tools, and the compilers is apparently a bastard to setup on windows.

I quite like PHP. It was my favourite language while I was working on web projects (and had not learned Python yet). It may be hacky and not object oriented, but I've never seen a better documented language/standard library.

PHP5 is OO now. What annoyed me was the argument order, the function naming, the fact that everything is in the global namespace, the fact that you can crash the vm (A stack overflow crashes it for instance :blink:).

Having said that, it is probably the language I know best.

I prefer C# to Java by far as well, but I still cringe whenever I have to write something like "Point pt = new Point()" or even worse "Dictionary dict = new Dictionary()" when in Python that would be "dict = {}".

Agreed. D had an interesting solution which was the auto keyword.

auto foo = new Bar<Bar>();



Python still looks neater though ;)
User avatar
CHangohh BOyy
 
Posts: 3462
Joined: Mon Aug 20, 2007 12:12 pm

Post » Sun Dec 13, 2009 5:52 pm

Even statically linking the gui library into the binary leads to a smaller overall download size, and is far less annoying, than having to ask the user to install .net/java/cpython.

In that case baking a Python script into a standalone EXE grows it by ~2MB, which is not that large nowadays. .NET and Java are pretty much standard too, and at least for .NET, making an installer for your program that includes .NET is very simple. Gone are the days of having to ask the user to manually download and install libraries.

It lacks a big backer (As in IBM/Google/Microsoft), which is a problem.

It's a pity. C++ would certainly benefit from some polish.

PHP5 is OO now.

Oh, it allows classes, but it's not really OO. The library is still all the same.

What annoyed me was the argument order, the function naming, the fact that everything is in the global namespace, the fact that you can crash the vm (A stack overflow crashes it for instance :blink:).

Totally agree with you on these (though I didn't know you could crash the VM). The lack of namespaces in the library in particular is a very stupid choice on their part.
User avatar
Shannon Marie Jones
 
Posts: 3391
Joined: Sun Nov 12, 2006 3:19 pm

Post » Sun Dec 13, 2009 9:14 am

I have been fighting with my Beginning Visual C# 2005 book for awhile. But I started to branch off and learn bits and pieces that I wanted to at one point. I really should go back to it though and try to pickup where I left off, or just restart even if I know the basic concepts. I was also thinking this morning of going through my SAMS Teach Yourself C++ in 24 hours book but the syntax is way to awkward for me. Same with the VB.NET book I have. I have taken a liking to C#, though since my book is .NET 2.0 based some easier ways to do stuff (like XML processing) exist in .NET 3.0/3.5 yet it isn't explained.

I do want to keep learning it even if I won't really use it for much.

Also, Visual Studio 2008 Pro (with SP1) for some reason won't remember my choices for new projects. I keeps having VB expanded when all I ever use is C#. It won't remember when I collapse it. Anyone know how to solve this issue? I bet it will do the same thing if I start a C++ project. I have already reset all the settings and it did it on a fresh install.
User avatar
Daniel Holgate
 
Posts: 3538
Joined: Tue May 29, 2007 1:02 am

Post » Sun Dec 13, 2009 10:37 am

I have been fighting with my Beginning Visual C# 2005 book for awhile. But I started to branch off and learn bits and pieces that I wanted to at one point. I really should go back to it though and try to pickup where I left off, or just restart even if I know the basic concepts. I was also thinking this morning of going through my SAMS Teach Yourself C++ in 24 hours book but the syntax is way to awkward for me.

I was the same. I got halfway through both of my C++ books, and restarted both of them also. I still haven't gotten back around to doing any programming in months, but I blame the duel credit college courses at school. I think this next semester I will have a lot more free time to work on my skills.

And I think that restarting the book is just fine. Understanding key concepts allows you to grasp what it is talking about more and more. When I was just beginning, I would stare at the same line of code in the book for an eternity before I could even partly realize the order in it and what the writer was up to. When I came back, I understood enough so that I could name out every function within the code and what was pointing to what and work out in my head, before I even compiled and used the program, what would be displayed.
User avatar
biiibi
 
Posts: 3384
Joined: Sun Apr 08, 2007 4:39 am

Post » Sun Dec 13, 2009 6:51 am

AH! This is so simple to use. I'm using Allegro for my graphics and its a breeze, and there's plenty of documentation. Here's a little program I was testing in. It's a simple paint program.. it even lets you save the picture! :D

http://i49.tinypic.com/29c03v5.jpg

And that's all in about 100 lines of code. It's pretty cool, really.
User avatar
Jaki Birch
 
Posts: 3379
Joined: Fri Jan 26, 2007 3:16 am

Post » Sun Dec 13, 2009 7:54 am

AH! This is so simple to use. I'm using Allegro for my graphics and its a breeze, and there's plenty of documentation. Here's a little program I was testing in. It's a simple paint program.. it even lets you save the picture! :D

http://i49.tinypic.com/29c03v5.jpg

And that's all in about 100 lines of code. It's pretty cool, really.

That's pretty nice, man.

I really want to do programs like this, but I'm not far enough along to understand how to output stuff like that, or accept input based on the mouse movements. So far, only text. :(
User avatar
Jessica Stokes
 
Posts: 3315
Joined: Fri Jul 28, 2006 11:01 am

Post » Sun Dec 13, 2009 3:17 pm

It's not too complicated at all. I really haven't used any of my C++ knowledge in that program. It's mostly all allegro-related function calls.. and the documentation for it is pretty good.
User avatar
Dawn Farrell
 
Posts: 3522
Joined: Thu Aug 23, 2007 9:02 am

Post » Sun Dec 13, 2009 5:34 am

Sorry for my ignorance but why do so many forums use PHP? I've always wondered....
User avatar
A Lo RIkIton'ton
 
Posts: 3404
Joined: Tue Aug 21, 2007 7:22 pm

Post » Sun Dec 13, 2009 1:41 pm

Sorry for my ignorance but why do so many forums use PHP? I've always wondered....

I assume because of the large amount of hosts that support it. Almost every webhost that supports a server side language will support PHP.
User avatar
Cheryl Rice
 
Posts: 3412
Joined: Sat Aug 11, 2007 7:44 am

Post » Sun Dec 13, 2009 4:09 pm

Sorry for my ignorance but why do so many forums use PHP? I've always wondered....


PHP is a popular server-side scripting language. It's fast, readable, and writable. There are also hundreds of free PHP forums (Or you could build your own in a weekend. Perhaps not with the featureset of PHPBB or SMF, but it'd be a forum). Not so for Python, or any of the other popular serverside languages.
User avatar
Chantelle Walker
 
Posts: 3385
Joined: Mon Oct 16, 2006 5:56 am

Post » Sun Dec 13, 2009 2:33 pm

Anyone have any suggestions for good C# books? The one I have is a bit older and since I have been using that language most I wanted to stick with it, even though its not cross platform.
User avatar
Alexxxxxx
 
Posts: 3417
Joined: Mon Jul 31, 2006 10:55 am

Post » Sun Dec 13, 2009 6:47 pm

Nice thread, thank you very much. I'm only rudimentary at best, Visual Basic, C++, but would love to try python.
User avatar
Guinevere Wood
 
Posts: 3368
Joined: Mon Dec 04, 2006 3:06 pm

Post » Sun Dec 13, 2009 1:44 pm

http://img691.imageshack.us/i/lmaod.jpg/
:facepalm:
User avatar
Dalia
 
Posts: 3488
Joined: Mon Oct 23, 2006 12:29 pm

Post » Sun Dec 13, 2009 9:18 am

http://img691.imageshack.us/i/lmaod.jpg/
:facepalm:

That just brightened up my day :)
User avatar
Andres Lechuga
 
Posts: 3406
Joined: Sun Aug 12, 2007 8:47 pm

Post » Sun Dec 13, 2009 7:03 am

Nice thread, thank you very much. I'm only rudimentary at best, Visual Basic, C++, but would love to try python.

Go for it, Python is awesome :hehe:

http://img691.imageshack.us/i/lmaod.jpg/
:facepalm:

I don't even
User avatar
Tiff Clark
 
Posts: 3297
Joined: Wed Aug 09, 2006 2:23 am

PreviousNext

Return to Othor Games