Lets Learn to Code
The Learn2Code Tribe invites people to discuss and learn computer coding skills. The name of the tribe begs the question: What languages should I learn?
This question is problematic as programming preferences change with time.
It is not uncommon for industry to develop a language to solve a particular problem. Once the problem is solved, programmers want to move onto the next big languages.
One should expect languages to change with time.
The cutting edge technology of one generation will be considered legacy code by the next.
That said, there are a few programming languages and file formats that are likely to persist through the ages. So, it is smart to start with these languages.
I believe that the first languages that new programmers should learn are: HTML and SQL.
HyperText Markup Language
HyperText Markup Language (HTML) is a standardized format for the Internet. Coders need to master HTML so that they can communicate online.
People use a device called a web browser to view HTML pages. I suspect that most of the people reading this page are using a web browser.
Some browsers allow users to right-click on the page and view the source code for the page.
One of the best ways to learn HTML is to examine the HTML created by others.
If you view the source for different web sites; you are likely to find that most programmers write really sloppy HTML.
Why is this?
HTML is simply a document format. I suspect that most users of this forum have a basic knowledge of HTML; so I will jump to SQL.
Structured Query Language
As the name implies "Structured Query Language" (SQL) was designed for executing queries on a properly a structured database called a Relational Database.
Just as you need a web browser to view HTML pages. One needs a specialized program to explore Relational Databases. This tool is called a Relational Database Management System or RBMS.
Popular RMBS include Oracle, Postgres, MySQL (or MariaDB) and Access.
There are hundreds of such programs.
I will use a RDMS called SQLite. SQLite3 is a free lightweight database designed to be embedded in programs.
Dwayne Richard Hipp (1961 - present) created SQLite in 2000 while working at General Dynamics for a contract with the US Navy.
The project was using the IBM Informix Database. Like most RDMS, the database was top heavy, resource intensive and expensive.
Hipp created a simple C library that programmers could call to create and maintain tables in a lightweight relational database structure.
The project slowly began adding features such as international support. They also created a lightweight command line interface.
I use the command line interface to create tables and then write programs to access the tables that I created.
Hipp designed SQLite with Postel's Rule in mind. Postel's rule states: "be conservative in what you do, be liberal in what you accept from others"
Jonathan Postel (1943–1998) is an internet pioneer who helped develop the ARPANET protocols that created the TCP/IP stack (ahem, the Internet). He later helped maintain the Request for Comments (RFC) system that helped define Internet protocols. Lets see, Postel helped design the Simple Mail Transfer Protocol (SMTP) and helped establish the Internet Assigned Numbers Authority (IANA)
Postel was a primary editor of the Request for Comment (RFC) which helped set Internet standars and worked on the Domain Name System (DNS) in 1988.
Following Poste's Rule, SQLite allows for dynamic typing and is not tripped up on all of the constraints and triggers used by most RDMS.
I like this approach. Since I control the data I collect, I can create my own constraints. I don't need a triggered database to do it for me.
Limitations of SQLite
There are a few limitations to SQLite. Notably SQLite has a limit on its database size of 281 terabytes.
If you want to store more than 281 Terabytes; you will need to split up your database into separate tables.
I've used SQLite database with over a hundred million rows. The database is still quite fast; However, full table scans are slow. Importing and exporting that many rows is also slow.
A full database scan on any database will be slow.
SQLite and Decentralization
People in the Hive-O-Sphere claim to support decentralization.
The When To Use page by SQLite says the following:
Client/server SQL database engines strive to implement a shared repository of enterprise data. They emphasize scalability, concurrency, centralization, and control. SQLite strives to provide local data storage for individual applications and devices. SQLite emphasizes economy, efficiency, reliability, independence, and simplicity.
Traditional RDBMS seek to centralize control over date. SQLite emphasizes efficiency and independence.
The article further states that SQLite does not intend to compete in the traditional database space. SQLite sees fopen() as its primary competitor.
fopen() is a C fuction that opens a file. I had such a horrible time with the PDO Object[^1] in PHP, that I considered dumping the database world altogether and just using raw files instead. JSON and XML do just this.
I lost the data in raw DOS files back in the 1990s and have been scared of such files ever since. The data loss may have been caused by a bad sector on the disk, or maybe a cosmic particle hitting my computer at the wrong time.
[^1] The problem I had with PDO was that a query returned the wrong data. The problem had something to do with the way that the PDO object extended the Countable Object. Bizarre stuff. I was not able to debug the problem.
SQLite For Long Term Data Storage
I have yet to lose data in a SQL database. The databases are lightweight and easy to back up.
Interestingly, the The Library of Congress suggests SQLite tables as a viable solution for long term data storage.
Which Programming Language Should I Use
So, my first recommendations for new coders is to intall a Web Browser and SQLite3 on their local machine.
This is a great start; However these two programs are disjoint. One needs some sort of web server to connect the two programs.
So, I need a third programming languages.
There are hundreds of languages that can accomplish this task. I can do it with C, PHP, Java Servlets, Node.js, Python, C++, Go, Rust of Zig.
The process of choosing the right language is driving me to distraction.
I've spent the last couple of weeks testing different languages. Each language has its plusses and minuses.
I've strongly considered using C. C was built for computers with eight bit processors. 64 bit processors are common. The language uses an 8 bit character set. As C was created before the advent of Unicode, it has limited UTF8 support.
Many pundits believe that C might be at the end of its useful life cycle.
Rust and Zig are exciting new programs.
Both languages have arcane syntax. Rust was built on the idea that one can limit memory faults by placing constraints on the programmer.
While I see merit in the programs, I don't like the direction that they are headed.
I am still in the process of deciding the programs that I want to use.
To make matters worse, while I was testing Zig on my development server. I accidentally wiped out one of my domains. I forgot that it was still sitting on my development server.
Conclusion
I believe that people who learn HTML, SQL and a yet to be determined third language will be set to conquer the world.
Image Credits
I created the image for this post with NightCafe.