Claude's ugly code
-
This is some code Claude gave me
if (key == "midi" && isDefined(data.midi)) ma.setAutomationDataFromObject(data.midi); else if (key == "macro" && isDefined(data.macro)) mh.setMacroDataFromObject(data.macro);This is how I would write it
if (!isDefined(data) || !isDefined(data[key])) return; if (key == "midi") ma.setAutomationDataFromObject(data[key]); else mh.setMacroDataFromObject(data[key]);Just sayin
-
-
@David-Healey Depends who (or what) is more likely to be reading the code in the future I guess.
-
@dannytaurus the first time I heard the term 'human-readable' gave me the heebee geebeez. lol
Who else is reading?...
lmaoo -
-
@David-Healey said in Claude's ugly code:
This is some code Claude gave me
if (key == "midi" && isDefined(data.midi)) ma.setAutomationDataFromObject(data.midi); else if (key == "macro" && isDefined(data.macro)) mh.setMacroDataFromObject(data.macro);This is how I would write it
if (!isDefined(data) || !isDefined(data[key])) return; if (key == "midi") ma.setAutomationDataFromObject(data[key]); else mh.setMacroDataFromObject(data[key]);Just sayin
Hey Claude, please update your behaviour to script more like @David-Healey . Don't make any mistakes this time.
-
@David-Healey You can ask Claude to analyse your previous project styles once for all so it automatically applies it next time
