Click here to Skip to main content
15,887,676 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
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 
GeneralRe: Readable code, taken too far (too Swift)? Pin
raddevus20-Nov-18 1:56
mvaraddevus20-Nov-18 1:56 
Yes, you'd have to decide at the outset if you were really going to follow that type of pattern and it could get very mixed up.
Also, XCode does seem to help with a Intellisense type of functionality.

Marc Clifton wrote:
And even worse, can you mix the two,

And, yes, you can definitely mix the two. The creator of the original function can use the _ to indicate the external name is not required and can use it on 0 or more params.

I can see that the language creators were trying to allow developers to convey more meaning but not sure external names really help.

It feels like what has recently been done with fluent interfaces[^]

C#
mock.expects(once()).method("m").with( or(stringContains("hello"),                                    stringContains("howdy")) );


The attempt to make it read like natural language. I think it works well with unit testing frameworks, but not sure about all code.
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 
GeneralRe: Readable code, taken too far (too Swift)? Pin
Ryan Peden7-Jan-19 1:37
professionalRyan Peden7-Jan-19 1:37 

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.