Why Is CSS The Hardest Language To Learn?

Reframing the way we look at CSS


10/30/20233 min read

why is css the hardest language to learn
why is css the hardest language to learn

Every programmer has that one coding language they struggle with – no matter how many times they think they've gotten the hang of it, something unexpected pops up πŸ€”. It's the language that keeps throwing curveballs, the one where you're always discovering something new. I recently stumbled upon a TikTok video where someone was rating their experiences with different "programming languages." Now, before the tech bros try to jump meπŸ˜…, I'm fully aware that CSS isn't exactly a programming language; it's more of a styling language. But, let's dive into it anyway.

Python was the reigning champ πŸ…, no surprises there. Its syntax is so close to human language that it's a favourite for many, including myself. On the flip side, C# was less favourable, but I can't personally vouch for that since I've yet to learn it. What really caught my attention and weirdly gave me a sense of relief, was CSS being rated as one of the hardest to grasp.

For those who are new to CSS, it's a language used to specify the style of a document, including colours, layout, animations, and fonts.

Because CSS is not an actual programming language, it feels absurd to admit that it is a challenge. It baffled me how configuring an API or crafting algorithms for business logic felt more straightforward than centring a simple div 🀯. But it was encouraging to see many others were facing this.

This TikTok revelation couldn't have come at a better time. I was starting to feel defeated when doing the visual formatting of a project I was working on, specifically working on the layout. Sure, using styling frameworks like Bootstrap helps, but it doesn't magically solve everything.

The main thing was that things I was expecting to happen... didn't😫. e.g. In theory, margin-left: 10px should scoot my div 10px further from its neighbours on the left, so WHY ISN'T THIS HAPPENING?!

While it's tempting to resort to negative margins or absolute positioning to solve layout issues πŸ‘€, I knew better. These quick fixes would lead to complications down the line, so I decided to approach CSS with the respect it deserves and embarked on a quest to truly master CSS.

My first realisation was that many people (including myself), greatly underestimate CSS. We think that because it has a simple syntax, with a simple use (at the end of the day, all we're doing is colouring things in and moving things around 🎨), it will be simple. But this isn't necessarily the case.

I wouldn't start coding in C# without a thorough understanding of it, and if I'd worked with it before, I wouldn't expect all that knowledge to magically resurface πŸ‘©πŸΎβ€πŸ’». I'd take the time to refresh my memory.

I realised that I needed an intimate understanding of CSS, delving deep into its default rules and constraints to improve my styling skills. Hopefully, this would mean that I would no longer take 10 years to style a project πŸ€¦πŸΎβ€β™€οΈ.

I needed to have in-depth knowledge of the distinctions between relative, absolute, and fixed positioning. I need to understand how margin manipulation would differ when used on components with different display properties. I need to have a thorough understanding of flex-box and the grid system and how they differ. And most importantly, I need to put my learning into practice, fail, and then learn some more.

Hopefully, finally paying CSS the respect that it deserves will pay off πŸ™πŸΎ.

I'll keep you posted on my journey.

Until next time,

Happy Coding!