Click here to Skip to main content
15,892,737 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: all these C#8 language feature additions and yet Pin
harold aptroot24-Nov-19 12:03
harold aptroot24-Nov-19 12:03 
GeneralRe: all these C#8 language feature additions and yet Pin
honey the codewitch24-Nov-19 12:05
mvahoney the codewitch24-Nov-19 12:05 
GeneralRe: all these C#8 language feature additions and yet Pin
Super Lloyd24-Nov-19 12:51
Super Lloyd24-Nov-19 12:51 
GeneralRe: all these C#8 language feature additions and yet Pin
honey the codewitch24-Nov-19 12:53
mvahoney the codewitch24-Nov-19 12:53 
GeneralRe: all these C#8 language feature additions and yet Pin
Super Lloyd24-Nov-19 13:12
Super Lloyd24-Nov-19 13:12 
GeneralRe: all these C#8 language feature additions and yet Pin
honey the codewitch24-Nov-19 13:17
mvahoney the codewitch24-Nov-19 13:17 
GeneralRe: all these C#8 language feature additions and yet Pin
Shuqian Ying24-Nov-19 13:43
Shuqian Ying24-Nov-19 13:43 
GeneralRe: all these C#8 language feature additions and yet Pin
honey the codewitch24-Nov-19 13:47
mvahoney the codewitch24-Nov-19 13:47 
No, because the whole point of TAccept is it can be a value type like int, or a reference type like string.

It has to be a basic type so it can be serialized to code via System.CodeDom.CodePrimitiveExpression or via an InstanceDescriptor in the worst case. I don't want to have to force the user to declare a type for TAccept. It should be able to accept intrinsic types at face value.

Worse, one of the main points of generics is accessing value types without boxing/unboxing. If I access a value type by interface, I take the boxing hit anyway, and there's almost no reason to use a generic at all versus using System.Object at that point. Boxing in a lexing routine needs to be avoided because it's a tight, performance critical operation. It's one of the few areas where bit twiddling to get some extra speed is worth it.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.

GeneralRe: all these C#8 language feature additions and yet Pin
Shuqian Ying24-Nov-19 14:19
Shuqian Ying24-Nov-19 14:19 
GeneralRe: all these C#8 language feature additions and yet Pin
honey the codewitch24-Nov-19 14:19
mvahoney the codewitch24-Nov-19 14:19 
GeneralRe: all these C#8 language feature additions and yet Pin
Sander Rossel24-Nov-19 22:24
professionalSander Rossel24-Nov-19 22:24 
GeneralRe: all these C#8 language feature additions and yet Pin
honey the codewitch24-Nov-19 22:31
mvahoney the codewitch24-Nov-19 22:31 
GeneralRe: all these C#8 language feature additions and yet Pin
Richard Deeming26-Nov-19 9:44
mveRichard Deeming26-Nov-19 9:44 
GeneralRe: all these C#8 language feature additions and yet Pin
Sander Rossel26-Nov-19 10:18
professionalSander Rossel26-Nov-19 10:18 
GeneralRe: all these C#8 language feature additions and yet Pin
honey the codewitch26-Nov-19 10:20
mvahoney the codewitch26-Nov-19 10:20 
GeneralRe: all these C#8 language feature additions and yet Pin
honey the codewitch26-Nov-19 10:19
mvahoney the codewitch26-Nov-19 10:19 
GeneralRe: all these C#8 language feature additions and yet Pin
#realJSOP25-Nov-19 0:57
mve#realJSOP25-Nov-19 0:57 
GeneralRe: all these C#8 language feature additions and yet Pin
honey the codewitch25-Nov-19 1:00
mvahoney the codewitch25-Nov-19 1:00 
GeneralRe: all these C#8 language feature additions and yet Pin
#realJSOP25-Nov-19 1:07
mve#realJSOP25-Nov-19 1:07 
GeneralRe: all these C#8 language feature additions and yet Pin
honey the codewitch25-Nov-19 1:10
mvahoney the codewitch25-Nov-19 1:10 
GeneralRe: all these C#8 language feature additions and yet Pin
Marc Clifton25-Nov-19 2:43
mvaMarc Clifton25-Nov-19 2:43 
GeneralRe: all these C#8 language feature additions and yet Pin
Richard Deeming26-Nov-19 9:49
mveRichard Deeming26-Nov-19 9:49 
GeneralRe: all these C#8 language feature additions and yet Pin
honey the codewitch26-Nov-19 9:50
mvahoney the codewitch26-Nov-19 9:50 
GeneralRandom numbers PinPopular
Jörgen Andersson24-Nov-19 11:41
professionalJörgen Andersson24-Nov-19 11:41 
GeneralRe: Random numbers Pin
honey the codewitch24-Nov-19 12:01
mvahoney the codewitch24-Nov-19 12:01 

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.