To use the BCL type names or not?


"urn:schemas-microsoft-com:office:smarttags" /> prefix = st1 ns = "urn:schemas:contacts" /> style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Jeffrey style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Richter style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> and I have an on going argument
that I thought you’d like to chime in on. 
/>


style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">In samples, books, etc should we use
the style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">BCL style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> type names (Int32, String, Single,
etc) or programming language specific type names such as in C# (int, string,
float, etc) or VB (Integer, String, Single, etc)? style="mso-spacerun: yes"> 


style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Jeff style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> believes that the sample code would
be clearer if it consistently used the style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">BCL style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> names. style="mso-spacerun: yes">  I believe that if the sample should
leverage the keywords of the language it is written in. style="mso-spacerun: yes">  The C# and VB language designers decided
to have a “pretty” name for these types as part of the language and I believe we
should respect that.  style="mso-spacerun: yes">  


style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> 


style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">As an example what do you like
better:


style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> 


style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Jeff style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">’s way:


style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">for (Int32 i = 42; i < 100; i++)
{ }


style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> 


style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">my way:


style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">for (int i = 42; i < 100; i++) {
}


style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> 


style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> 


style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> style="mso-spacerun: yes"> 


 

Comments (3)

  1. Ron Green says:

    I’m not so sure it matters which method you use as long as it’s used consistently. I think the assumed convention is language specific. If you are going to use BCL then that needs to pointed out up front.