My frustrating experience with C++ (please help).

I got a very frustrating experience with C++, realized it's not the tool I'm looking for but now I'm left without knowing what that tool is. So I came here to ask your help if someone here knows what exactly I am looking for.

Before I'll explain my frustration with C++. I was always told that there were libraries for almost everything in C++ and that's one of the reasons I started learning it, but I also realized that it's not as simple as that. For instance, those are a few things I once needed to do:
1. A 3d program with a ball looping to visualizate some physics concepts (study purposes).
2. Make a simple 2d shooter program to play with my friends.
3. Make a program to login in a site, process it's contents, store the results in mysql and saves a png image of the site's visual in my pc. (for statistical analysis, study purposes again).

Those should, in principle, be easy tasks. But in C++ they are definitelly not. I had to:
1. Search for libraries for everything - a library for mysql, for graphics (allegro), for online communication (raknet), for containers manipulation (didn't find, had to make my own), for 3d graphics (tried ogre and irrlicht - realized the program wasn't worth the effort of learning both) to download a url (libcurl++), to process a url (didn't find, my program lacked the feature of saving the visual of the site), to save images (used allegro) and the list goes on.
2. After finding every library I needed I had to compile and install them all and this is insanely frustrating in C++. Every library have different ways of installing, one worse than the other. I spent whole days reading through endless documents trying to compile some of them.
3. After installing every library I needed to LEARN them. I realized, for instance, that it would take some good days to learn to make even simple 3d stuff with irrlicht or ogre. It was certainly not worth the effort as everything I wanted to do a 3d program to visualize a few balls floating around! Good old imagination beated it this time.
4. After everything is allright I end up with lots of unrelated libraries that often don't integrate (for instance: a 3d vector in a 3d api library is something and, in the collision library, it's another) and, worse yet, in an anti-intuitive, time consuming, hard to write language that gives an error for almost everything.


The result is: I spent days of work to make things that (I belive) could've been done in a few hours. So I just realized C++, while doubtlessly one of the most powerful languages, isn't the right tool to make things where productivity, not perfection, is necessary. My question is: what is?

I would like to illustrate things I would like to do without worrying about installing libs or anything:

Find all instances of the class Birds where the modulus of their velocity > 3.
fastBirds = Birds.find(|velocity|>3)

A 3d world with a ball rotating around
1
2
3
4
5
word3d = World3d.create
cam = Camera.create(pos=[40,40,40],direction=[0,0,0])
my3dball = Ball.create(pos=[3,3,3])
3dball.velocity = [2,0,0]
3dball.velocity:rotate(pi/20)


A tool to download a
1
2
3
4
5
6
7
8
siteTool = SiteCoolNiceTool.create()
window2d = Window2d.create()
mysite = siteTool.download('www.blabla.com')
mysite.makeImage.save('c:/blabla_index.png')
datas = mysite.source.regexMatch('something')
for data in datas do
  doSomething(data)
end


Do you get it? It had to be a language with either a strong syntax that makes the programmer worry more about the program than with the programming syntaxes, and with a really, really gigabytes worth pre-build library where I could trust that anything essential (database, vectors, math, sound, string functions, 2d/3d graphics, networking, etc, etc).

I don't know if what I'm asking for exists but I know it could exist as all those things already exist. It would just be a question of integrating and standartizing them all in a single 'syntax', idea, or whatever. You got it.

Please any thoughts on what I said!
Thank you very much.
Last edited on
This is a very interesting post, but it's probably better to post it in the Lounge rather than here.
Try Java.
Or even better, Python
http://wiki.python.org/moin/PythonGames

There is a learning curve to everything. Once you get everything set up, however, python makes it much easier to play around with stuff.
closed account (zb0S216C)
Without hesitation, I'd recommend Lua. I'd recommend Python if OOP is a requirement. If not, Lua++.

Wazzak
Last edited on
closed account (1yR4jE8b)
I'd recommend Python if OOP is a requirement


Python's OOP is slapdash at best, I'd recommend Ruby or Scala.
There is a learning curve to everything.


Agree but sometimes we need to weigh if the additional time spent is worth the final output isn't it? C/C++ no doubt is strong in certain area but it is not *THE* programming language for all stuff. For certain stuff, Java would even be a better fit with it's enormous libraries you get when you install SDK.

So currently, I use C/C++ for performance critical stuff, Java for most business/Android apps,Perl for regular expression. Throw in bash shell for scripting, Javascript for web effects, PHP for web language and there you have it all. A multiple programming languages arsenal that hopefully can solve all sorts of problems I may encounter in my working or personal hobby needs.

And btw that arsenal of programming languages will change. 13 years ago, it was Visual Basic,Lotus Notes but as time goes by it get replaced by other languages.
Let's say that you had a huge problem that required crunching trillions of numbers (like trying to analyze stress in a beam using a Finite Element Analysis method), you're after speed. You'd rather devote a week of processing time to a particular problem instead of several months. Then it might be worth your time to program a computer in c, c++, or maybe even assembly language. It's true that you might spend a week or two putting the program together. But in the end, once you have the **** thing programmed, you can focus on solving your problem.

The more productive types of languages that you're referring to are called 'high level' programming languages. These are languages like Python, Ruby, Lua, Java, Mathematica, R, Cobol (this language is atrocious, best to avoid unless you want to work as a programmer for the banking industry), etc. High level programming languages saves the user time, because they're written in a close-to-human syntax. Low level programming languages tend to be slower to write, harder to read, since they use close-to-machine syntax. These are useful because they're faster when they run. Using them can shave precious fractions of a second off of your operation time (operation being add/multiply/divide/etc.), which, in aggregate can amount to a lot. If you're writing a text adventure, you don't need to worry about making an insanely fast program, most of the time the program will be waiting for the user to input information. Therefore, using a high level language would save you time and frustration.

I hope this helped.
I guess the moral of the lesson is there is no *THE* programming language that can solve all problems in the most acceptable time-frame. Some programming languages are created for certain task and excel in that task alone. So it is highly beneficial for us to know and use multiple programming languages. You could say we are generalist vs specialist but how so often a specialist insist on their well-crafted language to solve certain problem which maybe better and faster solved using another language isn't it ?

As a software developer, we should adopt an open mind. This make us relevant even if say 20 years down the road and we are still doing programming! :)
Topic archived. No new replies allowed.