Introduction
When I first started learning web development, I was overwhelmed with all the different options. HTML or CSS? Java or JavaScript? And what's a JAMstack? Over time, I found that while coding can be fun and satisfying, it's also immensely frustrating. But after years of practice (and many Google searches!), my brain has settled on one tool that it prefers above all others: HTML. Sure, I'm willing to dabble in other languages when necessary, but at the end of the day my brain feels most comfortable manipulating HTML into exactly what I need for a project. Here are a few reasons why:
HTML is more suited for web development than JavaScript
You probably know that HTML is a markup language, but it's also much more than that. HTML is a declarative language: it describes what something should look like, not how to make it happen. That's why you can use HTML on any device with a browser—from smartphones to smart TVs and beyond—and have it look the same. HTML focuses on content and structure, making your pages readable by humans and machines alike.
HTML is also a document-based language. This means that all of your page's content goes into an tag at the top of the page (or within an section). All other tags go inside this tag, including headers (, , etc.), footers () or sidebars (, , etc.).
Finally, as we've seen above, everything in HTML is made up of tags: every paragraph starts with an opening tag; every link has an opening . Each tag has both attributes (information about what kind of element it is) and values (what should go inside the element). The key difference between JavaScript and HTML lies in their roles: while JavaScript enables interaction through changing the values of certain elements' attributes over time (e.g., when users click something), HTML only allows you to set static attributes once per document load event occurs—and even then only one per element at any given time!
HTML is more straightforward for my brain to understand
HTML, or HyperText Markup Language, is a markup language. It's what's used to describe the structure of a web page. HTML has been around since 1990 and is the foundation for most of the sites you see on the internet today. In fact, HTML5 is still in use today!
Now if you're like me, when I hear "markup language," your brain automatically thinks about something like XML (which stands for Extensible Markup Language). And while HTML can be considered a form of XML as well—it even shares some syntax with its bigger brother—there are some key differences between the two languages:
HTML is a declarative language; it tells browsers how to display things rather than how they should look (as with CSS). This makes it simpler to understand and write in my opinion because there's less clutter involved when writing code by hand (especially when compared against JavaScript).
HTML can often do what JS does
While JavaScript can often be used to accomplish the same tasks as HTML, it's a lot more complicated. For example, take a look at this simple HTML code:
Hello World
Now compare that with its corresponding JS code:
$("body").append("Hello World");
My website design degree focused on HTML
HTML is a markup language, which means that it's used to describe the structure of your website and its content.
HTML is a declarative language: It defines what something is, rather than how to do it (which JavaScript does).
HTML is a structural language: In other words, HTML allows you to define the relationship between elements on your site. For example, if I want two paragraphs side by side with no space in between them instead of one below the other (default behavior), I can simply state that they're siblings using tags instead of .... This also means that you don't need to worry about whether or not someone has JavaScript enabled; any browser will display your page correctly even without JavaScript support!
HTML is defined by standards bodies like W3C and WHATWG who make sure everyone follows the same rules so that everyone can build websites regardless of their operating system or browser type.
Sections in HTML are just easier for me to understand than sections in JavaScript
Here's why I prefer HTML over JavaScript:
It's more straightforward. HTML can often do what JavaScript does, but it's much easier to understand. My website design degree focused on HTML rather than JavaScript, so I've been using web development for years now and am comfortable with it.
They are both languages that you can use to make websites, but they each have their own set of pros and cons. In my opinion, HTML is better for web development than JavaScript (and vice versa).
Conclusion
If you’re new to web development, and are wondering which language you should learn first, then I'd recommend HTML. It's much more straightforward than JavaScript and will suit you better if you're looking to build websites quickly and easily.