View Single Post
Old 31 July 2015, 13:43   #111
Mrs Beanbag
Glastonbridge Software
Mrs Beanbag's Avatar
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,202
Originally Posted by meynaf View Post
Sorry, but i have written programs in C++ as well and if your "hello world" is 100s of kb then you're doing something wrong.
Perhaps you shouldn't include heaps of .lib in your project.
well, it wasn't just Hello World, it did use RTTI and templates, and i did need to include some libs, but i was still astonished at how big it came out.

You know, design issues are more deadly than bare implementation. This, and not the compiler, leads to bloatware.

If you do new, then init, then function 1, then function 2, then function 3, then delete, instead of doing the whole job with a single call, you get larger code that's all.

I have disassembled megabytes of code, read megabytes of C/C++ sources as well, and very often i am stumped how things can be made complicated for stuff i'd have done with just a few lines...
i do know what you mean... i have seen some shockingly over-egged code, and fixed it, but again this is besides the point.

This kind of bad code isn't what gets you bad pointers. It is usually silly mistakes that get you bad pointers.

Oh i have seen unit tests fail on Windows but not Linux (or was it the other way around?) because of a line like the following:

char* myString = 0
Then someone passes myString as an argument to something... well i think you can guess the rest. Maybe you can also guess that this code was written by someone whose first language was Java.

It seems like spotting this sort of thing is a rare talent, somehow. This particular case only happened in the unit test and the program itself seemed fine, so this went unfixed for months until someone gave it me to look at.

Originally Posted by meynaf View Post
If you don't want me to develop on your example, just say it.
It said a lot more than just the point you wanted to make.
You are in full on attack mode now, aren't you?

It is a very simple website. Its simplicity did not protect it. Yeah that example can be made to prove all sorts of things that are beside the point.
Mrs Beanbag is offline  
Page generated in 0.04864 seconds with 10 queries