Click here to Skip to main content
15,911,531 members
Home / Discussions / C#
   

C#

 
AnswerRe: new StreamWriter() vs File.CreateText Pin
Guffa6-Feb-07 8:06
Guffa6-Feb-07 8:06 
QuestionSending bytes over the serial port Pin
Member 36526176-Feb-07 7:23
Member 36526176-Feb-07 7:23 
AnswerRe: Sending bytes over the serial port Pin
Luc Pattyn6-Feb-07 7:31
sitebuilderLuc Pattyn6-Feb-07 7:31 
QuestionThe appropriate application of... Pin
Marc Clifton6-Feb-07 6:45
mvaMarc Clifton6-Feb-07 6:45 
GeneralRe: The appropriate application of... Pin
Martin#6-Feb-07 6:51
Martin#6-Feb-07 6:51 
AnswerRe: The appropriate application of... Pin
Not Active6-Feb-07 7:09
mentorNot Active6-Feb-07 7:09 
AnswerRe: The appropriate application of... Pin
Dan Neely6-Feb-07 7:21
Dan Neely6-Feb-07 7:21 
AnswerRe: The appropriate application of... Pin
Luc Pattyn6-Feb-07 7:24
sitebuilderLuc Pattyn6-Feb-07 7:24 
Hi Marc,

For value types:
- I typically do not use is nor as.
- I use casting to document widening, or to steer narrowing the (int) size, or to switch
between signed and unsigned.
- and of course I try not to need casting at all (by selecting the right type to begin with).

For reference types:
- I avoid GetType(), it is too expensive and somewhat clumsy
- I avoid using casting, with two typical exceptions: when getting an "object" either
by cloning something with Clone(), or when retrieving from a non-generic collection.
(I still try to write code that also could run on 1.1)
- If a ref type must be turned into a more specialized one I tend to use "as" and a null test
(unless "is" is all I need); a null test often already is present anyhow.

BTW: I like your FooishObjects !

Regards,








Luc Pattyn

AnswerRe: The appropriate application of... Pin
Guffa6-Feb-07 7:56
Guffa6-Feb-07 7:56 
AnswerRe: The appropriate application of... Pin
DavidNohejl6-Feb-07 8:47
DavidNohejl6-Feb-07 8:47 
AnswerRe: The appropriate application of... Pin
Daniel Turini6-Feb-07 8:57
Daniel Turini6-Feb-07 8:57 
GeneralRe: The appropriate application of... Pin
Marc Clifton6-Feb-07 14:39
mvaMarc Clifton6-Feb-07 14:39 
QuestionYet another MSIL question (ldsfld, ldarg_0 problem) Pin
rcollina6-Feb-07 6:36
rcollina6-Feb-07 6:36 
AnswerRe: Yet another MSIL question (ldsfld, ldarg_0 problem) Pin
Luc Pattyn6-Feb-07 7:40
sitebuilderLuc Pattyn6-Feb-07 7:40 
GeneralRe: Yet another MSIL question (ldsfld, ldarg_0 problem) Pin
rcollina7-Feb-07 1:15
rcollina7-Feb-07 1:15 
GeneralRe: Yet another MSIL question (ldsfld, ldarg_0 problem) Pin
Luc Pattyn7-Feb-07 6:04
sitebuilderLuc Pattyn7-Feb-07 6:04 
Questionhow to notify the application about database updates? Pin
sundar1566-Feb-07 6:03
sundar1566-Feb-07 6:03 
AnswerRe: how to notify the application about database updates? Pin
Not Active6-Feb-07 7:04
mentorNot Active6-Feb-07 7:04 
GeneralRe: how to notify the application about database updates? Pin
sundar1567-Feb-07 6:41
sundar1567-Feb-07 6:41 
GeneralRe: how to notify the application about database updates? Pin
Not Active7-Feb-07 6:53
mentorNot Active7-Feb-07 6:53 
QuestionHow do i check a control type? Pin
sharpiesharpie6-Feb-07 5:22
sharpiesharpie6-Feb-07 5:22 
AnswerRe: How do i check a control type? Pin
m@u6-Feb-07 5:27
m@u6-Feb-07 5:27 
AnswerRe: How do i check a control type? Pin
Seishin#6-Feb-07 5:42
Seishin#6-Feb-07 5:42 
GeneralRe: How do i check a control type? Pin
sharpiesharpie6-Feb-07 5:56
sharpiesharpie6-Feb-07 5:56 
GeneralRe: How do i check a control type? Pin
Martin#6-Feb-07 6:13
Martin#6-Feb-07 6:13 

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.