Click here to Skip to main content
15,346,357 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: When did syntax become so fussy? PinPopular
Mircea Neacsu9-Jun-21 10:48
mvaMircea Neacsu9-Jun-21 10:48 
GeneralRe: When did syntax become so fussy? Pin
jathalls11-Jun-21 2:01
Memberjathalls11-Jun-21 2:01 
GeneralRe: When did syntax become so fussy? Pin
raddevus11-Jun-21 9:53
mvaraddevus11-Jun-21 9:53 
GeneralRe: When did syntax become so fussy? Pin
James Lonero12-Jun-21 17:44
MemberJames Lonero12-Jun-21 17:44 
GeneralRe: When did syntax become so fussy? Pin
jathalls12-Jun-21 22:28
Memberjathalls12-Jun-21 22:28 
GeneralRe: When did syntax become so fussy? Pin
Jon McKee9-Jun-21 11:06
professionalJon McKee9-Jun-21 11:06 
GeneralRe: When did syntax become so fussy? Pin
Wizard of Sleeves10-Jun-21 20:29
MemberWizard of Sleeves10-Jun-21 20:29 
GeneralRe: When did syntax become so fussy? Pin
Jon McKee10-Jun-21 23:33
professionalJon McKee10-Jun-21 23:33 
Readable line counts are what matters. Most software, including the Windows 10 source, could technically be represented on a single line (get wrecked Python nerds Cool | :cool: ).

Also, and I might be a pedant, but I'd say this
TypeScript
int y = x switch { "test" => 0, "test1" => 1, "test2" => 2, _ => 3 };
is way more readable than this
TypeScript
int z = -1; switch (x) { case "test": z = 0; break; case "test1": z = 1; break; case "test2": z = 2; break; default: z = 3; break; };
since it has fewer columns, reads much like an array initializer syntax which is common in modern languages, and due to the restrictions on the expression syntax the case body is a relatively constant size (a compound scope isn't allowed like with the statement syntax).

modified 11-Jun-21 6:04am.

GeneralRe: When did syntax become so fussy? Pin
Wizard of Sleeves11-Jun-21 1:45
MemberWizard of Sleeves11-Jun-21 1:45 
GeneralRe: When did syntax become so fussy? Pin
Cp-Coder9-Jun-21 12:29
MemberCp-Coder9-Jun-21 12:29 
GeneralRe: When did syntax become so fussy? Pin
Nelek9-Jun-21 19:52
protectorNelek9-Jun-21 19:52 
GeneralRe: When did syntax become so fussy? Pin
Mike Hankey9-Jun-21 13:05
professionalMike Hankey9-Jun-21 13:05 
GeneralRe: When did syntax become so fussy? Pin
James Lonero12-Jun-21 17:46
MemberJames Lonero12-Jun-21 17:46 
GeneralRe: When did syntax become so fussy? Pin
PIEBALDconsult9-Jun-21 14:05
professionalPIEBALDconsult9-Jun-21 14:05 
JokeRe: When did syntax become so fussy? Pin
enhzflep9-Jun-21 23:47
Memberenhzflep9-Jun-21 23:47 
GeneralRe: When did syntax become so fussy? Pin
Maximilien10-Jun-21 2:53
MemberMaximilien10-Jun-21 2:53 
GeneralRe: When did syntax become so fussy? Pin
Marc Clifton10-Jun-21 3:47
mvaMarc Clifton10-Jun-21 3:47 
GeneralRe: When did syntax become so fussy? Pin
obermd10-Jun-21 4:53
Memberobermd10-Jun-21 4:53 
GeneralRe: When did syntax become so fussy? Pin
Gerry Schmitz10-Jun-21 5:26
mveGerry Schmitz10-Jun-21 5:26 
GeneralRe: When did syntax become so fussy? Pin
Gary R. Wheeler10-Jun-21 9:28
MemberGary R. Wheeler10-Jun-21 9:28 
GeneralRe: When did syntax become so fussy? Pin
Jon McKee10-Jun-21 23:54
professionalJon McKee10-Jun-21 23:54 
GeneralRe: When did syntax become so fussy? Pin
Gary Wheeler11-Jun-21 3:55
MemberGary Wheeler11-Jun-21 3:55 
GeneralRe: When did syntax become so fussy? Pin
pmauriks10-Jun-21 19:56
Memberpmauriks10-Jun-21 19:56 
GeneralRe: When did syntax become so fussy? Pin
Member 916705710-Jun-21 20:21
MemberMember 916705710-Jun-21 20:21 
GeneralRe: When did syntax become so fussy? Pin
The Real Paps10-Jun-21 20:48
professionalThe Real Paps10-Jun-21 20:48 

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.


Straw Poll

You discover a sentient AI in your org's system. What do you do?
Well you never know what sort of orphaned projects previous employees have left behind...
  Results   587 votes