I only seem to know two modes...

Keep it clean but fun.
Post Reply
Cayle
Posts: 272
Joined: Fri Jul 03, 2009 4:45 am

I only seem to know two modes...

Post by Cayle »

Spaghetti and over-engineered :D

I ran into a problem with my Excel -> VBA -> Python extractor, which are simply unsolvable, due to the wonky nature of VBA. It seems that using mixed type variant arrays as a poor man's struct and then trying to pass these things as parameters to functions; well, that does not work so well. Other parts of the VBA are rock solid and I see no reason to change them, but the exporter needs logic that is simply too complex for VBA to handle.

So I'm dumping the 1500 line exporter module and replacing it with c#. I've never written anything c# before, beyond building a ribbon in VSTO and triggering macros on click events; so this is an adventure.

1 - I really, really like c#! It is a nice language. I always thought that it was just a clone of java, but for .Net. Yeah, it's a lot like java, but with some of java's annoying bits removed. Its a lot less verbose and strings are native types and not wonky, immutable classes. :mrgreen: It does not displace Python as my favorite language, but sure beats java, objective c and a lot of others. I guess that developing for unity is not so bad, language-wise.

2 - I'm totally going from the mixed type variant array spaghetti monster to... how many classes? with how many special methods and abstractions? Oh boy... hold on to your butts!
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: I only seem to know two modes...

Post by hallsofvallhalla »

Yep I like C# as well. Especially after VB.
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: I only seem to know two modes...

Post by Jackolantern »

C# is awesome! Yes, it did start as "Java for the new .NET Platform", but it has grown to be so much more than that now. In some ways it is closer to the metal in that it supports C++ techniques banned from Java, such as operator overloading, value-type structs and more. But then it goes off in some new directions that are really pleasing, such as natively-supported getters and setters (including the totally awesome "automatic properties"), and possibly the biggest thing to happen to any language in the last 20 years: LINQ! I have personally seen 200+ lines of parsing and sorting algorithms get turned into a simple, single-line LINQ query for querying in-memory objects. And it was more memory efficient!

There are also some fixes that Java should have had from the start, such as its busted "protected" access modifier. I (and many others) feel that Microsoft got "protected" right as they made it more like private, except that it is inherited and accessible only from the derived class. In Java "protected" means it is accessible to anything inside the same package. I don't really get why that is extremely useful, but even if you did want it that way, you can use the "internal" modifier for the same effect in .NET. Here is some more info on the differences between Java and C# access modifiers. More options are usually a good thing ;)

I like both languages, and use both, but if I have a choice I usually go with C#, and not just because of Visual Studio :cool:
The indelible lord of tl;dr
Post Reply

Return to “Off-Topic”