Pros and cons of creating a website from scratch.

October 20, 2021

From the archive. I wrote this in 2021 for an earlier version of this site. It is kept as it was then, apart from the layout and a few links.

Summary

Creating your own website from scratch will help you develop valuable skills that last a lifetime. There are many complex things you have to think about though, and starting unprepared might paralyse you in the process.

Having personally experienced this paralysis, my goal is to prepare you by sharing my experience.

Why not use a content management system?

A content management system (CMS) is a system that allows you to easily create, modify, and manage content on your website (from Wikipedia). A major advantage of a CMS is that it abstracts away many technical details, for example:

With a CMS you can add and prettify your text in a visual editor, and add pictures via upload buttons. No need to think about open- and closing tags of HTML, their semantic meaning, or the hundreds of lines of CSS that are needed to prettify even a simple homepage.

Instead of having to configure, maintain and secure a web server via a terminal, you simply press ‘deploy’ if you want to publish your website. Your content is also automatically stored in a database, without you having to worry about administration, security, or back-ups.

Although convenient and an ideal choice if you quickly want to publish your content, using a CMS will not help you develop valuable skills that last a lifetime. Gaining practical experience in HTML, CSS, web servers, and databases will.

Where to start?

My general approach to learning new things is to read several recommended books on the topic and go from there. However, HTML and CSS are easier to learn via an interactive online course, since you get immediate feedback from the browser and hands-on experience.

After some research I stumbled upon a high-quality Udemy course on building responsive websites with HTML and CSS, taught by Jonas Schmedtmann2. The depth of the course, the calm and knowledge of the instructor, and the large number of hands-on projects stood out for me.

Although I can recommend this self-study approach, I must stress that only studying is not enough to become skilled. Practical experience is crucial. Also, it took me 2 months to complete this course in my spare time, so be ready to make a serious commitment if you decide to follow this path. So why should you care about HTML and CSS?

Together with JavaScript they form the 3 languages of the internet. Having a solid understanding of how the internet works can be a great advantage for any data professional, and it will open doors in the digital analytics world. Solid knowledge of HTML and CSS also gives you the power to bring ideas alive by creating tangible prototypes of websites and apps.

With HTML and CSS covered, I moved on to a more familiar topic.

What about a database?

Using a database can help you manage complexity when developing your website. Say you want to build an e-commerce website with 50+ products that are subject to change, ask yourself the following:

Hopefully not.

You can create dynamic web pages by using a server-side programming language like Python. This technique makes it possible to insert data from your database into the HTML, and is also used on my homepage.

from flask import Markup

latest_posts = [{
'url_ref': 'blogs_2021_bp.how_this_website_is_build',
'date': '2021-10-20',
'title': 'Pros and cons of creating your own website from scratch.',
'intro': Markup("""
                Creating your own website from scratch will help you develop valuable skills
                that last a lifetime. There are many complex things you have to think about
                though, and starting unprepared might paralyse you in the process.
                <br /><br />
                Having personally experienced this paralysis, my goal is to better prepare you
                by sharing my experience.
            """),
'tags': 'tags/python_html.html'
},
..
]
<div class="latest-posts-container">
{% for blog_post in latest_posts %}
    <article class="blog-post" onclick="location.href='{{ url_for(blog_post.url_ref) }}';">
        <p class="blog-date">{{ blog_post['date'] }}</p>
        <p class="blog-title">{{ blog_post['title'] }}</p>
        <p class="blog-intro">{{ blog_post['intro']}}</p>
        {% include blog_post['tags'] %}
    </article>
{% endfor %}
</div>

Instead of having to manually update the ‘latest posts’ section with every new post, I only need to update the database. For illustration purposes I displayed my old approach of using a list with dictionaries but the idea is the same. Do not worry if the code makes little sense to you, I will follow-up with detailed posts about Python, Flask, and Jinja2.

Whether you need a database or not, I would recommend using one. Learning how to setup, modify, and interact with a database is a valuable skill, and it will help you prepare for more complex projects.

Deployment in the cloud.

In the realm of data science, deployment - or bringing a project to production - is often the most difficult part. This is similar for your website, especially if you decide to use a database. With difficulty comes opportunity though, since this is a great chance to gain valuable experience with popular cloud service providers like Amazon Web Services (AWS), Azure, or Google Cloud Platform (GCP).

For brevity, I will only focus on 2 popular choices of deploying your website on a cloud platform.

Renting a Virtual Machine (VM) from a cloud service provider (CSP) gives you the most freedom about the deployment. The CSP takes care of the hardware and its maintenance, and the rest is up to you. This is the reason why it is called Infrastructure-as-a-Service (IaaS).

The downside of this option is complexity. Unless you feel comfortable with Linux, working from a terminal, and installing and configuring a web server, I would not recommend it for your first website. If you already have experience in this area, and the following image feel like home to you, go for it.

A linux terminal.

As an easier alternative, I suggest you use an App service (PaaS). For this website, I use the Apps service from DigitalOcean. The main reason I choose for DigitalOcean is their awesome documentation.

Note that a website that includes a database can also been seen as an app, and it is totally fine to use this type of service for a (simple) website.

Besides taking care of the hardware, the Apps service also manages the software, and they provide a web portal UI to easily build, deploy, manage, and scale your app. This makes it a lot easier to deploy your website in comparison to IaaS, but you still need to take care of a few technical details.

First, how are you going to upload your code to the Apps service? This is strictly done via version control systems like Github or Gitlab. If you are not yet familiar with version control please have a look at this great official git resource.

Second, your website is by default deployed to a subdomain of your CSP via the secure HTTP protocol (https). However, if you want to use your own domain you have to buy it, link it to the Apps service, and request new SSL-certificates. Most CSPs will make this relatively easy to do, but you might need to read some additional documentation.

Every popular CSP provides a similar service, only their names differ.

For simple apps and websites I don’t think it matters which CSP you choose. If you are unsure let the quality of the documentation be your guide since you will spend a decent amount of time with it. For more information about IaaS and PaaS have a look at the official Microsoft Learn documentation.

Final thoughts.

If you are in the world of data for the long haul and you have time to study, I believe there is great value in building your website from scratch. If you want to share your thoughts and ideas with the world as quickly as possible, go with a managed solution like a CMS.

No sponsored or affiliate links. If something here is new to you, the link is an easy way in.