Click here to Skip to main content
16,012,223 members
Home / Discussions / C#
   

C#

 
GeneralRe: Saving BMP/JPEG from Stream Pin
Gimpy19832-Jul-04 6:58
Gimpy19832-Jul-04 6:58 
GeneralRe: Saving BMP/JPEG from Stream Pin
Emiliano2-Jul-04 8:37
Emiliano2-Jul-04 8:37 
GeneralRe: Saving BMP/JPEG from Stream Pin
Gimpy19834-Jul-04 8:28
Gimpy19834-Jul-04 8:28 
GeneralDatagrid column header Pin
Member 5877032-Jul-04 6:33
Member 5877032-Jul-04 6:33 
Generalenum question Pin
Mikke_x2-Jul-04 6:27
Mikke_x2-Jul-04 6:27 
GeneralRe: enum question Pin
Werdna2-Jul-04 12:11
Werdna2-Jul-04 12:11 
GeneralRe: enum question Pin
Mikke_x2-Jul-04 12:49
Mikke_x2-Jul-04 12:49 
GeneralRe: enum question Pin
Colin Angus Mackay2-Jul-04 13:57
Colin Angus Mackay2-Jul-04 13:57 
Mikke_x wrote:
And since the compiler knews it is an int I can´t really see the problem.

Yes, the compiler knows it is an int. And the compiler is forcing you to know it is an int also. If you have many developers on a team and one comes across your enum in use somewhere and they start using it willy-nilly then bad things can happen. So, the compiler forces the developer to declare that they explicitly want the enum value as an int because you are still losing type safety. This way, if yet another developer comes along later and looks at the code they will know exactly what is going on.

The above analogy can also apply if you are a lone developer also - many times I've gone back to code I've written a year or two back and I'm tracing though code line by line for something that at the time was quite natural. If I see an explicit cast I can understand things better and quicker than with an implicit cast. Implicit casts are by their nature hidden, there is nothing on the surface to indicate they go on.


"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar

The Second EuroCPian Event will be in Brussels on the 4th of September

Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!

My Blog


GeneralRe: enum question Pin
Werdna2-Jul-04 14:38
Werdna2-Jul-04 14:38 
GeneralRe: enum question Pin
Colin Angus Mackay2-Jul-04 14:52
Colin Angus Mackay2-Jul-04 14:52 
GeneralRe: enum question Pin
Werdna2-Jul-04 15:06
Werdna2-Jul-04 15:06 
GeneralRe: enum question Pin
Colin Angus Mackay2-Jul-04 15:19
Colin Angus Mackay2-Jul-04 15:19 
GeneralRe: enum question Pin
Mikke_x3-Jul-04 0:33
Mikke_x3-Jul-04 0:33 
GeneralRe: enum question Pin
Colin Angus Mackay3-Jul-04 12:08
Colin Angus Mackay3-Jul-04 12:08 
GeneralDatagrid Question Pin
C#Coder672-Jul-04 5:42
C#Coder672-Jul-04 5:42 
GeneralRe: Datagrid Question Pin
DougW482-Jul-04 6:57
DougW482-Jul-04 6:57 
GeneralMultiple instance of startup form Pin
Anonymous2-Jul-04 4:09
Anonymous2-Jul-04 4:09 
GeneralRe: Multiple instance of startup form Pin
Dave Kreskowiak2-Jul-04 4:57
mveDave Kreskowiak2-Jul-04 4:57 
GeneralRe: Multiple instance of startup form Pin
Anonymous2-Jul-04 5:32
Anonymous2-Jul-04 5:32 
GeneralRe: Multiple instance of startup form Pin
Dave Kreskowiak2-Jul-04 5:50
mveDave Kreskowiak2-Jul-04 5:50 
GeneralRe: Multiple instance of startup form Pin
Andreas X3-Jul-04 22:01
professionalAndreas X3-Jul-04 22:01 
GeneralOne port: multiple transfer Pin
Gimpy19832-Jul-04 4:08
Gimpy19832-Jul-04 4:08 
Generalinstall project paths Pin
mcgahanfl2-Jul-04 4:07
mcgahanfl2-Jul-04 4:07 
GeneralPlease see this Pin
saud_a_k2-Jul-04 1:31
saud_a_k2-Jul-04 1:31 
GeneralRe: Please see this Pin
Colin Angus Mackay2-Jul-04 2:10
Colin Angus Mackay2-Jul-04 2:10 

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.