Click here to Skip to main content
15,887,683 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: Nasty bug only found in production Pin
TheGreatAndPowerfulOz12-Jan-19 6:47
TheGreatAndPowerfulOz12-Jan-19 6:47 
GeneralRe: Nasty bug only found in production Pin
raddevus12-Jan-19 12:42
mvaraddevus12-Jan-19 12:42 
GeneralReadable code, taken too far (too Swift)? Pin
raddevus19-Nov-18 10:32
mvaraddevus19-Nov-18 10:32 
GeneralRe: Readable code, taken too far (too Swift)? PinPopular
Chris Maunder19-Nov-18 15:07
cofounderChris Maunder19-Nov-18 15:07 
GeneralRe: Readable code, taken too far (too Swift)? Pin
raddevus19-Nov-18 15:22
mvaraddevus19-Nov-18 15:22 
GeneralRe: Readable code, taken too far (too Swift)? Pin
Chris Maunder19-Nov-18 16:08
cofounderChris Maunder19-Nov-18 16:08 
GeneralRe: Readable code, taken too far (too Swift)? Pin
obermd23-Nov-18 3:32
obermd23-Nov-18 3:32 
GeneralRe: Readable code, taken too far (too Swift)? Pin
Marc Clifton20-Nov-18 0:40
mvaMarc Clifton20-Nov-18 0:40 
Gross. So it is foisted onto the development team to making the decision as to which pattern to consistently use: _ so the syntax is changeName(d, "Rover") or to use named external parameters so the syntax is changeName(of:d, to:"Rover"). That is, if it's even a conscious decision.

But of course, the next team / outsource group / other library may use the opposite pattern, so your Swift code will be a smattering of the two, and it seems like the only way to tell which one you need to use is by inspecting the function declaration? Because I seriously doubt whatever editor you use has sophisticated intellisense to help you, or am I wrong in this?

So, what is the benefit of named external parameters? Merely the fact that you can also, if you're Hungarian or like RPN, write changeName(to:"Rover", of:d) ??? Is there any concept of optional parameters that have default values if not set?

And even worse, can you mix the two, so you could write changeName(d, to:"Rover") ?
Latest Article - A Concise Overview of Threads

Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny

Artificial intelligence is the only remedy for natural stupidity. - CDP1802

GeneralRe: Readable code, taken too far (too Swift)? Pin
raddevus20-Nov-18 1:56
mvaraddevus20-Nov-18 1:56 
GeneralRe: Readable code, taken too far (too Swift)? Pin
jsc4220-Nov-18 21:50
professionaljsc4220-Nov-18 21:50 
GeneralRe: Readable code, taken too far (too Swift)? Pin
Dan Neely23-Nov-18 5:12
Dan Neely23-Nov-18 5:12 
GeneralRe: Readable code, taken too far (too Swift)? Pin
ajhampson23-Nov-18 8:09
ajhampson23-Nov-18 8:09 
GeneralRe: Readable code, taken too far (too Swift)? Pin
raddevus24-Nov-18 11:43
mvaraddevus24-Nov-18 11:43 
GeneralRe: Readable code, taken too far (too Swift)? Pin
Gerry Schmitz23-Nov-18 12:05
mveGerry Schmitz23-Nov-18 12:05 
GeneralRe: Readable code, taken too far (too Swift)? Pin
raddevus24-Nov-18 11:41
mvaraddevus24-Nov-18 11:41 
GeneralRe: Readable code, taken too far (too Swift)? Pin
Jon McKee24-Nov-18 20:56
professionalJon McKee24-Nov-18 20:56 
GeneralRe: Readable code, taken too far (too Swift)? Pin
raddevus25-Nov-18 5:31
mvaraddevus25-Nov-18 5:31 
GeneralRe: Readable code, taken too far (too Swift)? Pin
Lutosław25-Nov-18 11:20
Lutosław25-Nov-18 11:20 
GeneralRe: Readable code, taken too far (too Swift)? Pin
André Pereira25-Nov-18 23:31
André Pereira25-Nov-18 23:31 
GeneralRe: Readable code, taken too far (too Swift)? Pin
Lutosław26-Nov-18 1:00
Lutosław26-Nov-18 1:00 
GeneralRe: Readable code, taken too far (too Swift)? Pin
André Pereira26-Nov-18 3:58
André Pereira26-Nov-18 3:58 
GeneralRe: Readable code, taken too far (too Swift)? Pin
Lutosław25-Dec-18 1:55
Lutosław25-Dec-18 1:55 
GeneralRe: Readable code, taken too far (too Swift)? Pin
Rob Grainger7-Jan-19 2:21
Rob Grainger7-Jan-19 2:21 
GeneralRe: Readable code, taken too far (too Swift)? Pin
Rob Grainger3-Dec-18 5:54
Rob Grainger3-Dec-18 5:54 
GeneralRe: Readable code, taken too far (too Swift)? Pin
raddevus3-Dec-18 7:46
mvaraddevus3-Dec-18 7:46 

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.