Click here to Skip to main content
15,916,692 members
Home / Discussions / C#
   

C#

 
Questionforeach statement Pin
twistz24-Jun-08 16:12
twistz24-Jun-08 16:12 
AnswerRe: foreach statement Pin
Christian Graus24-Jun-08 16:16
protectorChristian Graus24-Jun-08 16:16 
GeneralRe: foreach statement Pin
twistz24-Jun-08 21:03
twistz24-Jun-08 21:03 
GeneralRe: foreach statement Pin
Christian Graus24-Jun-08 21:09
protectorChristian Graus24-Jun-08 21:09 
AnswerRe: foreach statement Pin
Mohammad Dayyan24-Jun-08 16:19
Mohammad Dayyan24-Jun-08 16:19 
GeneralRe: foreach statement Pin
PIEBALDconsult24-Jun-08 16:33
mvePIEBALDconsult24-Jun-08 16:33 
GeneralRe: foreach statement Pin
Ashfield24-Jun-08 21:19
Ashfield24-Jun-08 21:19 
GeneralRe: foreach statement Pin
Guffa24-Jun-08 21:59
Guffa24-Jun-08 21:59 
Ashfield wrote:
Whatever happened to the 'use strongly typed variable' rule? May as well define eveything as an object


The variable is actually stronly typed, as the compiler can determine what type it has to be.

However, the code is not well written, as it's not obvious what the type of the variable will be. You can't read directly what the type is, you have to know what type the enumerator of the Rows collection returns. As there is two layers of indirection to follow, the code gets less readable. Also, the code gets more prone to accidental changes, as the declaration depends on other declarations.

If the intention was that the variable should get whatever type the enumerator returns it would be ok, but when the motivation is only laziness, it's not a coding style that can be recommended.

Despite everything, the person most likely to be fooling you next is yourself.

QuestionHow to transfer a custom struct pointer to DLL's function? Pin
samfromcn24-Jun-08 15:24
samfromcn24-Jun-08 15:24 
AnswerRe: How to transfer a custom struct pointer to DLL's function? Pin
mav.northwind24-Jun-08 19:14
mav.northwind24-Jun-08 19:14 
GeneralRe: How to transfer a custom struct pointer to DLL's function? Pin
samfromcn24-Jun-08 20:19
samfromcn24-Jun-08 20:19 
QuestionAttributes and there constructors... Pin
Paw Jershauge24-Jun-08 12:04
Paw Jershauge24-Jun-08 12:04 
AnswerRe: Attributes and there constructors... Pin
Spacix One24-Jun-08 12:14
Spacix One24-Jun-08 12:14 
GeneralRe: Attributes and there constructors... Pin
Paw Jershauge24-Jun-08 12:21
Paw Jershauge24-Jun-08 12:21 
GeneralRe: Attributes and there constructors... Pin
Spacix One24-Jun-08 12:33
Spacix One24-Jun-08 12:33 
GeneralRe: Attributes and there constructors... Pin
Paw Jershauge25-Jun-08 11:38
Paw Jershauge25-Jun-08 11:38 
QuestionHow to read wav file from a xml file in C# Pin
Member 470467524-Jun-08 11:09
Member 470467524-Jun-08 11:09 
AnswerRe: How to read wav file from a xml file in C# Pin
Spacix One24-Jun-08 11:27
Spacix One24-Jun-08 11:27 
AnswerRe: How to read wav file from a xml file in C# Pin
Gurpreet11124-Jun-08 12:10
Gurpreet11124-Jun-08 12:10 
QuestionWebBrowser.Print Pin
TiredProgrammer24-Jun-08 10:20
TiredProgrammer24-Jun-08 10:20 
AnswerRe: WebBrowser.Print Pin
Spacix One24-Jun-08 11:26
Spacix One24-Jun-08 11:26 
QuestionAcceptSocket and ObjectDisposedException Pin
Anthony Mushrow24-Jun-08 9:27
professionalAnthony Mushrow24-Jun-08 9:27 
AnswerRe: AcceptSocket and ObjectDisposedException Pin
led mike24-Jun-08 9:38
led mike24-Jun-08 9:38 
GeneralRe: AcceptSocket and ObjectDisposedException Pin
Anthony Mushrow24-Jun-08 10:01
professionalAnthony Mushrow24-Jun-08 10:01 
GeneralRe: AcceptSocket and ObjectDisposedException Pin
led mike24-Jun-08 10:39
led mike24-Jun-08 10:39 

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.