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

 
GeneralBecause Reasons Pin
loctrice19-Jul-16 4:40
professionalloctrice19-Jul-16 4:40 
GeneralRe: Because Reasons PinPopular
Wonde Tadesse19-Jul-16 4:47
professionalWonde Tadesse19-Jul-16 4:47 
GeneralRe: Because Reasons Pin
Richard Deeming19-Jul-16 4:48
mveRichard Deeming19-Jul-16 4:48 
GeneralRe: Because Reasons PinPopular
Duncan Edwards Jones19-Jul-16 5:31
professionalDuncan Edwards Jones19-Jul-16 5:31 
GeneralRe: Because Reasons Pin
Super Lloyd30-Jul-16 4:12
Super Lloyd30-Jul-16 4:12 
GeneralRe: Because Reasons Pin
loctrice19-Jul-16 5:53
professionalloctrice19-Jul-16 5:53 
GeneralRe: Because Reasons Pin
Sander Rossel19-Jul-16 6:27
professionalSander Rossel19-Jul-16 6:27 
GeneralRe: Because Reasons Pin
loctrice19-Jul-16 8:50
professionalloctrice19-Jul-16 8:50 
I think I short circuited my own post by "I'll leave out the goodness and just get to the point". It's possible that this is the marker pattern, although it's not - it's more likely it wasn't intentionally any pattern, just something thrown in to get it working. It's hard to tell though, in the multi-thousand line code files that I'm digging through.

Also, the marker pattern seems to imply[^]

I would argue first-off that Serializable and Cloneable are bad examples of marker interfaces. Sure, they're interfaces with methods, but they imply methods, such as writeObject(ObjectOutputStream). (The compiler will create a writeObject(ObjectOutputStream) method for you if you don't override it, and all objects already have clone(), but the compiler will again create a real clone() method for you but with caveats. Both of these are weird edge cases that really aren't good design examples.)


something like meta-data[^] or methods in many cases.

1) Looking carefully on marker interface in Java e.g. Serializable, Clonnable and Remote it looks they are used to indicate something to compiler or JVM. So if JVM sees a Class is Serializable it done some special operation on it, similar way if JVM sees one Class is implement Clonnable it performs some operation to support cloning. Same is true for RMI and Remote interface. So in short Marker interface indicate, signal or a command to Compiler or JVM.

Read more: http://javarevisited.blogspot.com/2012/01/what-is-marker-interfaces-in-java-and.html#ixzz4Esj4dLCe


I don't feel like what was done here is a good use for that, especially in the junk it's tied up in. If it was intentional, it was done to avoid a good refactor in a steaming pile.
Elephant elephant elephant, sunshine sunshine sunshine

GeneralRe: Because Reasons Pin
Brisingr Aerowing31-Jul-16 14:39
professionalBrisingr Aerowing31-Jul-16 14:39 
GeneralRe: Because Reasons Pin
Sander Rossel31-Jul-16 21:14
professionalSander Rossel31-Jul-16 21:14 
GeneralRe: Because Reasons Pin
Brisingr Aerowing1-Aug-16 5:40
professionalBrisingr Aerowing1-Aug-16 5:40 
GeneralRe: Because Reasons Pin
Sander Rossel1-Aug-16 21:43
professionalSander Rossel1-Aug-16 21:43 
GeneralRe: Because Reasons Pin
Brisingr Aerowing4-Sep-16 18:16
professionalBrisingr Aerowing4-Sep-16 18:16 
GeneralRe: Because Reasons Pin
johannesnestler26-Jul-16 1:34
johannesnestler26-Jul-16 1:34 
GeneralRe: Because Reasons Pin
Ravichanadeepakarandescarar29-Jul-16 16:03
Ravichanadeepakarandescarar29-Jul-16 16:03 
GeneralRe: Because Reasons Pin
loctrice29-Jul-16 16:19
professionalloctrice29-Jul-16 16:19 
GeneralRe: Because Reasons Pin
Ravichanadeepakarandescarar29-Jul-16 16:39
Ravichanadeepakarandescarar29-Jul-16 16:39 
GeneralRe: Because Reasons Pin
loctrice29-Jul-16 17:50
professionalloctrice29-Jul-16 17:50 
GeneralRe: Because Reasons Pin
Vander Wunderbar31-Jul-16 11:37
Vander Wunderbar31-Jul-16 11:37 
GeneralRecursion schmecursion! Pin
PIEBALDconsult14-Jul-16 16:53
mvePIEBALDconsult14-Jul-16 16:53 
GeneralRe: Recursion schmecursion! Pin
Super Lloyd14-Jul-16 17:15
Super Lloyd14-Jul-16 17:15 
GeneralRe: Recursion schmecursion! Pin
Brisingr Aerowing14-Jul-16 17:28
professionalBrisingr Aerowing14-Jul-16 17:28 
GeneralRe: Recursion schmecursion! Pin
PIEBALDconsult14-Jul-16 18:50
mvePIEBALDconsult14-Jul-16 18:50 
GeneralRe: Recursion schmecursion! Pin
Brisingr Aerowing15-Jul-16 13:18
professionalBrisingr Aerowing15-Jul-16 13:18 
GeneralRe: Recursion schmecursion! Pin
PIEBALDconsult15-Jul-16 13:25
mvePIEBALDconsult15-Jul-16 13:25 

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.