C++ performance article from MMO programmer

Not about OpenMW? Just about Morrowind in general? Have some random babble? Kindly direct it here.
Post Reply
dteviot
Posts: 144
Joined: 17 Dec 2014, 20:29

C++ performance article from MMO programmer

Post by dteviot » 01 Jun 2016, 21:17

I found the following article interesting.
As I say in the title, it's been written by a person who writes game software for a living and is about C++ performance Dos and Don'ts in games.

http://ithare.com/c-performance-common- ... n-wisdoms/

ezze
Posts: 428
Joined: 21 Nov 2013, 13:20

Re: C++ performance article from MMO programmer

Post by ezze » 07 Jun 2016, 09:03

This is well done, probably I do not have the experience of the author. But I do have used C++ in dozen of projects and I really think that the C++ real problems are:
-unintelligible error messages (it's getting much better though);
-lack of a uniformly accepted style guide;
-many libraries feels the need to reinvent the wheel. It's not fault of the language of course and seldom the library is older than the relative language feature, but it does make life more difficult;
-far too many programmers see C++ as "C with some more useless complex stuff" instead of a new language and apply C idioms that make no sense. Once again, not fault of the language but of the teaching.

maqifrnswa
Posts: 180
Joined: 14 Jan 2013, 03:57

Re: C++ performance article from MMO programmer

Post by maqifrnswa » 07 Jun 2016, 19:55

I've wondered about this, from an educational point of view...

When teaching, how much should be spent on "best practices?" Usually, the goal of intro-level courses is to simply learn how things generally work and high-level programming concepts, it's possible for bad habits to sink in early.

It's like you need an intro course, then follow it up with, "ok - now here's real programming." I think schools do this now by introducing a scripting/interpreted language first (java, python, matlab), then introduce C/C++ as giving you access to lower level constructs, which motivates why some things are optimized better than others...

From my experience, almost everything except for games and scientific computing is going towards being built with some scripting language calling underlying C/C++ libraries so the app developers don't need to worry about the details.

ezze
Posts: 428
Joined: 21 Nov 2013, 13:20

Re: C++ performance article from MMO programmer

Post by ezze » 07 Jun 2016, 20:03

As a teacher I found overwhelming start with C++, python is better as first language. It's a great language on its own, so you don't teach something unreal, but you don't have to worry about the low level details.

You can introduce C++ later, when students also learn about machine architecture. But also already know about loop, data structures, control flow... In my opinion C actually come last, because it's much easier to explain it as: "in C++ you could do X, in C you cannot you have to do Y, but you don't have to worry about Z..."
maqifrnswa wrote:From my experience, almost everything except for games and scientific computing is going towards being built with some scripting language calling underlying C/C++ libraries so the app developers don't need to worry about the details.
I think this is the solution to the chicken-egg problem of having good programmers when you don't want to "waste" time teaching. Write slower program and use faster hardware.

Chris
Posts: 1558
Joined: 04 Sep 2011, 08:33

Re: C++ performance article from MMO programmer

Post by Chris » 07 Jun 2016, 21:08

Incidentally, I recently saw this in regards to learning C++ https://www.youtube.com/watch?v=YnWhqhNdYyk.

User avatar
Ravenwing
Posts: 325
Joined: 02 Jan 2016, 02:51

Re: C++ performance article from MMO programmer

Post by Ravenwing » 07 Jun 2016, 23:46

ezze wrote:As a teacher I found overwhelming start with C++, python is better as first language. It's a great language on its own, so you don't teach something unreal, but you don't have to worry about the low level details.
I completely agree, although my reasons aren't entirely applicable to someone majoring in software or programming. Where I went to university, all engineers were required to take an intro to programming course since a lot of engineers have to cobble together some code every once in a while for various projects. That course was in C++ and I was one of the very few who actually enjoyed it, despite it having a lot of the problems mentioned in that video Chris shared (thanks btw). Now I find myself needing to write something for work involving reading data from some sensors and interpreting and recording it. It would have been so much more useful in school learning python and getting general programming concepts along with some examples of using device integration libraries instead of all the low level details that a non computer engineer will never use.

Post Reply