4 ms·
tsk! :) >> For I as Int32 = 1 to 10 I may be a VB.NET stalwart, but I have evolved to ensure my code is clean and properly declared, and I wish that all my VB
by Jaruzel 10y ago
tsk! :)
>> For I as Int32 = 1 to 10
I may be a VB.NET stalwart, but I have evolved to ensure my code is clean and properly declared, and I wish that all my VB.NET colleagues had done the same, then maybe it still wouldn't be seen as C# ugly step-sibling.
Why don't I switch to C# ?
1) I don't code professionally these days, only as a hobby.
2) I can't see the point of having to put semi-colons at the end of lines, when you immediately follow them with CRLF anyway.
3) Curly brackets are too easy to miss in the middle of code for these old eyes.
Right now, there's almost no app that's written in C# that can't also be written in VB.NET.
- cm2187 10y agoI agree with your points except for For i as Int32 = 1 to 10 There is nothing loose or unambiguous about type inference Dim i = 10 is absolutely unambiguous, strongly typed and elegant. The For i = 1 to 10 is just doing the same in a loop.
- Jaruzel 10y agoI think I had gotten stung previously with VB6s loose typing (everything as a generic object unless declared otherwise), so when I switched to VB.NET I made a point of declaring everything (and still do).
- cm2187 10y agoyeah it took me a while to get rid of bad VB6 habits too. Hungarian notation, specifying byval in front of every arguments in a function, not relying on type inference, etc.