Click here to Skip to main content
14,392,608 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 1:12
professionalsuper4-Dec-19 1:12 
GeneralRe: WSO CCC OTD 2019-12-04 Pin
OriginalGriff4-Dec-19 1:19
mveOriginalGriff4-Dec-19 1:19 
GeneralRe: WSO CCC OTD 2019-12-04 Pin
0x01AA4-Dec-19 1:23
professional0x01AA4-Dec-19 1:23 
GeneralRe: WSO CCC OTD 2019-12-04 Pin
OriginalGriff4-Dec-19 1:27
mveOriginalGriff4-Dec-19 1:27 
GeneralRe: WSO CCC OTD 2019-12-04 Pin
musefan4-Dec-19 2:24
Membermusefan4-Dec-19 2:24 
GeneralRe: WSO CCC OTD 2019-12-04 - we have a winner! Pin
OriginalGriff4-Dec-19 2:32
mveOriginalGriff4-Dec-19 2:32 
GeneralRe: WSO CCC OTD 2019-12-04 - we have a winner! Pin
musefan4-Dec-19 2:45
Membermusefan4-Dec-19 2:45 
QuestionNeed an opinion: on semantic code meaning changes Pin
honey the codewitch3-Dec-19 22:31
Memberhoney the codewitch3-Dec-19 22: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:

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 23:05
mvephil.o3-Dec-19 23:05 
GeneralRe: Need an opinion: on semantic code meaning changes Pin
honey the codewitch3-Dec-19 23:32
Memberhoney the codewitch3-Dec-19 23:32 
GeneralRe: Need an opinion: on semantic code meaning changes Pin
phil.o4-Dec-19 0:04
mvephil.o4-Dec-19 0:04 
GeneralRe: Need an opinion: on semantic code meaning changes Pin
honey the codewitch4-Dec-19 0:17
Memberhoney the codewitch4-Dec-19 0:17 
GeneralRe: Need an opinion: on semantic code meaning changes Pin
phil.o4-Dec-19 0:20
mvephil.o4-Dec-19 0:20 
GeneralRe: Need an opinion: on semantic code meaning changes Pin
honey the codewitch4-Dec-19 0:21
Memberhoney the codewitch4-Dec-19 0:21 
AnswerRe: Need an opinion: on semantic code meaning changes Pin
CPallini3-Dec-19 23:32
mveCPallini3-Dec-19 23:32 
GeneralRe: Need an opinion: on semantic code meaning changes Pin
honey the codewitch3-Dec-19 23:33
Memberhoney the codewitch3-Dec-19 23:33 
AnswerRe: Need an opinion: on semantic code meaning changes Pin
Sander Rossel4-Dec-19 0:05
professionalSander Rossel4-Dec-19 0:05 
GeneralRe: Need an opinion: on semantic code meaning changes Pin
honey the codewitch4-Dec-19 0:13
Memberhoney the codewitch4-Dec-19 0:13 
GeneralRe: Need an opinion: on semantic code meaning changes Pin
Sander Rossel4-Dec-19 0:18
professionalSander Rossel4-Dec-19 0:18 
GeneralRe: Need an opinion: on semantic code meaning changes Pin
honey the codewitch4-Dec-19 0:20
Memberhoney the codewitch4-Dec-19 0:20 
NewsD.C. Fontana, RIP Pin
Kent Sharkey3-Dec-19 9:51
staffKent Sharkey3-Dec-19 9:51 
GeneralRe: D.C. Fontana, RIP Pin
  Forogar  3-Dec-19 11:05
professional  Forogar  3-Dec-19 11:05 
GeneralRe: D.C. Fontana, RIP Pin
glennPattonWork5-Dec-19 4:12
professionalglennPattonWork5-Dec-19 4:12 
GeneralVS2017 Source Control Woes - Figured It Out!! Pin
Kevin Marois3-Dec-19 9:43
professionalKevin Marois3-Dec-19 9:43 
PraiseRe: VS2017 Source Control Woes - Figured It Out!! Pin
RickZeeland3-Dec-19 9:52
communityengineerRickZeeland3-Dec-19 9: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.