When I was really new to JavaScript, I wanted to create an image gallery with images which I stored in a MySQL database. Well, I did not really had a clue how to load all the image sources into my JavaScript to load the images. I also didn't know much about fetching an endpoint of my website to get the data asynchronously.

I also wasn't a good database architect at that time and my database had an image table wich was for the gallery. Within this table there were multiple columns for one image slider (there should be multiple sliders on one page in the gallery (I know... 🤢)).

So I ended up writing an PHP loop wich printed Javascript loops for each row in my images table. Within my JavaScript loop I created the sliders and set the images.

In my defense I can say: It worked. 😅

It hurts to remember this. And I hope you won't judge me.

  • 1
    @AlexDeLarge thank you. I would like to actually do more coding since most of my progress is theoretical, because I have very little time to code, bit much time to read (, while I bring my children to bed). When it comes to practically building something, I am pretty lost and have to research a lot.
  • 1
    Everyone started somewhere.

    I won't doubt even the best code engineers has written crap code at some point.
Add Comment