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

 
JokeRe: jsfiddle nightmare: Schrodinger's lost code Pin
Peter_in_27807-Sep-23 13:15
professionalPeter_in_27807-Sep-23 13:15 
GeneralRe: jsfiddle nightmare: Schrodinger's lost code Pin
Richard Deeming7-Sep-23 21:32
mveRichard Deeming7-Sep-23 21:32 
GeneralRe: jsfiddle nightmare: Schrodinger's lost code Pin
Jeremy Falcon25-Sep-23 8:04
professionalJeremy Falcon25-Sep-23 8:04 
GeneralMicrosoft IIS FTP docs Pin
raddevus7-Jul-23 8:56
mvaraddevus7-Jul-23 8:56 
GeneralRe: Microsoft IIS FTP docs Pin
honey the codewitch26-Jul-23 9:32
mvahoney the codewitch26-Jul-23 9:32 
GeneralOne of the worst routines I've ever written. Shame on me? Pin
honey the codewitch21-Jun-23 3:16
mvahoney the codewitch21-Jun-23 3:16 
GeneralRe: One of the worst routines I've ever written. Shame on me? Pin
charlieg27-Jun-23 15:30
charlieg27-Jun-23 15:30 
GeneralRe: One of the worst routines I've ever written. Shame on me? Pin
honey the codewitch27-Jun-23 15:32
mvahoney the codewitch27-Jun-23 15:32 
By running it through all the supported color models which would require crafting pixels of each different type implicit color models like RGB, Y'CbCr, C'MYk, HSV, grayscale/monochrome etc, and converting them back and forth to other models.

The issue is that it's sometimes a lossy conversion so any test would have to account for that.

I do not have unit tests for this function, but I've used it enough that I am confident in it.

I did run several iterations of its use through godbolt.org to make sure it was producing the ASM i was expecting.

Edit: To my mind the comments aren't all that lacking, at least in context. That functions structure is very simple, and most of the variable names are descriptive if abbreviated.

I can look at it, with the comments that are there and tell

A) exactly what it's doing
and
B) where to add things to get it to do more

Any more than that, and it would create a comment maintenance issue, wherein i'm expressing intent twice, once through comments, and once through code, and creating double the maintenance, and the potential for comments to get out of sync.

The issue is that my metadata functions and helpers aren't documented as much as they need to be
Check out my IoT graphics library here:
https://honeythecodewitch/gfx

QuestionRe: One of the worst routines I've ever written. Shame on me? Pin
Eddy Vluggen2-Sep-23 11:05
professionalEddy Vluggen2-Sep-23 11:05 
AnswerRe: One of the worst routines I've ever written. Shame on me? Pin
honey the codewitch2-Sep-23 11:20
mvahoney the codewitch2-Sep-23 11:20 
GeneralRe: One of the worst routines I've ever written. Shame on me? Pin
Daniel Pfeffer2-Sep-23 18:59
professionalDaniel Pfeffer2-Sep-23 18:59 
GeneralRe: One of the worst routines I've ever written. Shame on me? Pin
honey the codewitch2-Sep-23 19:26
mvahoney the codewitch2-Sep-23 19:26 
GeneralRe: One of the worst routines I've ever written. Shame on me? Pin
Eddy Vluggen5-Sep-23 4:52
professionalEddy Vluggen5-Sep-23 4:52 
GeneralRe: One of the worst routines I've ever written. Shame on me? Pin
Graeme_Grant26-Jul-23 13:35
mvaGraeme_Grant26-Jul-23 13:35 
GeneralRe: One of the worst routines I've ever written. Shame on me? Pin
honey the codewitch26-Jul-23 14:55
mvahoney the codewitch26-Jul-23 14:55 
GeneralRe: One of the worst routines I've ever written. Shame on me? Pin
Graeme_Grant26-Jul-23 14:58
mvaGraeme_Grant26-Jul-23 14:58 
GeneralE-mail validation stupidity Pin
PIEBALDconsult8-Jun-23 10:47
mvePIEBALDconsult8-Jun-23 10:47 
GeneralRe: E-mail validation stupidity Pin
Nelek8-Jun-23 11:30
protectorNelek8-Jun-23 11:30 
GeneralRe: E-mail validation stupidity Pin
PIEBALDconsult8-Jun-23 11:32
mvePIEBALDconsult8-Jun-23 11:32 
GeneralRe: E-mail validation stupidity Pin
Craig Robbins9-Jun-23 0:59
Craig Robbins9-Jun-23 0:59 
GeneralRe: E-mail validation stupidity Pin
Sander Rossel10-Jun-23 2:27
professionalSander Rossel10-Jun-23 2:27 
GeneralRe: E-mail validation stupidity Pin
trønderen10-Jun-23 2:58
trønderen10-Jun-23 2:58 
GeneralRe: E-mail validation stupidity Pin
Richard MacCutchan10-Jun-23 3:36
mveRichard MacCutchan10-Jun-23 3:36 
GeneralRe: E-mail validation stupidity Pin
Sander Rossel10-Jun-23 5:13
professionalSander Rossel10-Jun-23 5:13 
GeneralRe: E-mail validation stupidity Pin
Richard MacCutchan10-Jun-23 5:28
mveRichard MacCutchan10-Jun-23 5:28 

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.