Learning To Code By Building CMSs
|

Learning To Code By Building CMSs

It’s easy to use Facebook or other CMS every day without thinking about how the code works. This summer I have coded two CMS using Linkedin Learning. One of these CMS was running with PHP and MySQL and the other was running with Ruby On Rails and MySQL.


The PHP CMS


In the process I learned how to install MySQL, how to get MySQL and PHP to talk to each other. How to organise files between private and public folders on a web server and more. Getting MySQL to talk with the web server was a challenge that took a few days to get right.


With the PHP CMS I learned about arrays, about interacting between PHP and MySQL and I learned to be attentive to using the correct syntax. Sometimes though, a single typo would block my progress for a period of time. It wasn’t rare for me to compare the code I wrote with the code written by the instructor line by line to find my typos.


I could have cut and pasted the code but I found that simply typing the code character by character was enough to force me to read the code carefully. When I made typos it taught me to attentive to details as well as to be more aware of the syntax.


Ruby On Rails


Ruby on Rails was an interesting learning challenge. I got stuck before I even finished setting up the project. As a result of this I went back and followed a course on essential Ruby. This worked as a nice complement to what I learned from that point on.


During the project configuration process I got stuck because I created the project with the wrong database connection type. I left it on the default and when I tried to correct this I failed, and failed, and failed again. Eventually I decided to delete the application and create a new one, with the right database connection and this time it worked well.


The challenges I faced were that the Puma Server wouldn’t start because a gem was missing, that the CMS wouldn’t start because of a mistake in the routing file and more. Eventually I would restart the server but I spent a lot of time debugging.


One of the most persistant problems I had with Ruby on Rails is that it’s hundreds of lines of code across multiple files and although the error messages are obvious you need to learn to read them. For two or three days I couldn’t find what the error was, despite looking through every page and its code. Eventually I found that I had written “visible” and forgotten a “:visible”. That error crashed the Puma server consistently.


With Ruby On Rails, I learned to work within a framework. This knowledge is transferrable to working with other frameworks. I’ve gone from knowing how to install and use a CMS like WordPress, Joomla, and Drupal to learning how to create one and to understand how arrays and functions work. I have also learned how to think about security and how to use blowfish and other encryption technology to keep passwords etc. more secure.


With Ruby Gems I could work on projects of my own and be less reliant on other websites. One project I would like to work on is creating a heatmap of all my walking activities and the easiest way to do this would be to find some code and adapt it to have the functionality I desire.


The Next Step


The next step is to learn to use JavaScript. I will then know how to use HTML/PHP for content, CSS for layout and finally JS for interactivity.



2020 – The Golden Opportunity to Be A Recluse

2020 – The Golden Opportunity to be a Recluse. If you’ve ever wanted a reason not to be social then open society’s behaviour, in regards to the COVID-19 virus, has provided us with a fantastic opportunity to enjoy being reclusive.


During a normal Spring and Summer I would be driving to the mountains to hike, climb and enjoy via ferrata with people but this year those plans have been destroyed. This year we can’t share the same room as others to sleep. We can’t even eat within two meters of other people.


There are no handshakes, no hugs and no “bises”. This year if you live alone you’re without physical contact. This year, the more solitary you like to be, the stronger the appeal of such a year.


In a normal year if you were single or below a certain age you’d be pressured to go out and be social, rather than staying at home to work on projects, read books or otherwise be solitary. This year there is no pressure to go out on Thursday and Friday night, and there is no pressure to go out to do group activities during the weekend.


With its single minded desire to reopen too early society has destroyed any chance of a normal summer being possible. Until the 21st of June it looked as if Switzerland was three or four weeks away from the pandemic being over, or at least wonderfully under control. There was a brief window with just 10-20 infections a day.


Speaking as an idealist I believe that we were so close to Switzerland getting to tens of new cases a day but recently the seven-day average is back to 100 cases a day.


Silver Linings


Source: https://www.corona-data.ch/


One of the silver linings is that the number of ventilated people declined to zero for several days, the number of intensive hospital cases is staying low and finally, that the number of regular COVID-19 patients was in decline, until two days ago.


At its maxium number of active infections Switzerland was at 98 percent of ICU capacity. Two more percent and triage would have been required.


Depending on whether you work for the airport or think as an environmentalist Geneva airport expects to be at 19 percent of capacity this summer, due to so few people travelling at the moment. It’s great for the environment, but a shame for jobs.


Societal Self Harm


Speaking from a strictly theoretical point of view we have centuries of pandemics to look back on. We have books such as La Peste by Camus, to turn back to. In theory, we know what to do in the case of pandemics, and how to avoid them. We also know how to control them.


We know that in Medieval times villages would shut down to the outside world for weeks or months at a time. We know that ships were quarantined offshore. In some cases, places of infection were marked.


As we watch the current pandemic we get the impression that lessons were never learned. We get the impression that people never studied plagues and other epidemics and pandemics. We get the impression that people are flying blind. This is a shame.


It’s a shame because we are in the 21st century. We live in an age where we have thousands of hours of documentaries about plagues, disease and epidemics. We live in an age where people can get advice and information straight from medical health professionals. We live in an age where everything can be ordered online. We live in an age where being trapped at home does not mean having conversations has to stop. We live in an age where many of us are information workers.


In light of all of this it seems illogical that we would live through the worst pandemic in human history.


I have seen a lot of discussion about rights but responsibilities have been skirted. The responsibility to wear a mask, the responsibility to keep human to human interactions to a minimum, the responsibility to avoid people rather than expect them to make the effort to be safe.


The self-sacrifice of not going on holiday, the self-sacrifice of not going to sit in a park half a meter from others…


With everything that society, as a whole knows, it is a shame that the pandemic coalesced into such a serious problem because we had the tools and knowledge to ensure that it would be dealt with as swiftly as the epidemics we have already lived through, in our own lifetimes.


At its core Switzerland, until the 21st of June Switzerland was doing everything right, and to a serious degree it is still doing the right thing, with the number of ventilated people being at zero and the number of serious cases also dropping.


At it’s core my only issue is with having a third summer with limited opportunities to meet new people. As long as the pandemic is around it seems more logical to give in, and use dating apps, to meet new people, instead.


The Up-Skilling opportunity.


A few weeks ago I sad that I would try to create my own WordPress theme, but I overshot that goal by learning CSS and redesigning my entire website. I have learned to create a CMS from scratch using PHP and MySQL. Now I’m learning Ruby On Rails and it’s going well. Ruby on Rails looks like an intuitive framework to work with. I’m working on changing my career path.