See inline:
ozbear said:
"With" is an abomination and should be cast into the pits of hell.
It creates maintenance nightmares and no professional would ever
use it in any language that supports it.
I've never in 7 years experienced one second of lost time due to
"deciphering" a with statement code block. Yes, I'm a professional, and I
do use it. I've never seen a VB programmer struggle or increase maintenance
issues due to the presence of a "With" block.
The only people I've ever witnessed struggle with it are C# and more so,
Java programmers who just can't seem to grasp it. Of course, they would
struggle with it. Of course, if it was a feature of the language they would
better understand it. If they were maintaining a VB app, there will be
increased maintenance because they are maintaining code in a language they
don't speak well.
I seem to find more C# programmers complain about how it decreases
readibility and increases maintainibility but I don't see too many VB
programmers (who use the feature) say the same thing. Sure it can be
abused, as can any number of features in C#. That doesn't make C# evil.
There are places in C# where I would greatly welcome it. I create custom
web controls, and in the Render methods, I have scores of lines of code that
repeat the same "HtmlTextWriter..." that could easily save typing by using a
with. I actually did start the project over in VB for reasons of having to
type too much in C# and, even though I'm very profficient in C#, I get the
job done quicker in VB because I have to type less, my hands hurt less from
all the massive typing, and so on. Actually, I think it's the better
intellisense features of VB but I degress. I did not make that choice
because of the lack of a "with" but the point being, I'm going to type less
when I have more to do. Arguing with me that I'm "lazy" and less
"professional" as a result wouldn't hold well if we were programming
together in the real world.
But we all have our opinions. In the opinion of many C# programmers, "with"
is to be abhorred. In the opinion of VB programmers, "with" is a welcome
feature. "With" also exists in JScript, by the way, but its syntax could be
improved.
Flame me for that if you wish. But I do use the language that's going to
help me get where I want to go the quickest. For other projects, I've used
C# because it makes more sense to do so. I enjoy both languages and get
paid to do so.
Thanks,
Shawn