Click here to Skip to main content
15,904,288 members

Survey Results

Should C# get the VB-style "with" keyword?   [Edit]

Survey period: 6 Oct 2008 to 13 Oct 2008

If not then maybe we could look into the "Ain't" keyword...

OptionVotes% 
Yes27937.20
No47162.80



 
GeneralRe: No vote for me.... Pin
NotUnique7-Oct-08 14:00
professionalNotUnique7-Oct-08 14:00 
GeneralIf you need the with keyword Pin
Ennis Ray Lynch, Jr.6-Oct-08 13:08
Ennis Ray Lynch, Jr.6-Oct-08 13:08 
GeneralRe: If you need the with keyword Pin
Shog96-Oct-08 14:21
sitebuilderShog96-Oct-08 14:21 
GeneralRe: If you need the with keyword Pin
Jeremy Falcon7-Oct-08 8:50
professionalJeremy Falcon7-Oct-08 8:50 
GeneralRe: If you need the with keyword Pin
Ennis Ray Lynch, Jr.7-Oct-08 9:09
Ennis Ray Lynch, Jr.7-Oct-08 9:09 
GeneralRe: If you need the with keyword Pin
Jeremy Falcon7-Oct-08 10:04
professionalJeremy Falcon7-Oct-08 10:04 
GeneralRe: If you need the with keyword Pin
Ennis Ray Lynch, Jr.7-Oct-08 10:07
Ennis Ray Lynch, Jr.7-Oct-08 10:07 
GeneralRe: If you need the with keyword Pin
Jeremy Falcon7-Oct-08 10:18
professionalJeremy Falcon7-Oct-08 10:18 
Ennis Ray Lynch, Jr. wrote:
If you are accessing members in a class you do not need with as you are already withing the namespace.


Not if the class is a friend. Of course, I assume C# has that concept. Smile | :)

Ennis Ray Lynch, Jr. wrote:
If you are accessing members outside of a class you have to ask yourself the question ... Can these operations be contained within this class rather than requiring my code to have intimate knowledge of the class, 9 times out of ten the answer is yes. In which case using the with keyword is more typing as it would only be one line of code to instruct the class to do it's operation.


Even with using 90% (which I doubt unless you only use crap code) that means one out of ten times you don't need to refactor it, and it might save you some typing.

Ennis Ray Lynch, Jr. wrote:
Bottom line: In any case where someone is using a with there is a manner in which to write the code without the with that is better engineered.


Except in your 10% example.

I'm all for refactoring, but you cannot claim public or friend members will never be used otherwise it's a bad design. The fact is, they are there, and if some people can't design well it doesn't mean we shouldn't save typing when we need to access one.

It's also a quick and handy way to avoid a name space clash if you need something down and dirty real quick.

Jeremy Falcon
Oatmeal Engine[^]

GeneralRe: If you need the with keyword Pin
Ennis Ray Lynch, Jr.7-Oct-08 10:27
Ennis Ray Lynch, Jr.7-Oct-08 10:27 
GeneralRe: If you need the with keyword Pin
Vark1117-Oct-08 10:59
Vark1117-Oct-08 10:59 
GeneralRe: If you need the with keyword Pin
Jeremy Falcon8-Oct-08 6:14
professionalJeremy Falcon8-Oct-08 6:14 
GeneralRe: If you need the with keyword Pin
Ennis Ray Lynch, Jr.8-Oct-08 6:21
Ennis Ray Lynch, Jr.8-Oct-08 6:21 
GeneralRe: If you need the with keyword Pin
Jeremy Falcon8-Oct-08 6:33
professionalJeremy Falcon8-Oct-08 6:33 
GeneralRe: If you need the with keyword Pin
Ennis Ray Lynch, Jr.8-Oct-08 6:40
Ennis Ray Lynch, Jr.8-Oct-08 6:40 
GeneralRe: If you need the with keyword Pin
Jeremy Falcon8-Oct-08 6:48
professionalJeremy Falcon8-Oct-08 6:48 
GeneralI don't constantly check either, I just get email alerts and am easily distracted Pin
Ennis Ray Lynch, Jr.8-Oct-08 7:17
Ennis Ray Lynch, Jr.8-Oct-08 7:17 
GeneralRe: I don't constantly check either, I just get email alerts and am easily distracted Pin
Jeremy Falcon9-Oct-08 10:44
professionalJeremy Falcon9-Oct-08 10:44 
GeneralRe: If you need the with keyword Pin
Scott Barbour8-Oct-08 8:48
Scott Barbour8-Oct-08 8:48 
GeneralRe: If you need the with keyword Pin
Ennis Ray Lynch, Jr.8-Oct-08 9:00
Ennis Ray Lynch, Jr.8-Oct-08 9:00 
GeneralRe: If you need the with keyword [modified] Pin
Scott Barbour8-Oct-08 10:22
Scott Barbour8-Oct-08 10:22 
GeneralRe: If you need the with keyword Pin
Ennis Ray Lynch, Jr.8-Oct-08 10:46
Ennis Ray Lynch, Jr.8-Oct-08 10:46 
GeneralRe: If you need the with keyword Pin
dmitri_sps7-Oct-08 21:55
dmitri_sps7-Oct-08 21:55 
GeneralRe: If you need the with keyword [modified] Pin
sucram7-Oct-08 23:08
sucram7-Oct-08 23:08 
GeneralRe: If you need the with keyword Pin
Paul Watson8-Oct-08 1:53
sitebuilderPaul Watson8-Oct-08 1:53 
GeneralRe: If you need the with keyword [modified] Pin
sucram8-Oct-08 2:53
sucram8-Oct-08 2:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.