The Struggles of Web Development

December 15, 2022

So, since coming back to my code and making big changes to it after months of not really working on it (due to studies), it has come to my attention how disorganized it is :P

Well, given that I was still pretty new to web development, it's actually not that bad. But since I've taken coding classes at college, I've come to notice how weird everything is structured in my site's code :")

They really weren't lying when they said that naming things in coding was one of the most difficult things to do in computer science. There was a quote I kept seeing a lot, while researching about naming conventions and all that.

There are only two hard problems in Computer Science: cache invalidation and naming things

Phil Karlton

I don't know what cache invalidation is, but given that it's on the same level as naming things, I don't think I want to know about it just yet.

Anyway, one thing I noticed is that my CSS class names are pretty vague. If you don't know what that is, it's the '.red-border' in the code below.

                
.red-border {
    border: 2px solid red;
}
                
                

The name doesn't really tell me where it's being used in the HTML file, and it can be a pain to look for all instances of them. By modifying one class, you're also unknowingly modifying a lot of HTML elements (which can be really hard to debug).

Also, there are times when the names don't tell me what the class does. Like, without looking at the CSS file (so looking at the HTML file instead), I wouldn't know if 'red-border' adds a single red border to an element, or if it creates a box with a background and a red border.

I think I'm going to try the BEM naming convention and CSS namespaces. It feels kinda weird using something so professional (and complicated) for my personal site, but I think it would really help, given how big it's gotten and how disorganized it is ^^; Also, might fix my file hierarchy again (there are so many nested files aaa) and replace the underscores in my file names to dashes ^^

I'm honestly not sure if I'll be able to finish this and add that new feature I've been wanting to add for so long before the holidays end. But yep, there's a lot of stuff I wanna do before I am once again swamped with college work :"]

Honestly, learning computer science in college has been really fun! Even though I suck at the math classes (I failed in precalculus so I'll still need to catch up ;-;). It's been making me want to do some more coding projects, honestly. But alas... there is too little time T_T

So for now, I'll be fixing up my site and reading some fun articles. Maybe even playing some video games and enjoying the holiday season >:]

If any of you need help with coding, or just wanna chat, don't hesitate to email me! :D

Good bye and happy holidays!! ^^

Back to top? // Outside the iframe?