My compatriots and friends often ask me, "Soeren, what's the best programming language to learn?"
This scenario is all too familiar to many of my fellow computer science geeks, I suspect. After all, we're programmers! Shouldn't we all know what the best language is? Many people simply do not realize that coding is not like Quidditch. There's no Nimbus 2000 of programming languages.
Rather, it's best to think of programming languages like tools in a toolset. You wouldn't ask a construction worker, "Hey, what's the best tool in your belt?", would you? She may have a favorite tool, or one that she likes to keep handy, but every tool has its own unique purpose. Similarly, there does not exist one single language that works the best out of them all; there are only languages that do different things.
That being said, perhaps a more appropriate question to ask might be: "What's the most important programming language in the field of [x]?" That's a much more interesting conversation to have, and it just so happens I may have found a small insight into a possible answer.
You see, I was browsing my Github repository, as one does in their spare time, and I made a connection I never noticed before. It's like when you walk past the same door every day; you stop thinking about it after the third or fourth time and eventually you just phase it out.
There's this handy feature on Github you may know about, which gives you a brief statistical overview of the languages used in your repository, like this:
That's the private repository in which I keep the code for all the websites I've ever made, including this one. And if you didn't already notice, there's an interesting statistic lurking in there. Apparently, 42% of the code that makes up all my websites is CSS. That's almost half!
Sorry, I'll stop with the Harry Potter gifs now.
I know, I said I'd stop. I'm really really done, I promise. They're just so fun!
- Animations and Transitions
- Generate content with pseudo-classes
Some examples of pseudo-classes are :after, :hover, and :invalid. They allow you to conditionally alter properties of elements, usually when specific user-interactions occur. But even more impressively, you can actually put text into these elements using the CSS content property. Click that link to find out what I'm talking about.
- Calculate values with calc()
That's right. CSS isn't just a simple declarative language anymore. You can perform calculations! ... In some browsers :-(
- 3D Transformations
Yup. You can rotate, translate, and transform elements on all 3 axis. If you use this in an animation, you can create some pretty spectacular visuals.
- Media Queries for different devices
Ever heard of responsive or mobile friendly design? This is how it's done. You can specify different properties for devices based on width, height, pixel density, device type, and more.
Not impressed? You should be.
I'm not saying CSS is the godsend of all languages. There's plenty of stuff it still can't do. I mean, some people don't even consider it a language at all. (Technically it really isn't. It's more of a syntactical instruction sheet.) All I'm saying is that if 42% of a website's code is CSS, then for any beginners out there, it's probably a language worth focusing a lot of time on.
Do you disagree? Have anything to add about CSS and its all-powerful craziness? Wanna discuss these amazing Harry Potter gifs? Put it in the comments, yo.