Click here to Skip to main content
15,907,395 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.

 
GeneralChristmas Carol of The Day: Pin
OriginalGriff20-Dec-21 4:28
mveOriginalGriff20-Dec-21 4:28 
JokeRe: Christmas Carol of The Day: Pin
Daniel Pfeffer20-Dec-21 4:42
professionalDaniel Pfeffer20-Dec-21 4:42 
GeneralExpression bodies vs Good Old Fashioned Functions Pin
Chris Maunder20-Dec-21 4:00
cofounderChris Maunder20-Dec-21 4:00 
GeneralRe: Expression bodies vs Good Old Fashioned Functions Pin
k505420-Dec-21 4:14
mvek505420-Dec-21 4:14 
GeneralRe: Expression bodies vs Good Old Fashioned Functions Pin
trønderen20-Dec-21 5:23
trønderen20-Dec-21 5:23 
GeneralRe: Expression bodies vs Good Old Fashioned Functions Pin
Mark Whybird21-Dec-21 16:19
Mark Whybird21-Dec-21 16:19 
GeneralRe: Expression bodies vs Good Old Fashioned Functions Pin
Slow Eddie20-Dec-21 4:23
professionalSlow Eddie20-Dec-21 4:23 
GeneralRe: Expression bodies vs Good Old Fashioned Functions Pin
ElectronProgrammer20-Dec-21 6:03
ElectronProgrammer20-Dec-21 6:03 
I do not know C# and never tried to use it but, if they were going to change their parser to accommodate a new syntax, they could have gone the extra mile and do something inline like
C#
public MyObject(string name=>_name, string data=>_data){}

I have been secretly wishing for something similar for constructors in C++. Example
C++
MyObject(std::string name=defaultName:_name, std::string data=defaultData:_data){}

instead of what we have now
C++
MyObject(std::string name=defaultName, std::string data=defaultData):_name(name),_data(data){}

There would be less typing.
Or go a little further and allow for static functions to be called to evaluate values. Example
C++
MyObject(std::string name=evalName():_name, std::string data=evalData():_data){}
where "evalName()" and "evalData()" would be automatically passed the given parameter value. The signature would be
C++
std::string evalName(std::string name)

GeneralRe: Expression bodies vs Good Old Fashioned Functions Pin
trønderen20-Dec-21 6:25
trønderen20-Dec-21 6:25 
GeneralRe: Expression bodies vs Good Old Fashioned Functions Pin
David O'Neil20-Dec-21 6:48
professionalDavid O'Neil20-Dec-21 6:48 
GeneralRe: Expression bodies vs Good Old Fashioned Functions Pin
Rich Shealer21-Dec-21 2:46
Rich Shealer21-Dec-21 2:46 
GeneralRe: Expression bodies vs Good Old Fashioned Functions Pin
David O'Neil21-Dec-21 12:40
professionalDavid O'Neil21-Dec-21 12:40 
GeneralRe: Expression bodies vs Good Old Fashioned Functions Pin
James Lonero23-Dec-21 7:15
James Lonero23-Dec-21 7:15 
GeneralRe: Expression bodies vs Good Old Fashioned Functions Pin
Marc Clifton20-Dec-21 8:46
mvaMarc Clifton20-Dec-21 8:46 
GeneralRe: Expression bodies vs Good Old Fashioned Functions Pin
Slacker00720-Dec-21 8:54
professionalSlacker00720-Dec-21 8:54 
GeneralRe: Expression bodies vs Good Old Fashioned Functions Pin
trønderen20-Dec-21 12:22
trønderen20-Dec-21 12:22 
GeneralRe: Expression bodies vs Good Old Fashioned Functions Pin
Peter Adam20-Dec-21 20:30
professionalPeter Adam20-Dec-21 20:30 
GeneralRe: Expression bodies vs Good Old Fashioned Functions Pin
James Lonero23-Dec-21 7:39
James Lonero23-Dec-21 7:39 
GeneralRe: Expression bodies vs Good Old Fashioned Functions Pin
James Lonero23-Dec-21 7:12
James Lonero23-Dec-21 7:12 
GeneralRe: Expression bodies vs Good Old Fashioned Functions Pin
Gary R. Wheeler20-Dec-21 7:14
Gary R. Wheeler20-Dec-21 7:14 
GeneralRe: Expression bodies vs Good Old Fashioned Functions Pin
Slacker00720-Dec-21 8:59
professionalSlacker00720-Dec-21 8:59 
GeneralRe: Expression bodies vs Good Old Fashioned Functions Pin
Leo5620-Dec-21 23:57
Leo5620-Dec-21 23:57 
GeneralRe: Expression bodies vs Good Old Fashioned Functions Pin
dan!sh 20-Dec-21 22:11
professional dan!sh 20-Dec-21 22:11 
GeneralRe: Expression bodies vs Good Old Fashioned Functions Pin
MadGerbil21-Dec-21 1:47
MadGerbil21-Dec-21 1:47 
GeneralRe: Expression bodies vs Good Old Fashioned Functions Pin
rjmoses21-Dec-21 10:51
professionalrjmoses21-Dec-21 10:51 

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.