Click here to Skip to main content
15,886,258 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: Thought of the Day Pin
Daniel Pfeffer3-Apr-21 9:51
professionalDaniel Pfeffer3-Apr-21 9:51 
Generalare these developments making things easier for the developer? Pin
Richard MacCutchan2-Apr-21 3:17
mveRichard MacCutchan2-Apr-21 3:17 
GeneralRe: are these developments making things easier for the developer? Pin
honey the codewitch2-Apr-21 3:43
mvahoney the codewitch2-Apr-21 3:43 
GeneralRe: are these developments making things easier for the developer? Pin
Greg Utas2-Apr-21 3:52
professionalGreg Utas2-Apr-21 3:52 
GeneralRe: are these developments making things easier for the developer? PinPopular
Chris Maunder2-Apr-21 4:36
cofounderChris Maunder2-Apr-21 4:36 
GeneralRe: are these developments making things easier for the developer? Pin
Gerry Schmitz2-Apr-21 6:27
mveGerry Schmitz2-Apr-21 6:27 
GeneralRe: are these developments making things easier for the developer? Pin
Maximilien2-Apr-21 6:45
Maximilien2-Apr-21 6:45 
GeneralRe: are these developments making things easier for the developer? Pin
Sander Rossel3-Apr-21 1:43
professionalSander Rossel3-Apr-21 1:43 
One of the "improvements" I find really complicated is the range operator.
C#
string name;
name = "My name is Sander Rossel".Substring(11);
name = "My name is Sander Rossel"[11..];
Now tell me, which line of code better conveys my purpose? Unsure | :~

Pattern matching is nice, but should be rarely needed in proper OOP.
C#
Exception ex = new Exception();
switch (ex)
{
    case InvalidCastException:
        break;
    case InvalidOperationException:
        break;
    case NullReferenceException:
        break;
    default:
        break;
}

// The alternative is, of course, an if-else statement.
var exType = ex.GetType();
if (exType == typeof(InvalidCastException))
{ }
else if (exType == typeof(InvalidOperationException))
{ }
else
{ }
There's probably an advantage to the pattern matching, but it doesn't do much for readability.

I love named tuples though.
C#
public (string firstName, string lastName) GetNameParts(string name) { }
// Usage...
(var firstName, var lastName) = GetNameParts("Sander Rossel");
// Or...
var tuple = GetNameParts("Sander Rossel");
Console.WriteLine(tuple.firstName);
And of course string interpolation, which greatly improves readability and decreases change of bugs.
C#
Console.WriteLine($"Hi {firstName} {lastName}, welcome to {appName}!");
// vs.
Console.WriteLine(string.Format("Hi {0} {1}, welcome to {2}!", firstName, lastName, appName);
If I could keep only one language improvement from about the last ten years it would be string interpolation!

GeneralRe: are these developments making things easier for the developer? Pin
Bob Beechey4-Apr-21 20:51
Bob Beechey4-Apr-21 20:51 
GeneralRe: are these developments making things easier for the developer? Pin
kholsinger5-Apr-21 5:30
kholsinger5-Apr-21 5:30 
GeneralRe: are these developments making things easier for the developer? Pin
Chris Maunder5-Apr-21 6:45
cofounderChris Maunder5-Apr-21 6:45 
GeneralRe: are these developments making things easier for the developer? Pin
Sander Rossel5-Apr-21 21:47
professionalSander Rossel5-Apr-21 21:47 
GeneralRe: are these developments making things easier for the developer? Pin
Peter Shaw5-Apr-21 6:38
professionalPeter Shaw5-Apr-21 6:38 
GeneralRe: are these developments making things easier for the developer? Pin
PIEBALDconsult2-Apr-21 5:02
mvePIEBALDconsult2-Apr-21 5:02 
GeneralRe: are these developments making things easier for the developer? Pin
W Balboos, GHB2-Apr-21 5:16
W Balboos, GHB2-Apr-21 5:16 
GeneralRe: are these developments making things easier for the developer? Pin
fd97502-Apr-21 6:28
professionalfd97502-Apr-21 6:28 
GeneralRe: are these developments making things easier for the developer? Pin
sasadler5-Apr-21 7:03
sasadler5-Apr-21 7:03 
GeneralRe: are these developments making things easier for the developer? Pin
David O'Neil2-Apr-21 6:23
professionalDavid O'Neil2-Apr-21 6:23 
GeneralRe: are these developments making things easier for the developer? Pin
Rick York2-Apr-21 7:42
mveRick York2-Apr-21 7:42 
GeneralRe: are these developments making things easier for the developer? PinPopular
Nelek2-Apr-21 12:44
protectorNelek2-Apr-21 12:44 
GeneralMost of the recent developments in C# obfuscate things PinPopular
Michael Breeden5-Apr-21 1:13
Michael Breeden5-Apr-21 1:13 
GeneralRe: are these developments making things easier for the developer? Pin
SeattleC++5-Apr-21 5:16
SeattleC++5-Apr-21 5:16 
GeneralRe: are these developments making things easier for the developer? Pin
Richard MacCutchan5-Apr-21 5:18
mveRichard MacCutchan5-Apr-21 5:18 
GeneralRe: are these developments making things easier for the developer? Pin
JP Reyes5-Apr-21 5:22
JP Reyes5-Apr-21 5:22 
GeneralRe: are these developments making things easier for the developer? Pin
Martin ISDN6-Apr-21 4:35
Martin ISDN6-Apr-21 4:35 

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.