We have all written ugly code so far, that's a fact. Some are just bad, some are worse. And some other ones are just disgusting. Naturally, I'm no ...
For further actions, you may consider blocking this person and/or reporting abuse
I once wrote a boolToInt
Not proud. It was my first year
That is ugly indeed. What were you even doing there?
Here, I corrected your code
Ah, I see the problem -- you should have used a ternary operator!
It should use an IntegerFactory.
Slaps forehead. Of course! Better make it Abstract, just to be sure.
10/10, I'd include it in every file of a project for the enjoyment of those reading my code.
I once wrote something in JavaScript
Oh man, I can't imagine what you must've been through
shh!
I think this snippet of ReasonML is pretty horrible, from my very first larger functional programming project:
It takes a list of classrooms, each containing a letter and a list of kids, and returns a subset of them, using rules from separate list of classrooms and parameters for transforming the data. It's a bit of a complicated operation by nature, but it could have been broken down or broken out into sub-steps. Writing one massive convoluted
fold
is not the way to go.This technically works, but I'm seriously glad I never had to make any sort of change to it, and I can only tell you what it does now because I remember the problem, not because looking at this code means anything to me.
Ha! I totally have it thanks to instant messaging keeping logs of images I share,
behold!
Basically its the logic that handles how you go through a grid (keyboard keys) and handles the cases where you go left right top bottom and there is no key...
thepracticaldev.s3.amazonaws.com/i...
I had to work in this code, but didn't create it.
Page rendering made of only PHP echo statements in a Zend framework controller (not view!). There was html, CSS, js, jquery and PHP conditions in this spaghetti mess. The code was around 800 lines long and was a very important part of the website. That site also had 3 very different versions of jquery running on different pages.
That was one of the first things I worked on during my internship after graduating. I almost cried the first time I saw it.
I think we could have given more checks to this simple bash script which was used to backup the website automatically using Cron job.
Iām just impressed that you didnāt use jQuery.
Well, I wrote this code when we had only been learning web development for like 1 month.
Jquery or any kind of framework wasn't even mentioned for the next 2 months(yeah it was a slow course, and we had learned Java more back then). We only learned basics like HTML, CSS, JS(the very very basics)
And I started using that little knowledge I had to make a website
Even with so little knowledge about JS, I was far ahead of anyone in the course
Itās functional code, even if now you know itās not practical or efficient.
Logically, it works, itās just not very DRY.
print ("Hello World")
I just write legacy code from scratch...
I wish I could say the same for all of my code, but it would never be true š
Woah, thats cool man....
I had commited some horrific crimes in VBA before actually learning how to code