The popularity of Python has skyrocketed in recent years. It has a tonne of different applications and is easy to use.
But should you learn HTML before Python? Overall, you should learn HTML before Python if you intend to make apps for the web because it is the fundamental building block for websites. However, for desktop or command line projects you won’t use HTML so you can learn Python first.
So, the area of development you want to go into will determine whether you should learn Python or HTML first.
Let’s take a deeper look into the situations where learning HTML before Python will come in handy.
HTML or Python
Before we dive into the specific instances of when you should learn HTML before Python, or vice-versa, it’s important to properly understand what they are.
It can be a little overwhelming when people starting talking about server-side, client-side, fronted, and backend.
Let’s define HTML and Python so we can look at the best ways to use them.
Python is used for automating tasks, analyzing data, creating websites and software, and visualizing data. It is an object-orientated, high-level programming language that has built-in data structures.
Its simple syntax and readability make it ideal as a server-side (backend) language on projects of all sizes. Python has also become the de facto language for machine learning.
For web pages, Python generates the data it wants to display on the backend then uses front-end technology to display it. It can also be used on the desktop, command line, and the web.
Various non-programmers have utilized Python to accomplish and automate everyday tasks like organizing finances.
Python also has a lot of extension libraries so it supports modules and packages which promotes code reuse and a modular programming approach. To learn Python you’ll need to pick up some core programming concepts.
HyperText Markup Language (HTML) is not a programming language. It is a markup language used by web browsers such as Chrome to format pages.
HTML describes the structure of a page in a way that the browser can interpret it. Different elements are used to position and structure content on the page, these include inputs, buttons, and divs.
Often HTML is learned alongside CSS or a CSS framework like Bootstrap so that developers can style their pages.
You can only use HTML on the client-side or frontend. It won’t work outside of a web browser can be used to create desktop apps. Although the introduction of Electron JS had changed this slightly.
Unlike Python, you won’t have to learn any programming concepts to be able to use HTML. It doesn’t require any logic or specific setup.
You can get going straight away and the immediate feedback you receive when adding elements is a great motivator for those learning HTML and development in general.
Should you learn Python or HTML first?
Deciding on whether to learn Python or HTML first can leave a lot of would-be developers with analysis paralysis.
Let’s take a look at a few ways you can create apps and whether it’s better to learn HTML before Python.
A desktop developer builds software that runs on Mac and Windows. If you are keen on this pathway you probably won’t need to learn HTML.
Desktop applications are usually built with C#, Java, or Python. A library called PySimpleGUI gives you all the tools you need to build a fully-fledged desktop app. PyQt5 is also great for GUI building. If you intend to go this route then definitely learn Python first.
However, there is a caveat.
So deciding what to learn first isn’t as clear-cut now. Most desktop software doesn’t use web technologies s if you plan on going this route stick with learning Python, Java, or C# first.
Some awesome first projects include:
- Audio and Video Player
- Image manipulation software
A web developer builds software that runs in a browser, this includes but isn’t limited to web apps and websites.
As we discussed earlier, HTML is the fundamental building block of web pages. It gives them structure and allows the browser to interpret the page.
The cool thing about Python is that you can use it on the server-side to render web pages. So if you want to become a web developer but are keen on Python, then feel free to learn both.
But just focus on the basics of HTML before graduating to Python if you want to develop products for the web.
Some cool first projects to mix HTML and Python include:
- Tic Tac Toe
- Quiz application
- Content Collator
There is a nifty Python library called pygame that is perfect for developing different games online.
Python: General Usage and the Command Line
Many people are picking up Python to help automate their day jobs. It’s easily integrated into Excel and other programs and saves a lot of time.
You can also build stuff with Python in the command line to help you solve specific problems. The command line has no GUI and does not run in the web browser so it is very different from the sections above. It is the original method of interacting with programs on your computers.
People with Python skills can use the command line to automate repetitive daily tasks.
If you want to automate general work tasks or specifically use the command line, then don’t bother learning HTML, learn Python first.
There is no need for HTML in the command line or Excel spreadsheets, so picking that up would be a waste of time.
To explore using Python in a more general sense, I’d recommend building:
- File Renaming Tool
- URL Shortener
- Excel Spreadsheet splitter
Whether you should learn HTML before Python will depend on your long terms goals. For web development learning HTML first is crucial. However, if you intend to take the desktop development route then learn Python first.
For more general-purpose tasks, like automating the boring stuff (fantastic book by the way), stick with Python.
Either way, don’t get stuck on deciding. Dive right in and get to drips with coding, you won’t regret it!