MAMEWorld >> Programming
Previous thread Previous  View all threads Index   Next thread Next   Threaded Mode Threaded  

Pages: 1

Vas Crabb
BOFH
Reged: 12/13/05
Posts: 4463
Loc: Melbourne, Australia
Send PM


MSVC sucks so bad!
#183234 - 03/02/09 01:44 PM


What is wrong with that piece of crap? Now I'm not a one-compiler man - I build the same code with GCC and SunPRO every day, so I'm used to working around bugs, quirky behaviour and subtle differences in libraries. But I always dread porting anything to MSVC! It's the biggest time-waster there is!

What's with ? The C++ specification says that "and", "or" and "not" are keywords, so why can't MSVC act like it? (I personally don't use them, but plenty of people who spend a lot of time doing Python just use them without thinking.)

Why do , , etc. pollute the global namespace? GCC and SunPRO manage to do it cleanly, just putting the names in the std namespace, but the MSVC headers first put the stuff in the global namespace, then suck it into namespace std with using statements. What's the point of that?

On top of this, it's possible to get MSVC into a state where you can't include cstdlib just with its own headers. It's also possible to get winsock.h and ws2def.h to conflict with each other, once again purely by including supplied headers. What kind of compiler chokes on its own supplied headers?

Why can't it deal with anonymous namespaces properly? If you put an anonymous namespace inside a namespace, the symbols should still be in the containing namespace - they just shouldn't be exported. But MSVC disagrees - it thinks that any anonymous namespace puts names into the global namespace irrespective of any containing namespace. That just makes code messy!

And finally, there's the inconsistent behaviour of dllexport and dllimport: if you simply declare a class __declspec(dllexport) in the library that implements it and use the appropriate #pragma comment to indicate the library name, modules that use it will import methods automatically. But not static data members. Oh no - for that to work, you need to explicitly declare the class __declspec(dllimport) in the module that uses it. Why the inconsistency? Why can't it do the same thing for both methods and data members?

I've now wasted three days at work just trying to get a bunch of stuff to compile and link on Windows. I'm so over it!



keshbach1
Reged: 08/26/05
Posts: 1303
Send PM


Re: MSVC sucks so bad! new [Re: Vas Crabb]
#183593 - 03/04/09 10:26 PM


Just wait until you start compiling at Warning Level 4.



Kevin Eshbach



Vas Crabb
BOFH
Reged: 12/13/05
Posts: 4463
Loc: Melbourne, Australia
Send PM


Re: MSVC sucks so bad! new [Re: keshbach1]
#183599 - 03/04/09 11:39 PM


Now that I've got all the ported C++ libraries building and I'm writing new code in managed C++ I'm enjoying myself. It feels like .NET let off its leash! Most of the things that annoy me about C# aren't there. It has a lot going for it:

  • Different operators for scope resolution, member access and access through reference
  • Simple to make boxed/naked value distinction
  • Both RAII destructor and GC finaliser
  • Less "magic" syntax
  • Indexer properties
  • Separate declaration and implementation
  • #region pragmas are prettier
  • Visual Studio editor is less evil when editing C++ than C#
  • Can specify paths with environment variables without resorting to hacking the project directly



FMecha
MAME's (Armchair) Motorsports Consultant
Reged: 01/18/09
Posts: 152
Send PM


Re: MSVC sucks so bad! new [Re: Vas Crabb]
#185027 - 03/15/09 06:00 AM


How? C++ vs C# ?



Vas Crabb
BOFH
Reged: 12/13/05
Posts: 4463
Loc: Melbourne, Australia
Send PM


Re: MSVC sucks so bad! new [Re: FMecha]
#185030 - 03/15/09 06:29 AM


> How? C++ vs C# ?

OK, compared to C# here are some advantages of Managed C++:

  • Interact with unmanaged objects, functions and structures directly
  • Distinct syntax for unmanaged pointer and managed reference
  • Indexer property syntax
  • Distinct syntax for scope resolution, member access and access through reference ("::", "." and "->" respectively, whereas C# uses "." for all three)
  • Easy to explicitly box value types when you want reference semantics
  • Separate declaration and implementation
  • Split implementation while keeping declaration in one place (C# partial classes split both declaration and implementation, leading to a mess)
  • Give access specifier once and then declare many members, rather than having to put access specifier on each one
  • Full C99 preprocessor and macro metalanguage
  • Full C++98 template metalanguage
  • Separate RAII destructor and GC finaliser
  • Visual Studio isn't as evil about reformatting your C++ code as it is with C#

Enough reasons for you? About the only disadvantage is that it doesn't integrate as well with the form designer.


Pages: 1

MAMEWorld >> Programming
Previous thread Previous  View all threads Index   Next thread Next   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Pi 
0 registered and 56 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 4090