Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: cheeto23 on April 05, 2008, 10:49:35 pm

Title: dev student in distress...
Post by: cheeto23 on April 05, 2008, 10:49:35 pm
 :?
im a student of westwood online, and i have a report due in one week.  the report is basically comparing, contrasting, weighing pro's and con's, of IDE's.  Also if the specific IDE's were intimidating and how, and also if any are better suited for certain types of tasks.  I have Visual Studio Pro '08, Bloodshed Dev-C++, and Code::Blocks...so I'm looking for advice from programmers who have used these IDE's...preferably from someone who has used more than one of these three.  any help would be greatly appreciated
cheeto
Title: Re: dev student in distress...
Post by: Alexis on April 05, 2008, 11:11:54 pm
Hi Cheeto23,

DevC++ is obsolete now, is has not been maintained for years. For a good open-source IDE, no hesitation : Code::Blocks!

Visual C++ is a very good product (the debugger is so nice!), but it is proprietary and Microsoft is not very focused on C++ any more. They're rather pushing their .NET platform and C#.

For more details, read :
http://forums.codeblocks.org/index.php/topic,8074.msg60598.html#msg60598 (http://forums.codeblocks.org/index.php/topic,8074.msg60598.html#msg60598).
Title: Re: dev student in distress...
Post by: MortenMacFly on April 06, 2008, 09:01:07 am
One note:
Dev-C++: Thee is still wxDev-C++ which seems to be under active development.
One important (design) aspect of C::B is surely that it's a cross-platform IDE whereas the others are not (and most likely will never be). In addition: C::B supports a wide range of compilers whereas (wx)Dev-C++ support only GCC (to my knowledge) and VC only the Ms compilers or compilers that have a 100% compatible interface (I am thinking of the Intel compiler suite here).
Keep in mind the UI frameworks that is supported natively (so it has an UI editor for that): Dev-C++: none; wxDev-C+++: wxWidgets; VC8: MFC, .NET... (whatever, I don't really know); Code::Blocks: wxWidgets.
Title: Re: dev student in distress...
Post by: Alexis on April 06, 2008, 02:56:01 pm
Quote
Dev-C++: Thee is still wxDev-C++ which seems to be under active development.
Looks like (in their Web site) it hasn't been updated for one year, or am I missing something ? Good tool, but buggy and CB is now far ahead ! I tested both, and got rid of wxDevC++ for CB.

Quote
VC8: MFC, .NET... (whatever, I don't really know);
and also ATL/WTL

And one other thing : the plugin system. CB is very extensible, and (wx)DevC++ is not.
Title: Re: dev student in distress...
Post by: gibxam on April 21, 2008, 09:49:24 pm
Hey cheeto,

This is actually my first time as a registered user to the site but i was just scrolling through i saw this post. I am actually in the exact same position  as you as far as IDEs. I have been working with C++ for about the last 3 and a half months. I started out with Dev-C++ and i still think it works pretty well even though it hasnt been maintained. However i upgraded to MS Visual C++ express a little while ago and it is pretty "intimidating"; it definitely has a lot of helpful features and you can get pretty serious control of your projects, but it is still just "intimidating". Code blocks is like the best of both worlds for me at least. It offers a similar environment as Dev-C++
with some of the more important features of MS V C++ express. The problem that i have had so far with Code Blocks is that i find the debugger a little bit annoying, especially when working with classes, structures, or functions, if you don't specify whether or not you want to 'step in' or 'step over' the debugger will assume you want to step over. This really only takes a little bit of getting used to though.
I hope this helped you, so far i really like these forums and i just wanted to try to give back a little :) !
Title: Re: dev student in distress...
Post by: ouch on April 22, 2008, 12:20:01 am
well I've used VC++ 6.0 profesional edition for years, it's compiler is showing it's age though so I went to find something better. I found Visual Studio express 9.0, and codeblocks.

here is my review of each:

VC++ 6.0: probably the "tank" of the software developer. It's old, slow, but will pound out working code in relative (well at least mild ;) ) comfort to the programmer every time. It's debugger while being very nice, is lacking the features of the newer v9.0 counterparts. It's form builder is in classic microsoft fation very well designed. your imagination is the limit and it allows you to hook code up to controls fairly quickly. It's compiler is very unoptimized. It's slow, insecure, and was made before multiple cores were all the rage. The compiler also has some anoying bugs in it if you push the compiler to it's limits.

Visual Studio express 9.0: From old run down "tank" to high performance luxury ferrari... the IDE has more comeforts to the programmer than 6.0. It does this by automateing a lot of the tedius stuff. the compiler is lightning fast, very optimized, and from what I can see is at least relatively secure. The express edition doesn't come with form builder but I suspect it is very, very, good. However what takes the cake here is the debugger. I don't think you will find a better one for any environment.

Microsoft stuff however only runs on microsoft stuff... In todays world with vista scaring people into ubuntu (linux) world, this is a huge problem.

Codeblocks: The IDE that tries to be everything for everybody. It seems it prefers you to use mingw along with the GDB debugger and wxWidgets for the GUI so I'll rate it with that configuration as it's also what I'm currently useing. the IDE has quite a few features. it seems to take features from an assortment of IDE's and throws them all together in one. As such, it usually has some feature to allow you to do what you want. Once you figure out all these features you move around in your code fairly fast with relative ease and actually code a bit faster in codeblocks than either microsoft products. It however has one problem assoiciated with all wxWidget apps... it consumes CPU cysles just being open. it takes 20-25% of my processor to just sit there. I can't help but feel this effects comiple time and my projects performance. wxSmith's form builder while very easy to use but doesn't support all the wxWidget controls, and tries to automate things you wish it wouldn't... However for programmers like me just starting out with wxWidgets it's a real life saver in understanding how wxWidgets controls function in comparison to microsoft's controls. mingw is well... it's free I guess... If 6.0 is a tank, and 9.0 is a ferrari, mingw is some old broken down rust mobile held together with bungie cords, tie straps, and old extension cords used as rope... It's painfully slow (slowest compiler I've ever come across actually) what takes minuates in mingw compiles instantly in the 9.0 compiler and seconds in the 6.0 compiler. It's horribly optimized, allowing for some very slow, large file sizes being outputed. You also have to take great care in knowing which build has what switches enabled. 1 switch can mean the difference between a 1 min compile and a 1 hour compile. the GDB debugger is well... it's free too... ;) I often find myself altering my code just so I can better see what is going on in the debugger. It's gotten so bad that now I debug my programs with a series of status bar messages and opt to avoid the debugger if at all possible...

So what am I useing for main dev work now? Codeblocks with mingw, gdb, and wxWidgets. Why is that considering mingw and GDB suck so horrible it boggles the human mind? well Codeblocks has a few features the others do not.

1: designed to support cross platforming so well the IDE itself is cross platform capable.

2: it can use practically any compiler out there. So I'm not suck with mingw forever. (I seriously don't know how much longer I can put up with it. I just hate it so much... but that little voice in my head says: "But... but, It's free man! FREEEEE!" :lol:)

3: it's interface is more laid back, better organized and friendlier. I don't have remember what 3 submenus I have to go too to configure the second submenu of the first submenu of that 2nd menu item... (classic microsoft visual studio problem right there :) )

If real estate ever picks up again I think I might try hooking codeblocks up to intels compiler and giving that a shot. But till then I'll just have to keep waiting for that freaking mingw to compile such simple code structures...
Title: MingGW speed
Post by: Alexis on April 22, 2008, 10:21:03 am
Quote
It's horribly optimized, allowing for some very slow, large file sizes being outputed. You also have to take great care in knowing which build has what switches enabled. 1 switch can mean the difference between a 1 min compile and a 1 hour compile. the GDB debugger is well...
Well, with the last MingGW version and using precompiled headers, the compilation/link process has a very decent speed compared to VC 8.0's one. I don't see the huge difference you depict.
Title: Re: MingGW speed
Post by: troels on April 22, 2008, 10:58:09 am
MingGW ...using precompiled headers...decent speed compared to VC 8.0's one. I don't see the huge difference you depict.
I see it here, absolutely, all the time. Sadly, ouch is right on all [speed] points.
Using pch changes little, and besides, MS has had much better (fast) pch support for 10+ years. AFAIK MinGW supports batch compilation (more than one source file as parameter to gcc.exe) as MS does, if CB utilized this speed would probably improve somewhat.

Edit:
It's form builder [resource editor] is in classic microsoft fation very well designed.
Eh? Windows 'resources' is basically a Windows 3.1 thing. You only get a real 'form builder' if you take the dotnet route, for regular C++ development MS is offering nothing comparable to say DialogBlocks, just the old primitive resource editor (MFC people are stuck with this).

Regards
Title: Re: dev student in distress...
Post by: thomas on April 22, 2008, 11:12:14 am
Quote
If 6.0 is a tank, and 9.0 is a ferrari, mingw is some old broken down rust mobile held together with bungie cords, tie straps, and old extension cords used as rope... It's painfully slow (slowest compiler I've ever come across actually) what takes minuates in mingw compiles instantly in the 9.0 compiler and seconds in the 6.0 compiler. It's horribly optimized, allowing for some very slow, large file sizes being outputed.
I have to object to this. Sorry, but I'm really soooooo fed up with those unfounded, biased Microsoft-vs-gcc comparisons.
All these have in common that people find Microsoft's compiler being superior because they compare a 5 year old gcc with a latest-development-line Microsoft compiler, and in addtion to that fail to even properly use gcc.

You're the one who recompiled wxprec.h for every source file in the project last week, aren't you? I'm sorry, of course this will take hours, but how is that MinGW's fault? While it is true that even recent versions of gcc still compile somewhat slower overall, it is by no means a problem, even for large projects.

Unless you enforce code bloat by abusing the programming language (such as in wxWidgets), file sizes are not significantly larger (on the order of 20-90 kB fixed overhead, depending on what you use) for reasonably sized projects with any recent versions of gcc. A few dozen kilobytes fixed overhead should not really matter for programs that are normally several megabytes in size.
But still, we're comparing apples and oranges here. You can tell gcc to link to the runtime dynamically (which MSVC always does) to remove that overhead alltogether. Of course, if you do that, then gcc will have the same portability problems as MSVC.

Regarding optimizations, it has to be said that recent versions of MinGW/gcc used correctly not only compete with Microsoft's compilers, but indeed optimizes better in many situations.

I'm not saying everyone should use gcc. If you like the Microsoft compiler, then please go ahead and use it. Just don't spread stories about gcc/MinGW that belong to the realm of myths and legends and are most unfair.
Title: Re: dev student in distress...
Post by: troels on April 22, 2008, 12:07:46 pm
You yourself spread compiler FUD. Remember this

The Express version is not usable (for anything serious)
(http://forums.codeblocks.org/index.php/topic,7113.0.html)

Did you ever try it? No?
Title: Re: dev student in distress...
Post by: thomas on April 22, 2008, 01:39:25 pm
You yourself spread compiler FUD. Remember this

The Express version is not usable (for anything serious)
(http://forums.codeblocks.org/index.php/topic,7113.0.html)

Did you ever try it? No?
I did when it came out, and it isn't usable for anything serious (unless one is willing to collect some odd bits here and there, and pirate some of the missing libraries, or never want to use 50% of the stuff, or never want to debug, etc).
You can't really blame them either, after all they want to stay in business. If the freely downloadable version was fully usable for serious development, nobody would pay the 500 dollars (or was it 600? I forgot...) for the full version, anyway :)
Title: Re: dev student in distress...
Post by: troels on April 22, 2008, 01:50:19 pm
it isn't usable for anything serious (unless one is willing to collect some odd bits here and there, and pirate some of the missing libraries, or never want to use 50% of the stuff, or never want to debug, etc).
I don't see anything missing from the debugger. The pirated missing libraries referred to must be MFC, which is indeed left out (just as well, it is outdated). The Express edition comes with everything you need for [single platform] wxWidgets or Qt development for instance [only thing missing is a proper form designer]. You know how to argue. Do you know when to stop too?


Title: Re: dev student in distress...
Post by: killerbot on April 22, 2008, 03:36:44 pm
everybody calm down. No need to argue.

I am afraid our student, the original poster,  is getting in serious distress when he reads this discussion :-)

On the other hand, even when having these discussions, will still manage to create a super CB :-) 8)
Title: Re: dev student in distress...
Post by: troels on April 22, 2008, 04:32:10 pm
Compilation speed isn't everything. Code::Blocks is truly wonderful software period.
Greetings

Title: Re: dev student in distress...
Post by: ouch on April 22, 2008, 09:33:22 pm
actually both mingw and MSVC++ 6.0 was first released in 1998. GCC however has been around since 1987. (hurrah for wikipedia ;) )

also thomas, you keep refering mingw to gcc which leads me to believe your on linux useing an integrated gcc compiler which is always a lot faster than mingw.

whether or not the difference is the OS or the port I couldn't tell you though...
Title: Re: dev student in distress...
Post by: thomas on April 22, 2008, 10:21:02 pm
Using MinGW gcc 4.2-dw2 :)  But yes, you're right, they're faster on Linux. I think that the process creation overhead plays a not quite so insignificant role in that too (much more expensive under Windows).

My post may have been somewhat too harsh towards you personally, I apologise for that. Anything similar to "MinGW/gcc is slow" or "gcc is a bad compiler" is like a red rag to a bull for me. It is an urban myth that doesn't seem to die.
Title: Re: dev student in distress...
Post by: thomas on May 13, 2008, 03:10:59 pm
Lol, what a shame this didn't come a month earlier :)

Quote from: http://www.gamedev.net/community/forums/topic.asp?topic_id=494086
I have a base class, which, for simplicity's sake, we'll just call Base. Not surprisingly, Derived is derived from Base. Base has a bunch of member variables and Derived adds some more. So far so good, right?

Now at some point my program just segfaults. At first I was completely puzzled as to what caused the crash. For 2 days I kept stumbling completely in the dark. Then I noticed that the crash only happened when I had previously made an assignment to Base's member m_pExceptionResult (which is a boost::shared_ptr). I started looking for possible out-of-bound array accesses and other such things that tend to corrupt a program's memory but couldn't find any place I did anything like that. So I took a look at the memory addresses of the members of Base and Derived respectively, and this is what I found out:

- m_pExceptionResult (boost::shared_ptr), the last member of Base, starts at address 0x1857268 ... sizeof( pExceptionResult ) gives 8 bytes
- m_value (an std::basic_string< wchar_t >), the first member of Derived, starts at address 0x1857264 ... sizeof( m_value ) gives 32 bytes

As you can see from that, the memory occupied by m_pExceptionResult partially overlaps with that of m_value!! So my question to that amounts to a simple WTF???

P.S. I'm using Visual C++ 2005.
It isn't nice to laugh at someone else's misfortune, but I can't help it... still rolling on the floor.
See, stuff like that is why I'd never use one of Microsoft's compilers.
Title: Re: dev student in distress...
Post by: Michael on May 13, 2008, 07:13:55 pm
Hello Thomas,

what you report is quite scaring, but good to know :). It remembers me some bad experiences I have had with Visual C++ 6, 7.0 and 7.1 (I also had some nice experiences btw).

Anyway, time ago (if not years :)), I have posted a website where they have made 'conformance tests' by using different compilers. It is a bit old, but still of interest (hope they will update it one day). Here is the link for those who are interested:

http://forums.codeblocks.org/index.php/topic,1670.msg12192.html#msg12192

Ok, I will close here my small parentheses :).

Best wishes,
Michael
Title: Re: dev student in distress...
Post by: JGM on May 14, 2008, 03:37:50 pm
It isn't nice to laugh at someone else's misfortune, but I can't help it... still rolling on the floor.
See, stuff like that is why I'd never use one of Microsoft's compilers.

Something similar happened to me with GCC on Linux (ubuntu). I Created a container with this function

Code
Add(T object)
{
  if(m_Count == 0)
  {
     m_Data = new T[1];
     m_Data[0] = object;
     m_Count = 1;
  }
  else
  {
     T tempData = new T[m_Count];
     for(int i=0; i<m_Count; ++i)
     {
        tempData[i] = m_Data[i];
     }
     delete[] m_Data;
     m_Data = new T[++m_Count];
     for(int i=0; i<m_Count; ++i)
     {
       m_Data[i] = tempData[i];
     }
     m_Data[m_Count-1] = object;
     delete[] tempData;
  }
}

That code gave me segfault by the memory allocation functions of the c/c++ libraries, the error wasn't on my code, dont know why happened that :( Maybe some similar issue to MS Compiler. What a headache  :?
Title: Re: dev student in distress...
Post by: Seronis on May 15, 2008, 05:03:49 pm
Quote
...the error wasn't on my code...
Im truely just a hobbyist noob but i think it is in your code.  Its also really early for me and I might be misreading a part.

In the 'else' block you create tempdata equal to the current size of m_Data and copy everything before freeing the memory m_Data occupies.  You then increment the target size (m_Count) so that when you reallocate m_Data it now has room for the new object you are inserting.  You then copy the now larger number of items from tempdata to m_Data, meaning that you attempt to retrieve one-too-many objects from tempdata into m_Data (you read past the end of tempdata).  So:

Code
     m_Data = new T[++m_Count];
     for(int i=0; i<m_Count; ++i)
     {
       m_Data[i] = tempData[i];
     }

should be

Code
     m_Data = new T[++m_Count];
     for(int i=0; i< (m_Count-1); ++i) //dont go out of bounds
     {
       m_Data[i] = tempData[i];
     }

Right?  Sorry if im imagining things.  Wait actually more appropriate place to correct would be:

Code
T tempData = new T[m_Count+1];
Title: Re: dev student in distress...
Post by: thomas on May 15, 2008, 09:18:54 pm
Yes, that looks like you're running out of bounds. That's a nasty to detect bug, because it won't work reliably, but it won't crash reliably, either. ( ---> but, not the compiler's fault)
Title: Re: dev student in distress...
Post by: JGM on May 19, 2008, 12:05:32 am
Im truely just a hobbyist noob but i think it is in your code.  Its also really early for me and I might be misreading a part.

You are a great noob!

You have all the reason.

The headache I got checking the code, and didn't see that.  :oops:
At least was a good exercise for you  :wink:
Two pairs of eyes work better than one pair :)

Well, guess then that GCC is perfect :P