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

 
GeneralUntested Backups with IonicZip Pin
kmoorevs8hrs 26mins ago
kmoorevs8hrs 26mins ago 
GeneralLooking at the very topmost line ... Pin
trønderen1-Jun-24 11:21
trønderen1-Jun-24 11:21 
GeneralRe: Looking at the very topmost line ... Pin
Greg Utas21hrs 14mins ago
professionalGreg Utas21hrs 14mins ago 
GeneralRe: Looking at the very topmost line ... Pin
Daniel Pfeffer17hrs 59mins ago
professionalDaniel Pfeffer17hrs 59mins ago 
GeneralBlessed endian mismatches collide with progress Pin
honey the codewitch1-Jun-24 7:30
mvahoney the codewitch1-Jun-24 7:30 
GeneralRe: Blessed endian mismatches collide with progress Pin
Ron Anders1-Jun-24 8:26
Ron Anders1-Jun-24 8:26 
JokeRe: Blessed endian mismatches collide with progress Pin
PIEBALDconsult1-Jun-24 9:22
mvePIEBALDconsult1-Jun-24 9:22 
GeneralRe: Blessed endian mismatches collide with progress Pin
trønderen1-Jun-24 11:13
trønderen1-Jun-24 11:13 
GeneralRe: Blessed endian mismatches collide with progress Pin
honey the codewitch1-Jun-24 11:33
mvahoney the codewitch1-Jun-24 11:33 
GeneralRe: Blessed endian mismatches collide with progress Pin
trønderen1-Jun-24 12:39
trønderen1-Jun-24 12:39 
GeneralRe: Blessed endian mismatches collide with progress Pin
honey the codewitch1-Jun-24 12:47
mvahoney the codewitch1-Jun-24 12:47 
GeneralRe: Blessed endian mismatches collide with progress Pin
trønderen9hrs 24mins ago
trønderen9hrs 24mins ago 
GeneralRe: Blessed endian mismatches collide with progress Pin
honey the codewitch9hrs 22mins ago
mvahoney the codewitch9hrs 22mins ago 
GeneralRe: Blessed endian mismatches collide with progress Pin
11917640 Member 12hrs 16mins ago
11917640 Member 12hrs 16mins ago 
GeneralRe: Blessed endian mismatches collide with progress Pin
kalberts9hrs 22mins ago
kalberts9hrs 22mins ago 
Generalimplementing interface method, same signature, from two interfaces Pin
raddevus25-Apr-24 9:55
mvaraddevus25-Apr-24 9:55 
GeneralRe: implementing interface method, same signature, from two interfaces Pin
Jon McKee25-Apr-24 12:27
professionalJon McKee25-Apr-24 12:27 
raddevus wrote:
Oh, and after I posted that, I went back and new'd up a SaveImplementor() and then I couldn't figure out how to call either of those explicit methods.

Hmm... It's got me thinking now.

C#
((IPersist)saveImplementor).Save() // IPersist.Save()
((IStorage)saveImplementor).Save() // IStorage.Save()
If I'm remembering correctly, saveImplementor.Save() raw won't work in the second EII example, you'd have to ALSO have a public int Save() {}. I believe this is because EII implementations are ad-hoc polymorphic, the implementation differs depending on the type-view/cast of the object - as opposed to the standard implicit ones which are parametric polymorphic, so its the same implementation for every type-view/cast of the object.

Honestly it's been a long time since I've seen EII used because of this weird behavior. It makes it so you can have an object that seems to completely change it's class/behavior with a simple cast, AND all that new behavior is completely hidden from all other casts of the SAME object.
GeneralRe: implementing interface method, same signature, from two interfaces Pin
Richard Deeming30-Apr-24 0:30
mveRichard Deeming30-Apr-24 0:30 
GeneralRe: implementing interface method, same signature, from two interfaces Pin
honey the codewitch2-May-24 13:49
mvahoney the codewitch2-May-24 13:49 
RantGiven enough eyeballs - a Sunday rant... Pin
Mircea Neacsu21-Apr-24 7:32
Mircea Neacsu21-Apr-24 7:32 
GeneralRe: Given enough eyeballs - a Sunday rant... Pin
Greg Utas21-Apr-24 8:10
professionalGreg Utas21-Apr-24 8:10 
GeneralRe: Given enough eyeballs - a Sunday rant... Pin
Mircea Neacsu21-Apr-24 8:18
Mircea Neacsu21-Apr-24 8:18 
GeneralRe: Given enough eyeballs - a Sunday rant... Pin
Greg Utas21-Apr-24 10:11
professionalGreg Utas21-Apr-24 10:11 
GeneralRe: Given enough eyeballs - a Sunday rant... Pin
charlieg21-May-24 23:52
charlieg21-May-24 23:52 
GeneralRe: Given enough eyeballs - a Sunday rant... Pin
trønderen22-May-24 2:45
trønderen22-May-24 2:45 

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.