• Advertisement

Archived

This topic is now archived and is closed to further replies.

Once you know C++ you're all set, right?

This topic is 5085 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I keep hearing that C++ is what I should program in, even for games, but its hard to learn. I was surprised when I found this post http://www.blitzbasic.com/Community/posts.php?topic=29197 what do you think?

Share this post


Link to post
Share on other sites
Advertisement
Well, once you have satisfied the peer-pressure and wasted your time with c++, you can now move to functional languages.

I suggest you fire up that Emacs and say good bye to that failed paradigm called OOP.

Share this post


Link to post
Share on other sites
quote:
Original post by Captian Goatse
Well, once you have satisfied the peer-pressure and wasted your time with c++, you can now move to functional languages.

I suggest you fire up that Emacs and say good bye to that failed paradigm called OOP.


IPTF (the coolest new acronym... evar! I pity the fool.) who don''t get OOP.
I know I prefer std::string over alloce/realloc/free on char* all day. And iostreams, though odd looking, are nicer than printf. I dont care what you say.

And EMACS???

You''re a sick bastard you know that right?

Then again I''m a sick bastard too. I prefer to waste my time re-implementing the entire std namespace. I go off onto tangents... if I want to build a socket class, I need to handle strings to pass directly to them like "http://pie.com/". This of course necesitates a string class. Of course, the string just has to be multibyte. It also must be reference counting, so you don''t have needless string copies. This of course necessitates the creation of mutex/sephamore/etc classes to allow it to work in a multithreaded environment. It just goes downhill from there :-p.

I also like to waste my time creating library functions for handling plugins, and ebeding xml code into .so files automatically. I used php to do it fastest.

I hate game toolkits. I prefer to use my own sweat and blood and tears to make better tools. Of course, this means I havn''t finished anything larger than console tetris... besides a few awsome tech demos .

There are many languages to choose from. C++, C, Java, C#...

Learning C++ will be good for you as long as you maintain a social life. Unlike what I did :-p.

ayup... my right toe is actin'' up again... I can sniff the crisp of a flamewar... better git'' out the aspestus walls... damn language wars...

Share this post


Link to post
Share on other sites
quote:
Original post by Captian Goatse
Well, once you have satisfied the peer-pressure and wasted your time with c++, you can now move to functional languages.

I suggest you fire up that Emacs and say good bye to that failed paradigm called OOP.


I''m not gonna even bother getting into which language is "the best". foofightr is right on. C++ is just a language. You can make a decent game with lots of languages out there(C, C++, C#, Java, Blitz, etc)

Also, keep in mind that whatever language you choose to go with will teach you a decent set of skills. The art of figuring out how things should work logically and then getting the computer to cary that out is 90% of the work. Once you get a good grasp in one language it''s not all that hard to move to other languages. Sure, procedural programming, object oriented programming, and functional programming all have their own flavor of how you accomplish your tasks, but the basics are still the same.

Having said that, most of the professional game making community uses C++. So, if you just want to make games for yourself or want to use use game-making as a playground for learning programming techniques then sure, pick whatever language you like. Try BliztBasic, try a functional language, etc. But, if your goal is to get a job in the game industry then learn C++.

-John

Share this post


Link to post
Share on other sites
quote:
Original post by coorrae
I keep hearing that C++ is what I should program in, even for games, but its hard to learn.
I was surprised when I found this post

http://www.blitzbasic.com/Community/posts.php?topic=29197

what do you think?



C / C++ are definatly the languages to learn if you want to do programming on a professional level or get the most power, performance, and portability out of projects you create.

If you just want to tinker in your spare time there is nothing wrong with using something like blitzbasic.

If you don''t know any type of programming you are probably a lot better off learning a different language before you take on c/c++. Something link Basic (QBasic especially) or PASCAL.

I highly recommend VisualBasic NOT be your first language. Lots of people will disagree with me, but my reasoning has to do with VB dealing more with pointing and clicking to make your interface than actually stressing the basic concepts of programming you''ll need for other languages. But like I said, plenty of other people will disagree with me, and in the interest of preventing a flame war I won''t hold a debate about it, just remember that it''s my opinion.



Drakonite

[Insert Witty Signature Here]

Share this post


Link to post
Share on other sites
Blitz3D kicks bottom. It is a great language for producing reasonable games in a short period of time. It''s a great language for prototyping very complex games (I know of several software houses that use Blitz or similar languages for this purpose). It''s a perfect language for teaching yourself game programming techniques. Think of it as a very general game engine with a BASIC-like scripting language as a front end. It''s a valuable tool.

It''s a shame that the language isn''t that great. I''m not a fan of BASIC, and although Blitz makes some improvements there''s still stuff like data structures that aren''t handled particularly well. A little bit of OOP - inheritance and methods, or even just pointers to functions, would make it go far. Here''s to BlitzMAX.

Share this post


Link to post
Share on other sites
quote:
Original post by Teknofreek
But, if your goal is to get a job in the game industry then learn C++.



Or lisp. Scripting, AI and anything that has not to do with raw hardware profit from the multiverse of functional programming.

It is funny how you guys have this retarded monovision that does not see outside of C, C++, C#, Java or any shitty C offspring.

Granted I like C++, but it happens so that I like lisp even more.

When learning another language, don''t learn language from that above list. Learn a language that is actually a new language and not dialect. Switching from C++ to C# is like switching from American English to Irish Accent.

Share this post


Link to post
Share on other sites
>>> suggest you fire up that Emacs
whats Emacs?


whats functional a language?
it means it actually works?- kidding

>>>If you don''t know any type of programming you are probably a lot better off learning a different language before you take on c/c++. Something link Basic (QBasic especially) or PASCAL.
thats what I did, I started in qbasic, because people would say or imply that qbasic is all the basic there is. I did the job, but I hate that language so much now that I reached its limits.

I know all of the basics of c++ and OOP, but its the complex libraries ''help'' that just confuse me.
Ive reached the point where no matter I program in other languages, it will no longer help me learn c++.

but back on topic, I love OOP, and speed, but am I really going to be able to learn make games in c++? It gets so frustrating if for example, I dont know why I have to do more than just put "setgraphics(800,600);". And when I run something, I dont understand what im supposed to do when it says "iostreams are deprecated", or "linker error"

Share this post


Link to post
Share on other sites
Yes, you can most defniitely make games in C++. Is it easy? Not until you learn C++ and a graphics library. C++ doesn''t have graphics built in, so you''ll have to learn the interface to direct X, or openGL, or use a wrapper for them such as SDL. The plus side of that is that you have choices, so you can start out with a graphics library that DOES give you setmode(800,600) and then move on to a library that lets you pick the number of backbuffers, the depth of the Z buffer, the refresh rate, etc.

If you''re new to programming, I''d suggest you start with Common Lisp. It is a different language, and though it isn''t perfect, its pretty good at letting you ignore the gritty stuff while still being very powerful. You can learn more about Lisp from the ALU''s Website(be warned, the page is harsh on the eyes =-/ )

Emacs is is an advanced text editor made before the days of friendly GUIs, and while it is very powerful, it is also much more difficult to learn than Visual Studio or the like.

Share this post


Link to post
Share on other sites

You''re all set for what exactly? That''s like saying ''Welp, I''ve learned English now I''m set.''. Sure, it''s a critical building block but set for what?

C/C++ are powerful foundations of game programming. Throw in Python and you have an incredible language foundation to build upon to build games. I mean this in the most generic sense, because obviously to develop games you need a lot more skillsets that you have to express through C/C++/Python/etc code or at the very least understand how to interface with pre-built software that handles the bulk of said skillsets.


.z

Share this post


Link to post
Share on other sites
quote:
Original post by coorrae
but back on topic, I love OOP, and speed, but am I really going to be able to learn make games in c++? It gets so frustrating if for example, I dont know why I have to do more than just put "setgraphics(800,600);". And when I run something, I dont understand what im supposed to do when it says "iostreams are deprecated", or "linker error"


I like this talking analogue.

C++ talks almost directly to the hardware. Usually it is more directly than other languages. Java on the other hand does not talk directly to the hardware. First Java phones the virtual machine, then virtual machine phones to the layer that talks to the api, which C++ talks directly.

Remember that true object oriented approach would be graphics_device.setGraphics(800, 600);

C "functional" approach would be more like set_graphics(800,600);

A lot of problems in C++ is caused when objects are created outside of main function. This merely my opinion, however there are other professionals who would support me. Never, ever create anything outside of the main funtion unless you have a specific reason. There are plenty of good reasons to do it, but for a beginer main functon is good enough.

Here is wikipedia definition of OOP.
http://en.wikipedia.org/wiki/OOP

Here is wikipedia definition of functional programmin:
http://en.wikipedia.org/wiki/Functional_programming

Here is wiki definition for emacs
http://en.wikipedia.org/wiki/Emacs

A lot of people say that functional programming is the future, however, functional programming is apparently the past, too.

OOP has good applications, such as GUI, however, functional approach has no problems with modelling GUI.

Then, there is language such as lisp, which has no problems with functional approach and absolutely no problems with object oriented approach. It is pretty fast and in multitude far superior to other 3rd generation languages. However, speed is still one of the downsides of this approach, but with proper knowledge the speed penalty is far smaller than the gain from the features.

Now, don't get me wrong. This site will have a lot of effect on you. Most people here have been peer pressured to their language choices. Most who say they love language X, have not even tried other languages. This is also, because the age domain is relatively low in here and the number of amateurs is far superior to the number of *professionals.

Please, don't try to justify your poor language choices to me in a form of language war unless you can maintain objective position.

* I don't claim to be a professional.




[edited by - captian goatse on February 7, 2004 6:40:13 AM]

[edited by - captian goatse on February 7, 2004 6:42:27 AM]

Share this post


Link to post
Share on other sites
quote:
Original post by Captian Goatse
Please, don''t try to justify your poor language choices to me in a form of language war unless you can maintain objective position.

Oh, the irony.

Share this post


Link to post
Share on other sites
quote:
Original post by coorrae
whats functional a language?
it means it actually works?- kidding



Functional languages are languages with a different programming paradigm/style/methodology than your typical OO or procedural languages. Code tends to be recursive in nature, and the ability to have "code generate code" on the fly was an advantage it had in the past. Thanks to C# this is no longer an issue, when compiling code at runtime is a matter of about 20 lines of code, allowing code to create code at runtime very easily and efficiently.

Functional languages tend to be extremely non-intuitive and quite difficult to read ( for non-trivial projects ). Most still rely on lisp prefix operator/function style of prefix notation. Ie- A + B is no longer A + B, its (+ A B). This doesn''t seem like a big deal but try writing the quadratic formula in prefix notation. x = ( -b + sqrt( b*b - 4*a*c ) ) / (2*a) becomes near impossible to read at a glance. This is just a syntactical issue, but readaibility becomes a major issue as projects grow.

Functional languages are interpreted languages, which generally makes them an invalid selection for anything demanding high performance in real time, such as 3d games. Like all things academic ( functional languages were the defacto standard in AI research, though recently alternatives are arising ) functional languages tend to aquire a fanatical group of followers who believe they have found the most hidden secret that nobody else has ever heard of, seen or tried. Having been through 3 classes requiring Lisp programming, I have yet to find a single reason to ever use a functional language in a non-academic setting, but there is a very ''loud'' minority that would completely disagree with me. Some people love functional languages. Make your own decision. Try using a functional language to write a tetris clone for example.

quote:

but back on topic, I love OOP, and speed, but am I really going to be able to learn make games in c++? It gets so frustrating if for example, I dont know why I have to do more than just put "setgraphics(800,600);". And when I run something, I dont understand what im supposed to do when it says "iostreams are deprecated", or "linker error"


With power and flexibility, comes complexity. You have to do more than setgraphics( 800, 600 ) because there is alot more to a screen than its width and height. Bits per pixel? Refresh rate? Are the bits per pixel an offset into a lookup table, are they explicit RGB values. If you have 16 bits per pixel, how are RGB distributed? 565 444 555??? Is that 800,600 stereovision? If you really just want to get programming and are interested in graphics, I would recommend using Glut and C#. This frees you from most of everything except for what you actually want to code.

Share this post


Link to post
Share on other sites
Glut is essentially a wrapper for OpenGL, which does have an interface not much more complex than CreateGraphics(800,600). In GLUT all you would have to do is:


Glut.glutInit();
Glut.glutInitDisplayMode( Glut.GLUT_DOUBLE | Glut.GLUT_RGBA );
Glut.glutInitWindowSize( 800, 600 );
Glut.glutCreateWindow( "Glut Window Name" );


And you already have a rendering context ( or surface ).

C# is a relatively new OO language. It is similiar to C++ although memory management is no longer required. It has an extensive hierarchal library with some very high level abilities. You can have a fairly sophisticated Windows GUI setup in less than 100 lines of code.

Speed wise, the worst benchmark I have seen listed C# at ~75% the speed of C++ in worst case. Best case typically puts C# at 98-102% the speed of equivalent C++ programs. So speed is not a concern. I strongly recommend trying it out, but I'm heavily biased. As everybody else has already stated, C++ is the standard in professional development, and will almost definitely remain so, at least for the next few years.

[edited by - haro on February 7, 2004 7:12:07 AM]

Share this post


Link to post
Share on other sites
seriously though for a beginner i reckon C# would be a good choice. the documentation is a bit on the thin side, but it''s enough to translate from C++ -> C# once you know the syntax. plus it would give you a good grounding for strong object orientated design (win).

dont listen to captain_goatse. despite having a vaccuous anus it''s stuffed full of this functional programming bullshit! any minute now he might explode and drown in it (hopefully!).

Share this post


Link to post
Share on other sites
quote:

Original post by haro
Functional languages are languages with a different programming paradigm/style/methodology than your typical OO or procedural languages. Code tends to be recursive in nature, and the ability to have "code generate code" on the fly was an advantage it had in the past. Thanks to C# this is no longer an issue, when compiling code at runtime is a matter of about 20 lines of code, allowing code to create code at runtime very easily and efficiently.



Object orientation is an orthogonal concept to the imperative/functional divide. ''Code generate code'' is not a key concept in functional programming, first class functions and closures are (does C# have closures? I couldn''t see them anywhere but then I''ve only dabbled).

quote:

Functional languages tend to be extremely non-intuitive and quite difficult to read ( for non-trivial projects ). Most still rely on lisp prefix operator/function style of prefix notation. Ie- A + B is no longer A + B, its (+ A B). This doesn''t seem like a big deal but try writing the quadratic formula in prefix notation. x = ( -b + sqrt( b*b - 4*a*c ) ) / (2*a) becomes near impossible to read at a glance. This is just a syntactical issue, but readaibility becomes a major issue as projects grow.



What? Lisp is not actually an archetypal functional language (Lisp isn''t an archetype of any paradigm really). Most currently used functional languages use infix operators.

quote:

Functional languages are interpreted languages, which generally makes them an invalid selection for anything demanding high performance in real time, such as 3d games. Like all things academic ( functional languages were the defacto standard in AI research, though recently alternatives are arising ) functional languages tend to aquire a fanatical group of followers who believe they have found the most hidden secret that nobody else has ever heard of, seen or tried. Having been through 3 classes requiring Lisp programming, I have yet to find a single reason to ever use a functional language in a non-academic setting, but there is a very ''loud'' minority that would completely disagree with me. Some people love functional languages. Make your own decision. Try using a functional language to write a tetris clone for example.



Haskell, OCaml, SML, the list goes on for non-interpreted functional languages, in fact all of those listed compile to fairly reasonable native code on a number of architectures.

Just because *you* haven''t found functional programming useful, doesn''t mean it isn''t, or shouldn''t be researched in domains where traditionally C or C++ dominate.

I don''t usually want to wade into these kind of wars, but when people start spouting ill-informed rubbish I can''t resist. Implementation language is certainly a choice, but that choice should be an informed one, not one based on FUD.

Share this post


Link to post
Share on other sites
quote:

(does C# have closures? I couldn''t see them anywhere but then I''ve only dabbled).


C# 2.0 will get anonymous delegates(and it was MY idea - mwaahhahhahah), which are a type of closures.

--
AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.
[Project site] [Blog] [RSS] [Browse the source] [IRC channel]

Share this post


Link to post
Share on other sites
All i want to know is which language will take me the furthest, with language will let me do the most things, what language is the most commonly used....

Could someone please make a list with all the things u can actualy do with C++?


thanks alot

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
After C++, you start learing different APIs.

Windows API (Platform API)
OpenGL API
DirectX
KDE (linux windows)

also, it would be best to learn:

Program structures
Algorithms (designing)

Share this post


Link to post
Share on other sites
bottom line is that the best programmer will be the one that can pick the right tool for the job. C++ is not the best language for everything - but it IS good for a LOT of things.

C++ will remain the professional standard for a LONG time to come simply for market factors... with so many trained and experienced C++ programmers around employers will still need them. Then, say C++ loses the top spot, there are so many billions of lines of code around that companies will be desperate for C++ programmers to stick around to service their old code A bit like a lot of ADA/Fortran programmers still exist, even tho very few new things are developed in it (from scratch).

Jack

Share this post


Link to post
Share on other sites
Considering this is Gamedev.net and not some generic programming site, I''m going to reply to this under the assumption that you want to program games. When it comes to developing professional games, the program language to use is C++. Almost every single published game out there right now is written in C++ (and a few still in C) with the odd function or two in assembly (though thats happening less and less). Blizzard, ID, Valve, you name it, if its sold more than a few thousand titles, whether console or PC, its C++. I''m not trying to say the other languages don''t have merit, but C++ is chosen not because its the ''standard'' (or thats what all that programmers know and they don''t want to switch), but simply because it offers the best balance between higher level functionality and low-level performance. And thats exactly where almost every game on the market right now sits. It may shift in the next 10 years, but it hasn''t much in the last 10, so if you''re serious about getting into the industry, or using industry standard tools, C++ is what you''re going to need to know.

Share this post


Link to post
Share on other sites
Jak&Daxter (an awesome 3D platformer for the PS2) is coded entirely in a customized dialect of Lisp.

Here''s a nifty article Tim Sweeney wrote awhile back: http://www.gamespy.com/legacy/articles/devweek_b.shtm

quote:
I remember reading a very old article about the former USSR, where an American reporter asks, "What is the Russian word for ''fun''?"--to which a Soviet responds, "There is no such word. Fun is not a Russian concept." This is a really profound realization, that your language has such power to expand--or limit--your horizons, and define which concepts you are able to think about fluently, and which ideas are not easily ponderable.


Learn every language (hell, everything) you can. Even if you never wind up using a given language, being able to think in terms of that language will more often than not give you tools with which to think more effectively. It''s the thinking that''s more important (and difficult) than the actual coding anyway.

"Without deviation, progress itself is impossible." -- Frank Zappa

Share this post


Link to post
Share on other sites
quote:
Original post by Chedburn
nice, can u use C++ on websites/internet?

thanks


no but you can use JAVA or PHP which are very like C++




Share this post


Link to post
Share on other sites

  • Advertisement