Click here to Skip to main content
15,999,410 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: Looking at the very topmost line ... Pin
jochance6-Jun-24 6:31
jochance6-Jun-24 6:31 
GeneralRe: Looking at the very topmost line ... Pin
Richard Andrew x6416-Jun-24 8:12
professionalRichard Andrew x6416-Jun-24 8:12 
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 
honey the codewitch wrote:
I don't know what you're talking about in terms of writing email addresses and domain names.
What goes first, to the left: The smallest unit, i.e. the individual recipient, or the larger unit comprising a huge number of them, the mail server name?
Which goes first: The smaller subdomain 'codeproject' or the TLD 'com'?

Are you really sure that the internet is consistently big endian? IP addresses certainly are, but is that all that there is? (Then let's keep dancing ...)

Curious memory: The very first map I saw of the internet, the nodes were labeled with a number, mostly 3-digit. Several of the nodes had the same number. I had to have these labels explained to me: It was IBM 360 mainframe model provided at that site as the main computing resource. IBM mainframes always were big endian. That might explain why IP addresses were selected to be big endian.

If you go for consistent little endian format: Do you consider the last character in a name to be the most significant? If memory contains the bytes, at increasing addresses, 'J', 'O', 'H', 'N', would you then consider 'J' the least significant one, e.g. if you were to sort a list of names? Would you rather choose to store 'JOHN' as 'N', 'H', 'O', 'J'?

Would you then require all names (or other strings) to be of a fixed length, with the characters to be compared for sorting at the same offset from the start of the string? Or would you construct a descriptor for each string, each with an index (offset) starting at the last character, decrementing it as the sorting progressed to less significant characters?

Or would you store numeric values as little endian, but strings as big endian?

Bottom line: It isn't as simple as 'Choose one and always use that'. You can't define yourself away from endianness problems, even if you have omnipotent power. Unless, of course, if your power is so omnipotent that you can define two plus two to make something else than four.
Religious freedom is the freedom to say that two plus two make five.

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ønderen2-Jun-24 4:32
trønderen2-Jun-24 4:32 
GeneralRe: Blessed endian mismatches collide with progress Pin
honey the codewitch2-Jun-24 4:34
mvahoney the codewitch2-Jun-24 4:34 
GeneralRe: Blessed endian mismatches collide with progress Pin
11917640 Member 2-Jun-24 1:40
11917640 Member 2-Jun-24 1:40 
GeneralRe: Blessed endian mismatches collide with progress Pin
kalberts2-Jun-24 4:34
kalberts2-Jun-24 4:34 
GeneralRe: Blessed endian mismatches collide with progress Pin
11917640 Member 2-Jun-24 18:10
11917640 Member 2-Jun-24 18:10 
GeneralRe: Blessed endian mismatches collide with progress Pin
jochance6-Jun-24 6:33
jochance6-Jun-24 6:33 
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 
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.