Programming standards...no flaming please!
-
mcintyrg wrote:
I have to vote in favour of the C# movement. VB is for kids
I switched from C to C# (company orientations :) ) since 2003... Never wrote a line in VB nor VB.net (apart from some few macros in MS Office). And I can say that there is no huge difference between VB.net & C# :sigh:, (may be C-like syntax but it relies on the same framework :(( ) :: YOU make history :: ^_^
Yeah in truth there is no real difference, just the way you have to write the code. The kid's refererence was really just a jibe at the way you use 'Me' in replace of 'this' ;P I think C++ is where you can do the real shit !! Although C++.NET not sure; don't know about you guys but haven't really seen many jobs going in it.... Lots of words of wisdom...
-
I wasn't really sure if this belonged to a particular message board so please no flaming! I am wondering what others habits are when it comes to programming. I just inherited a huge VB.NET program. In one VB page it has over 10k lines of code. One function within that has about half those lines. Do you have a "limit" on how big/small a function/method/class should be before breaking it into smaller parts? We just used the analyzer on this thing and found one case statement has over 70 routes to go. So I'm hoping to clean this puppy up. BTW...heat index is currently at 109 degrees. Hope everyone else is staying cool.
I've just started working at a new place and bump into uncommented methods over 500 lines on a regular basis. And sometimes find methods over 1000 lines but 5000 lines, what a joke. It would have taken 20 minutes for the original develoer to refractor, instead it takes you an hour just to work out whats going on. Unmaintainable and expensive. I try by refractoring, to keep methods down to under 100 lines. Case statements with over 70 cases can make it difficult but still, the larger a method becomes, the more value there is in refractoring. Classes over 10,000 lines aren't uncommon. Sometimes that just happens to be the right place for the code. I set everything out in regions anyway, so size isn't that much of a problem. BTW just on the subject of VB v C#. Its not the language that decides if the code is elegant or not, its the programmer. I don't understand why so many C# programmers feel so insecure to rubbish VB all the time. I write mainly in C# and prefer it but VB is OK with me as well.
-
Ennis Ray Lynch, Jr. wrote:
Switch to c#
*grin* That may be an effective filter to increase the odds of people who write 5000 line functions never working on the code again, but beyond that I don't see how moving to C# is a good thing. I've done large VB -> C# moves, and there's always a lot of stuff the converters can't fix, or places where the code they write really sucks. One can remove the VisualBasic namespace without moving to C#, if you want to get rid of legacy garbage.
Ennis Ray Lynch, Jr. wrote:
add unit tests.
Adding unit tests to an existing project of any size is a pretty decent sort of task. Unit tests are best written during development, not after. Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
-
Yeah in truth there is no real difference, just the way you have to write the code. The kid's refererence was really just a jibe at the way you use 'Me' in replace of 'this' ;P I think C++ is where you can do the real shit !! Although C++.NET not sure; don't know about you guys but haven't really seen many jobs going in it.... Lots of words of wisdom...