How was 42 Penguins Built?


One thing that people ask about the various parts of 42 Penguins is "What did you make this with?".

Now the short answer is that I coded it, largely with skills that I learned on this course by Rob Percival on Udemy. I had some coding skills before this, largely to do with Small Basic and HTML, but this course massively expanded my capacity.

There are tools that you can use to make simple things and many of them are wonderful. But if you want something that is just as you want it, or something that does something entirely new, then you will probably either need to code it, or kid something else into coding it.

If you are interested, here are the things I have used.

HTML

HTML is not really a programming language. It is a series of tags that tell content how to present. If you want to present an image, there is a tag for that. You can also make a link, or make something a heading. It has been around for thirty years now and you can make a whole web page in HTML, although it will be pretty plain and have no functionality.

CSS

Cascading Style Sheets work hand in hand with HTML. You can dictate the colour, fonts and spacing on each page, or you can have a CSS file that multiple pages refer to. This will give you a consistent look and feel across your site, and one that is easily changed when needed. I had a rudimentary knowledge of this when I was making flat web pages, but it is massively powerful, especially when you use classes and ids.

Bootstrap

Bootstrap is way to get commonly used functionality that looks professional. You can download themes, both free and commercial, or you can just use it plain. Pretty much everything on this site is using Bootstrap and I can't recommend it highly enough. You get snippets of code that do particular things, like a nav bar that adapts to your screen size, and paste that code into your HTML. The look of this page that you are reading right now is the result of a Bootstrap theme and a CSS stylesheet.

Hosting

If you want a web page that people can see all the time, you need a server. For this site, I use a commercial provider called Ventraip, and I think they are wonderful. Web hosting in Australia used to be prohibitively expensive, but this only costs me about $200 a year. Certainly, it is not free, but so few things worth using are. Technically, you can host on your home computer, but most internet service providers forbid this. And there are free options, but I am happy to pay for a good experience.

JavaScript

JavaScript is a fully-featured programming language that runs in your web browser, such as Chrome or Edge. It is called a client-side language, which means that it runs on the machine of the person interacting with the web. For this reason, it runs quickly and is very responsive. Some parts of this site run entirely on Javascript for their smarts: the dice game, the timer, and the Maths practice.

I don't think that JavaScript is especially easy to learn, but there is heaps of information about it online and it is hugely powerful. You could have most of your smarts on the server side (more about this soon), but there would be no value in that a lot of the time.

JQuery

JQuery is like the super-smart cousin of Javascript, and you will often use them side by side. I certainly do. It only accounts for less than five percent of the code that I use, but it adds a level of functionality that would otherwise be too hard or too slow for me.

PHP

PHP is a server-side language that, as the name suggests, runs on a web server. When the file is called by a user, the code runs on the server before it sends the browswer the code for that page. In many parts of 42 Penguins, the PHP loads up content for the page from a database, or presents different content depending on decision made in the PHP.

PHP can be frustrating to work with, mostly because it just won't build a page at all if you make a small mistake. But it is also hugely powerful and I really like working with it. It is popular for technical people - often those who don't actually code - to lament PHP and tell you that no-one should use it. But is free and powerful and I would literally be lost without it.

MySQL

MySQL is a type of database and it is what I use extensively on 42 Penguins. If a page you are viewing appears to remember you, or something you did, across days and weeks, then that page is probably storing data in a table in a MySQL database. When it comes down to it, a whole lot of programming is storing data, retrieving data, and making decisions depending on the value of the data.

There are perfectly good alternatives to MySQL. I just don't happen to use them.

Visual Code Studio

Some students of mine introduced me to this editor and I am forever grateful. This is that I used to write 99% of my code and it helps me in a dozen subtle ways. Writing code in a plain text editor is possible, and I do for very small jobs when I have to, but this a wonderful product and I recommend it coding in any of the ways I have mentioned above. Oh, and it's free.

Conclusion

It is a common misconception that you only code in one language and that somehow there is one that it right for all purposes. I believe that you should have a toolbox with the tools that you use. If you are a game developer, or working in a Microsoft development environment, then you set of tools will look different, of course. But this is what I use, and I believe that anyone can learn to code and build things. Just start small. And then learn something new to go a little further. Repeat.