Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1059209 Posts in 43058 Topics- by 35008 Members - Latest Member: Usaflowers

October 31, 2014, 01:09:06 AM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)Moving towards C++ development
Pages: 1 2 [3] 4 5
Print
Author Topic: Moving towards C++ development  (Read 6298 times)
mduffor
Level 0
**



View Profile WWW Email
« Reply #40 on: January 26, 2012, 09:52:57 AM »

Just as a note, if you don't use templates, C++ compile times are pretty fast.  My libraries have about 180,000+ lines of code in the cpp files (another 32k lines in the headers, including comments), and do a clean compile with gcc in about 3 and a half minutes on a single core Atom driven netbook.  And I only need to do full clean compiles if I've been monkeying around with the header files that are used by multiple source files.  IMHO that's not too bad, and it goes even faster if you have a decent computer.

Note that these line counts are just from doing a "wc -l" on the command line, so it just counts newline characters.  So the lines-of-code is only a rough estimate, but gives the size of the files the compiler must deal with.

Cheers,
Michael
Logged

Blog + website = www.mduffor.com
Zack Bell
Level 10
*****



View Profile WWW
« Reply #41 on: January 26, 2012, 09:56:14 AM »

How would you guys suggest going about learning more and more C++ while I try to keep up with Java studies for school? I have enjoyed Java so far and like staying ahead of the class, but it will be difficult for me if I am also learning new libraries and cramming C++ down my throat at the same time...

Should I hold off? Or should I just work harder? Probably a stupid question, but I hope you can understand my dilemma. 
Logged

Impossible
Level 3
***



View Profile Email
« Reply #42 on: January 26, 2012, 10:13:50 AM »

To me, it's a pretty simple breakdown. If you are a programmer at heart, (you enjoy the process of writing code for the sake of the process itself), then C/C++ is where you will ultimately be happiest. If writing code is not your favorite part of the process of making games (you just look at it as the necessary glue that you need to write to create a game) then you should use other tools.

Actually, I think that writing interesting code and writing code for interesting things are two very different (though of course not always mutually exclusive) things. I love both C and C++ and I've written a huge engine (see my sig.) in C++ and loved every second of it, but often when I work on games, when they are not interesting programming challenges, the programming of them is a tedious part that I'd rather not do (it's almost like content creating than programming) and that part is always a strong case for high level languages.

I think of myself as a programmer at heart, but I don't really enjoy C/C++ that much. I prefer managed languages (AS3, haXe, C#) more than fighting with C/C++. Maybe it's a difference between micro and macro management. I enjoy feeling like a supreme overlord "those object are all connected and work in a spectacular manner, haha!" instead of "f*ck, I forgot to free a pointer somewhere here..."

I completely disagree that people who are "programmers at heart" should like C++ and I've written C++ everyday for a living for the last 10 years. Most professional software engineers do not work in C++, people that work in Java, PHP, C#, Python and Ruby are just as much programmers at heart as people that work in C or C++. Actually, if someone is a hardcore computer scientist or software engineer type I'd expect them to not like C++ and instead be fans of Lisp, or Haskell or ANSI C or something. There are also some people that are artists at heart that work mainly with C++ (Zach Gage and Chris Makris for example), so a lot of it comes down to use the best tool for the job.  If you are making a pixel art platformer for PC and Mac you probably don't need to write it in C++ except for portability reasons.
Logged
BrianSlipBit
Level 1
*



View Profile WWW
« Reply #43 on: January 26, 2012, 10:16:09 AM »

If compile times are killing you, then you're doing it wrong--even with template usage.  The last mainstream project I worked on had a codebase just shy of 1,000,000 lines of C/C++ code and a clean + build would take ~3 minutes or less.  Furthermore, a clean + rebuild was not something that happened very frequently--maybe a few times a day.

Precompiled headers are the solution to this "problem". Visual Studio's PCH implementation is pretty robust (and has been for some time) and gcc and its variants typically support their own implementation of PCHs these days (although, that's a more recent feature).
Logged

JOBA
Level 1
*


EZ


View Profile
« Reply #44 on: January 26, 2012, 10:48:45 AM »

I completely disagree that people who are "programmers at heart" should like C++ and I've written C++ everyday for a living for the last 10 years. Most professional software engineers do not work in C++, people that work in Java, PHP, C#, Python and Ruby are just as much programmers at heart as people that work in C or C++. Actually, if someone is a hardcore computer scientist or software engineer type I'd expect them to not like C++ and instead be fans of Lisp, or Haskell or ANSI C or something. There are also some people that are artists at heart that work mainly with C++ (Zach Gage and Chris Makris for example), so a lot of it comes down to use the best tool for the job.  If you are making a pixel art platformer for PC and Mac you probably don't need to write it in C++ except for portability reasons.
Seconded.

I only touch C++ when I need performance and it turns out I rarely need it.

There are languages that I find a lot more concise and productive.

I miss reflection and attributes/metadata.

C++11 introduced lambdas, but it still doesn't look nearly as elegant as:
Code:
players.where(i => i.age > 10).orderby(i => i.score).select(i => i.name);
I basically wrote a line that gets me names of all players over age of 10, ordered by score. I love stuff like this.

And there are plenty of powerful features and beautiful little tidbits like that in Python, C#, Groovy, Ruby, etc that makes using them a joy.

I want to do as much as possible with as little as possible code.

Logged

Instant TileEd - draw pixel art games and export them to Tiled TMX!
Looking for artist for a CRPG!
InfiniteStateMachine
Level 10
*****



View Profile WWW Email
« Reply #45 on: January 26, 2012, 02:53:30 PM »

How would you guys suggest going about learning more and more C++ while I try to keep up with Java studies for school? I have enjoyed Java so far and like staying ahead of the class, but it will be difficult for me if I am also learning new libraries and cramming C++ down my throat at the same time...

Should I hold off? Or should I just work harder? Probably a stupid question, but I hope you can understand my dilemma. 

I think I'm pretty much on a similar plane as you right now. I've been trying to learn c++ as much as possible between my classes.

I did bang my head against the wall a few times but what really worked for me was to make a small game in SFML. Using SFML classes almost felt like working in a managed language at some points. They were clean and easy to use.

After that I started trying to learn openGL via GLUT/GLEW etc... Didn't work out too well.

Later there was a thread here on TIG discussing libraries for getting a openGL window and Average Coder suggested just doing the OS calls and setting it up yourself. I tried that and I actually found it easier overall. Plus I learned a lot about how win32 works.

So SFML then from scratch has really worked for me. I now have a little windowing framework that I use to do little OpenGL apps and tests. It's really nice to be able to just drop into OpenGL and fuck around with stuff Smiley
Logged

Zack Bell
Level 10
*****



View Profile WWW
« Reply #46 on: January 26, 2012, 02:57:52 PM »

Hey, thanks. I'll definitely look into SFML tonight. I'm having more fun with Java than I thought that I would be, so we'll see when I get around to doing this.  Embarrassed
Logged

rivon
Level 10
*****



View Profile
« Reply #47 on: January 26, 2012, 03:12:34 PM »

I'd say that you should primarily focus on school. Learn C++ in the spare time.
Logged
Zack Bell
Level 10
*****



View Profile WWW
« Reply #48 on: January 26, 2012, 03:18:30 PM »

This quarter we are going in depth with all of the collections in Java. Lists, maps, etc.

Next quarter we're just supposed to program tetris, from scratch, in Java. It has been said that this class is the "weeder class" and that this is when most CS students changes majors. I can't wait for this class, honestly. Haha.
Logged

eigenbom
Level 10
*****



View Profile WWW
« Reply #49 on: January 26, 2012, 03:18:58 PM »

Yeh, I agree, make sure you stay ahead of the class. Start making awesome games in Java instead.
Logged

Zack Bell
Level 10
*****



View Profile WWW
« Reply #50 on: January 26, 2012, 03:25:10 PM »

Alright. I think it's probably safe to just stay on top of everyone at school. If I'm taking Java classes and becoming better at OOP in general, that should help. I'll eventually be taking graphics programming and things like that which will also translate better into making games.

I'll continue my GM and Flash on the side and I should be fairly well rounded when I'm done with school.

I hope  Ninja

EDIT: The class moves slow and I'm moving quickly. I guess this is the reason for my panic  Tongue

For example, I created a Texas Hold 'em text game in the time that most people figured out how to make an ArrayList<Card> this week. Grrr.
Logged

wademcgillis
Guest
« Reply #51 on: January 26, 2012, 04:20:29 PM »

Alright. I think it's probably safe to just stay on top of everyone at school. If I'm taking Java classes and becoming better at OOP in general, that should help. I'll eventually be taking graphics programming and things like that which will also translate better into making games.

I'll continue my GM and Flash on the side and I should be fairly well rounded when I'm done with school.

I hope  Ninja

EDIT: The class moves slow and I'm moving quickly. I guess this is the reason for my panic  Tongue

For example, I created a Texas Hold 'em text game in the time that most people figured out how to make an ArrayList<Card> this week. Grrr.

Welcome to the life of almost everyone on these forums.
Logged
InfiniteStateMachine
Level 10
*****



View Profile WWW Email
« Reply #52 on: January 26, 2012, 04:42:18 PM »

This quarter we are going in depth with all of the collections in Java. Lists, maps, etc.

Next quarter we're just supposed to program tetris, from scratch, in Java. It has been said that this class is the "weeder class" and that this is when most CS students changes majors. I can't wait for this class, honestly. Haha.

that sounds awesome. We had to make a calculator :/


I think it's ok to study C++ as well as school. You'll be ahead of the game when you get to c++. It's really serving me well now. I got a awesome AI research job with the faculty at my school working with people years ahead of me in our program because I spent extra time learning related material.
Logged

Zack Bell
Level 10
*****



View Profile WWW
« Reply #53 on: January 26, 2012, 05:14:11 PM »

@Wade: Yeah, I feel ya...  Concerned

And yeah, that sounds cool. I'm going to try to learn as much as possible. It's just that I transferred to this school this year because it was ranked very, very high in terms of CS, so I'm still getting the hang of things and trying to focus on class material Smiley

Logged

Mikademus
Level 10
*****


The Magical Owl


View Profile
« Reply #54 on: January 26, 2012, 05:39:35 PM »

There is too much negativity in this thread. Learn C++. Yeah, it will be heavy going at first, because it IS the most complex computer language we have. But is it good complexity, and it allows you more freedom and power to express your solutions than any other language. When you have learned it it will feel freer than any other language you will ever use. The question is if you need C++. You can make games using a bath tub or a TI calculator. But if you want to work on AAA games you will need C++, and if you want to benefit from as many 3rd party libraries as possible you will need C++, and regardless of whatever examples people will bring up with games made in different languges C++ is the best language to make games in, WHEN you know the lanaguage well enough. You might as well enjoy the ride and start off expecting hardship but one that will develop into a rewarding relationship of mutual respect. C++ is a sophisticated lover that requires you to know what you're doing but gives back as much as it demands. And all its demands will make you into a better programmer and a better thinker.
Logged

\\\"There\\\'s a tendency among the press to attribute the creation of a game to a single person,\\\" says Warren Spector, creator of Thief and Deus Ex. --IGN<br />My compilation of game engines for indies
Zack Bell
Level 10
*****



View Profile WWW
« Reply #55 on: January 26, 2012, 06:28:01 PM »

I am 100% confident that I will need C++ and that I will learn C++, I just think that I'm going to take it slow until summer when I'll only have one class. Thank you for that insight though, I agree that the thread was getting a bit off topic and negative.
Logged

JOBA
Level 1
*


EZ


View Profile
« Reply #56 on: January 26, 2012, 07:29:26 PM »

There is too much negativity in this thread.
You're sorta part of the problem sir.

Yeah, it will be heavy going at first, because it IS the most complex computer language we have. But is it good complexity, and it allows you more freedom and power to express your solutions than any other language. When you have learned it it will feel freer than any other language you will ever use.
You see, bullshit like this riles up people.
Talking in absolutes and all that.

When you have learned it it will feel freer than any other language you will ever use.
Seriously, WAT.  Facepalm

The question is if you need C++.
It's the BEST language we, have right? I mean, of course we need it. Who woudn't need it? Shrug

If you want to sell a programming language to a programmer, show a code snippet that does something cool and powerful, you know, back up some of your claims for a change.

There's many programming languages out there and new ones coming out all the time, you can't honestly call something the most powerful/free language of all time, of all time. (unless the only other language you're familiar with is Java or something)

So I kindly ask you to refrain from doing so. Gentleman
Logged

Instant TileEd - draw pixel art games and export them to Tiled TMX!
Looking for artist for a CRPG!
Average Software
Level 10
*****

Fleeing all W'rkncacnter


View Profile WWW Email
« Reply #57 on: January 26, 2012, 08:04:57 PM »

you can't honestly call something the most powerful/free language of all time, of all time. (unless the only other language you're familiar with is Java or something)

Programming languages are formally specified constructs with well understood and analyzable properties.   It is absolutely reasonable to claim that there is a 'best' programming language (proving which one it is may be prohibitively difficult, however).  Programming language theory is widely studied branch of computer science that deals with exactly that.

I wouldn't go so far to claim that C++ is it, as the resident Ada fanboy I have to point out that Ada is roughly of the same size and complexity of C++, and is in my opinion a better language for game programming.
Logged

Franchise - The restaurant wars begin!

What would John Carmack do?
Zack Bell
Level 10
*****



View Profile WWW
« Reply #58 on: January 26, 2012, 08:36:46 PM »

-Hadn't heard of Ada.
-Went to Wikipedia.
-Looked through some sample code.
-Mind = blown.
-Don't know if love or hate.
Logged

JOBA
Level 1
*


EZ


View Profile
« Reply #59 on: January 26, 2012, 09:28:59 PM »

you can't honestly call something the most powerful/free language of all time, of all time. (unless the only other language you're familiar with is Java or something)

Programming languages are formally specified constructs with well understood and analyzable properties.   It is absolutely reasonable to claim that there is a 'best' programming language (proving which one it is may be prohibitively difficult, however).  Programming language theory is widely studied branch of computer science that deals with exactly that.
I'm sorry, you didn't convince me.
Would you be as kind to introduce me to those formally specified mathematic formulae for quantifiably evaluating "bestness" of a programming language X?

You can say stuff like programming language X has features { a, b, c, e }, but language Y has features { a, c, d } and hence X > Y.
But there's plenty of assumptions and preconditions there, like feature b + e > d.
Well, you could say that the features b and e are more important for programming games, but that is purely a subjective opinion and not an absolute "bestness" value.

There are no well agreed upon terms for what makes a "best" programming language as far as I know.



Logged

Instant TileEd - draw pixel art games and export them to Tiled TMX!
Looking for artist for a CRPG!
Pages: 1 2 [3] 4 5
Print
Jump to:  

Theme orange-lt created by panic