|
There's nothing more frustrating than maintaining crappy code
Elegance is in the hands of the coder. You can write efficient and elegant code in pretty much any language (VB.NET is no exception), just as you can write jibberish, inefficient code in pretty much any language (C# is no exception).
Unfortunately it sounds like from this forum that VB.NET is the language of preference for hacks, which disappointingly gives the language a bad name.
|
|
|
|
|
Eduardo Fandangle wrote: Unfortunately it sounds like from this forum that VB.NET is the language of preference for hacks, which disappointingly gives the language a bad name.
The language was designed for hacks. Literally. Important design choices were made to support VB6 hacks. A bastardized upgrade to a bastardization of a bastard language. Little surprise that the hacks seem more comfortable...
----
It appears that everybody is under the impression that I approve of the documentation. You probably also blame Ken Burns for supporting slavery.
--Raymond Chen on MSDN
|
|
|
|
|
I love vb.net
You're all just jealous of not having My.Settings :>
Ok, I'm just joking. Noone freak out
www.wickedorange.com
|
|
|
|
|
Hear hear Eduardo!
David Loring
!! Keep Music Live !!
|
|
|
|
|
If C++ is heaven and VB.Net is hell then C# is probably purgatory.
|
|
|
|
|
Amen
A polar bear is a bear whose coordinates has been changed in terms of sine and cosine.
Personal Site
|
|
|
|
|
Pascal Ganaye wrote: C++ is heaven and VB.Net is hell
VB.NET might be hell - I can't comment on that.
But C++ is certainly not heaven.
Its more like the treadmill of everyday life:
Somtimes fun and really exiting, somtimes making you mad, but most of the time just plain boring and repetitive.
Failure is not an option - it's built right in.
|
|
|
|
|
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Christian Graus wrote: int g = item.Count - 1 + 1;
Well this is no help for your cause but I upgraded some custom paging code written in ASP to VB.NET.
If intPageLength <= (intTotalPages/intPageLength - 1) + 1 it took me forever to fix that crap.
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
A small snippet from inside the .NET Framework (2)...
<font color="#1000a0">if</font> ((<a title="string portName; // Parameter">portName</a> == <font color="#800000">null</font>) || !<a title="string portName; // Parameter">portName</a>.<a title="bool System.String.StartsWith(string, StringComparison);" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String/StartsWith%28String,System.StringComparison%29:Boolean">StartsWith</a>(<font color="#800000">"COM"</font>, <a title="System.StringComparison" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.StringComparison">StringComparison</a>.<a title="StringComparison System.StringComparison.OrdinalIgnoreCase;" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.StringComparison/OrdinalIgnoreCase">OrdinalIgnoreCase</a>))
{
<font color="#1000a0">throw</font> <font color="#1000a0">new</font> <a title="System.ArgumentException.ArgumentException(string, string);" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.ArgumentException/.ctor%28String,String%29">ArgumentException</a>(<a title="System.SR" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System:2.0.0.0:b77a5c561934e089/System.SR">SR</a>.<a title="string System.SR.GetString(string name);" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System:2.0.0.0:b77a5c561934e089/System.SR/GetString%28String%29:String">GetString</a>(<font color="#800000">"Arg_InvalidSerialPort"</font>), <font color="#800000">"portName"</font>);
} from the System.IO.Ports.SerialStream constructor, why check for a port name that does not begin with COM? Other Win32 stuff doesn't do this, proof via Hyperterminal.
Thankfully MS said they're going to remove this from the next version of the framework
|
|
|
|
|
posted it long time back in lounge but still deserves to be posted here
Our customer reported once that the program we shipped is corrupting his windows somehow considering it was simple data processing application i was dazed and confused so i asked him what happens he said windows is showing a Message box "Internal windows error, please restart"...... six hours later
i found this in the code
try
{
.
.
.
}
catch(...)
{
MessageBox("Internal windows error, please restart");
}
i was so mad partly at the *briliant coder* who wrote it and partly at myself that i didn't enforce code reviews before shipping
to his defense he said "i didn't think an exception could happen there"
for people who care it was a Divide by zero exception
I dislike feeling at home when i am abroad.
|
|
|
|
|
While I was module lead in my previous organization[^], during peer code review, I found one developer doing this
try<br />
{<br />
opendb();<br />
}<br />
catch ()<br />
{ <br />
try<br />
{<br />
opendb()<br />
}<br />
catch ()<br />
{<br />
throw ...<br />
}<br />
}
The purpose of opening connection in catch and again catching it. He couldn't answer why he coded that way!
|
|
|
|
|
buahahahahahaha that's good
|
|
|
|
|
hehe and I thought programmers are almost the most logically thinking people.
|
|
|
|
|
Logically Thinking -- True.
But sometimes, throws exceptions.
|
|
|
|
|
When I first starting programming in .NET I was fairly new to object-oriented programming. The first program I ever made for .NET had 2 classes that needed to communicate together. I accomplished this by creating a .dll in VB.NET that used implicit late-binding to call the methods in the other class. After a while I realized I could just pass a reference to the class it needs to communicate and it could call the methods directly. 2
█▒▒▒▒▒██▒█▒██
█▒█████▒▒▒▒▒█
█▒██████▒█▒██
█▒█████▒▒▒▒▒█
█▒▒▒▒▒██▒█▒██
|
|
|
|
|
The COM way first and the migrated to managed code?
|
|
|
|
|
You could have used sockets!
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
Mark Salsbery wrote: You could have used sockets!
█▒▒▒▒▒██▒█▒██
█▒█████▒▒▒▒▒█
█▒██████▒█▒██
█▒█████▒▒▒▒▒█
█▒▒▒▒▒██▒█▒██
|
|
|
|
|
I once worked with a guy who was writing a lot of the DAL code. When it was time to code review some of his stuff, we saw a lot of functions that made a query string, got a DataSet back, extracted the data from the DataSet and returned the extracted data. Basic stuff. However, there were no DataSets declared locally in any of those functions. He had declared a private DataSet class member and used that in all of those functions. The reason... it was too inefficient to declare them locally when you could do it once at the top of the class!
Forehead slaps broke out around the room.
|
|
|
|
|
Sounds like he didn't need a DataSet at all; just a DataTable or a Collection of some Type populated with a DataReader.
I very rarely use a DataSet. It seems to me that the power of the DataSet is its ability to contain relationships between the DataTables it contains; so if I don't need those relationships, I don't need a DataSet. If you only need one DataTable, why construct a whole DataSet?
|
|
|
|
|
It wasn't that he was or wasn't using a DataSet... he was using the same DataSet member variable for all of the queries run in the class. It's like declaring a class member variable i for all of the for loops that you're going to do in your class.
|
|
|
|
|
Yes, I understand that, but if he was concerned about the footprint and/or construction time of a DataSet, why create any at all?
|
|
|
|
|
PIEBALDconsult wrote: Sounds like he didn't need a DataSet at all
led mike
|
|
|
|
|
Was he in a way reinventing the wheel?
|
|
|
|