Click here to Skip to main content
15,892,927 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: WSO CCC OTD 2019-12-04 Pin
super4-Dec-19 0:12
professionalsuper4-Dec-19 0:12 
GeneralRe: WSO CCC OTD 2019-12-04 Pin
OriginalGriff4-Dec-19 0:19
mveOriginalGriff4-Dec-19 0:19 
GeneralRe: WSO CCC OTD 2019-12-04 Pin
User 110609794-Dec-19 0:23
User 110609794-Dec-19 0:23 
GeneralRe: WSO CCC OTD 2019-12-04 Pin
OriginalGriff4-Dec-19 0:27
mveOriginalGriff4-Dec-19 0:27 
GeneralRe: WSO CCC OTD 2019-12-04 Pin
musefan4-Dec-19 1:24
musefan4-Dec-19 1:24 
GeneralRe: WSO CCC OTD 2019-12-04 - we have a winner! Pin
OriginalGriff4-Dec-19 1:32
mveOriginalGriff4-Dec-19 1:32 
GeneralRe: WSO CCC OTD 2019-12-04 - we have a winner! Pin
musefan4-Dec-19 1:45
musefan4-Dec-19 1:45 
QuestionNeed an opinion: on semantic code meaning changes Pin
honey the codewitch3-Dec-19 21:31
mvahoney the codewitch3-Dec-19 21:31 
So right now my little mini C# subset does not support a lot of really convenient operators

like most of the op+assignment operators (+=,-=,/=,*=) nor does it support either post or pre increment or decrement operators (++a, a++, --b, b++)

The reason it doesn't is because the CodeDOM it renders to does not.

The primarily annoying this is it forces you to declare your for loops like this:

C#
for(int i = 0;i<10;i=i+1)


that takes some getting used to.

Now here's the thing, I can simulate these operators with other equivalents. Like, every time I see a ++a, i can turn it into a=a+1

But the problem is, it's not exactly the same thing. What if someone has overloaded ++?

All of the sudden your code will not run the target ++ code and why could be very confusing unless you're willing to pour over God only knows how many lines of generated source code it created.

So that's why I don't do it.

Eventually, I may, if I decide to make this generated code forcibly call the static operator overload methods (like op_Increment()) exposed from the target type, but right now that's a long out to do. But doing so would keep the semantics. even then i can probably never support i++, only ++i, but that's a longer story.

My question is this - am I being too much of a stickler here? Should I just go ahead and remap these operators and say to hell with the minor semantic change it introduces? Or should I remain conservative in this respect?
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.

AnswerRe: Need an opinion: on semantic code meaning changes Pin
phil.o3-Dec-19 22:05
professionalphil.o3-Dec-19 22:05 
GeneralRe: Need an opinion: on semantic code meaning changes Pin
honey the codewitch3-Dec-19 22:32
mvahoney the codewitch3-Dec-19 22:32 
GeneralRe: Need an opinion: on semantic code meaning changes Pin
phil.o3-Dec-19 23:04
professionalphil.o3-Dec-19 23:04 
GeneralRe: Need an opinion: on semantic code meaning changes Pin
honey the codewitch3-Dec-19 23:17
mvahoney the codewitch3-Dec-19 23:17 
GeneralRe: Need an opinion: on semantic code meaning changes Pin
phil.o3-Dec-19 23:20
professionalphil.o3-Dec-19 23:20 
GeneralRe: Need an opinion: on semantic code meaning changes Pin
honey the codewitch3-Dec-19 23:21
mvahoney the codewitch3-Dec-19 23:21 
AnswerRe: Need an opinion: on semantic code meaning changes Pin
CPallini3-Dec-19 22:32
mveCPallini3-Dec-19 22:32 
GeneralRe: Need an opinion: on semantic code meaning changes Pin
honey the codewitch3-Dec-19 22:33
mvahoney the codewitch3-Dec-19 22:33 
AnswerRe: Need an opinion: on semantic code meaning changes Pin
Sander Rossel3-Dec-19 23:05
professionalSander Rossel3-Dec-19 23:05 
GeneralRe: Need an opinion: on semantic code meaning changes Pin
honey the codewitch3-Dec-19 23:13
mvahoney the codewitch3-Dec-19 23:13 
GeneralRe: Need an opinion: on semantic code meaning changes Pin
Sander Rossel3-Dec-19 23:18
professionalSander Rossel3-Dec-19 23:18 
GeneralRe: Need an opinion: on semantic code meaning changes Pin
honey the codewitch3-Dec-19 23:20
mvahoney the codewitch3-Dec-19 23:20 
NewsD.C. Fontana, RIP Pin
Kent Sharkey3-Dec-19 8:51
staffKent Sharkey3-Dec-19 8:51 
GeneralRe: D.C. Fontana, RIP Pin
  Forogar  3-Dec-19 10:05
professional  Forogar  3-Dec-19 10:05 
GeneralRe: D.C. Fontana, RIP Pin
glennPattonWork35-Dec-19 3:12
professionalglennPattonWork35-Dec-19 3:12 
GeneralVS2017 Source Control Woes - Figured It Out!! Pin
Kevin Marois3-Dec-19 8:43
professionalKevin Marois3-Dec-19 8:43 
PraiseRe: VS2017 Source Control Woes - Figured It Out!! Pin
RickZeeland3-Dec-19 8:52
mveRickZeeland3-Dec-19 8:52 

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.