Show HN: Spaghettify – A VSCode Extension to make your code worse with AI (spaghettify.dev)
Recently, I saw Github Next Code Brushes (https://githubnext.com/projects/code-brushes) which is a VSCode extension that can use AI to do things like make your code more readable, add types, etc.
This inspired me: what if there was an extension that could use AI to make your code worse as well?
Meet Spaghettify. An extension I developed that can do things like:
- Obscure your code
- Introduce a bug
- Make the variable names way too descriptive
- Use nonsymmetrical whitespace
- Add irrelevant/rambling comments
- Document the code with emoji
- Document the code in any style (Dirty Limerick, Fast Talkin' 1930s Gangster)
I built this extension over the last couple of days and released it in collaboration with BCAD.one. It's available on the VSCode Marketplace, you will need an OpenAI API Key to use it. You can grab it here:
(https://marketplace.visualstudio.com/items?itemName=BCAD.spa...)
Code here:
69 comments
[ 2.6 ms ] story [ 139 ms ] threadLooks like regular Lisp function names to me ¯\_(ツ)_/¯
>Document the code with emoji
>Document the code in any style (Dirty Limerick, Fast Talkin' 1930s Gangster)
>worse
TIL I've been coding wrong my whole life. But it's the only way I know...
>> Listen up, ya mugs! I'm gonna give ya the lowdown on dis here function, getSourceImage().
>> Dis baby is the real deal. It's gonna give ya the goods on the source image. Ya got it? The source image! No more guessin' or snoopin' around, dis function'll give ya the straight dope.
Edit: nevermind, just found the home page: https://www.spaghettify.dev/
https://github.com/BeforeCutieAfterDoggo/spaghettify/blob/ma...
You can take these and play around with them in the OpenAI playground as well.
And have it do the opposite of "Extract a method" - oh and have a class call a method on another class that calls a method on another class that calls a method on the original class (but for every single thing that needs to happen in the critical path)?
If you can't, I have some developers I'm cleaning up after who can...
Evil ideas for improvements.
Random typos in class name, function names, comments, such as: inheritance -> enheritance class -> clas cannot -> cannont
Pick related words: person -> user, account, customer
Random swapping plural/singular users -> user
Append "Class" to classnames. example: User -> UsersClass
Insert rant comments about, politics, religion, profanity.
I actually saw code that looked like that from a very dyslexic mate of mine who I worked with a long time ago.
Now I found the best tool ever! Thank you.
I'm pretty sure the vast majority of training data is more buggy than not and literally writing the code is only half of what it takes. The other half is comprehension of the problem it solves which is usually missing from documentation at the level of mere snippets.
Are we going to see hires basically trying code generation until it builds?
Quote from an Aprils Fools video for The Witcher 3.
In other words, would the bug work for me or the user?
When I say work for me, what I mean is, considering decompiler tools like https://ghidra-sre.org/ can shine light where once there wasn't, would the bug generates lots of unnecessary work for me, or could I use the bug as a stealth form of copy protection, where those with illegal copies get bitten by the bug and eventually forced into purchasing said code?
I've seen that technique used with a software company supplying addons to other programming companies. Cant say its a technique taught at places like University.