Skip to content

Instantly share code, notes, and snippets.

@somahargitai
Last active May 5, 2019 10:12
Show Gist options
  • Save somahargitai/b37168697a26180d772c255c6414eb16 to your computer and use it in GitHub Desktop.
Save somahargitai/b37168697a26180d772c255c6414eb16 to your computer and use it in GitHub Desktop.
Theoretical Programming FAQ - Questions which usually don't change anything but some coders worry about so much

Theoretical Programming FAQ

Definition of "programming language"

(1) Is HTML a programming language? And CSS?

HTML can be examined as a programming language, but its goal is different than of "classic" programming languages, that's why we have the category of markup languages. So basicly no, it is not by definition.

The question roots in the Duck Test:
If it looks like a duck, swims like a duck, and quacks like a duck, then it probably is a duck.

  • Software engineers are people who do programming. Programming is being done with programming languages. Lots of software engineers spend most of their time with HTML and CSS.
  • It is possible to apply fundamental programming concepts in CSS or related technologies. Like if/else in Sass (which is an extension language for CSS).
  • Computer science examines programming languages with theoritical concepts, like Turing completeness. Some of these concepts can be applied on HTML and CSS too, see Turing completeness arguments under the following links: freeCodeCamp about Rule110, Stackoverflow Q/A about CSS TC.

Based on the points above HTML and CSS seem like programming languages. But they are not.
If you ask me, the main reason we are talking about it is that some coders like boasting that they are The Software Engineers while others are just dumb coders who don't even code in a programming language - so they are not even programmers. This boastfulness is typical against web designers, sitebuilders and developers who work in popular, accessible frontend technologies, like Wordpress or PHP itself. Boastfulness exists in many professions - please do not accept it.

(2) Is HTML a markup language? Is XML a markup language?

Then JSON is also a markup language? And what about Google protobuf? CSS?

Originally markup languages were made to describe a document: like a static website or an email. They also wanted it to be human-readable as code. But coders later realized that they need data formats which can be sent really fast between network elements, like APIs or frontends - this thought is essential for the internet. Markup languages were obvious choices, while this functionality is not necessarily a markup job any more. For this reason today we have markup languages, data-interchange formats and mixed functionality formats.

A LaTeX file is only a markup: it describes a document but we don't use it for transfers. A JSON file is a data-interchange format. It does not describe a document but it describes organized information. An HTML file plays in both roles: it describes a document but it is also a lightweight format created for network transfers. It is human readable and it contains data.

CSS is a special category: it is a stylesheet language. It is quite funny because this category is hardly applied for other languages but CSS. There are some other stylesheet languages but most of them are just dynamic preprocessors for CSS or its historical predecessors. In general I would say that a stylesheet language is only a supplementary language for a markup language, a "syntactic sugar" to seperate and simplify styles. Originally this information was placed into the HTML inline and we still use it in HTML headers.

note: there are other terms for data-interchange formats, like "container languages" or "data description languages". Likewise, technologies like Sass can be called as "extension languages" instead of "style sheet languages". Basicly CSS is the style sheet language, Sass is a preprocessor scripting language only which translates to CSS. And - wait for it - Sass is Turing complete!

related articles

What is LaTeX? A software or a markup language?
If YAML ain't markup language, what is it?
XML is not a markup language

What is the difference between the different programmer names?

software engineer, software developer, coder, programmer

Most programmers handle these terms as levels of knowledge and/or levels of responsibilities. In fact, these terms rather root in the history of programming. First coders were university engineers. Even today many university trainings on software engineering are parts of electric engineering trainings. That's where I see the origin of software engineer.

Sofware developer is about differentiating people who actually develop code and others, who are just operators (remember the age of punched cards), testers and so on. In fact, it is also an oldschool term. We don't need operators any more to apply our code on a computer and even if there are dedicated software testers, their job us usually hardcore development - on the other hand, developers lie in the age of TDD, we write more tests than ever. So it is pretty hard to feel supremacy about being a developer. Same thing happened about "is it programming to work on HTML?" It was a real (and rude) question when web developers spent their times with cutting images to fit into the cells of a <table>. Today frontend developers rather spend their time with Angular or React frameworks. Quite similar to other programmers.

Should I parse HTML with Regex?

No.
https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags

Should I be good at math to code?

No.

Is Vanilla JS a real thing?

No. It is a joke. It was made as a piece of sarcasm over developers who want to use libraries and frameworks for tasks covered by native Javascript.

Read details on this Stackoverflow article. They even made a fake website for this non-existing framework, find it here.

Is programming about writing algorithms?

Every code is actually an algorithm but usually they are very simple. There are special jobs for algorithm development. Other developers usually don't implement complicated algorithms, only sequences, simple array processing etc. Their daily challanges don't consist of algorithms but of code organizing, following best practices and principles (see clean code finding the optimal code library for a specific task etc. It is a common mistake that companies hiring processes contain strong tests on algorithms for other kinds of developer jobs.

Which is the best programming language?

Different programming languages were created for different purposes and in different technological faunas of different ages. Therefore there is no "best programming language". Even the so-called general purpose programming languages are somehow better or worse at specific areas. In "ancient times of coding" low-level languages were the most succesful, like assembly or C, because higher-performing hardwares were expensive and you had to buy and operate them for yourself. In the 2000s it has changed: internet is accessable for 3.5 billion people, a laptop is affordable for a middle-class person, memory began so cheap that the biggest web service providers could offer free storages for free email services, code storages etc. Effect on programming languages: you can afford to loose speed if you win coding time. Because while memory prices fell, the time of the software engineers became super-expensive.

Of course we still need the fast, low-level languages. Mechanical and electric engineers still use C and C++ and if you check modern runtime engines, like V8 (of Node.js and Chrome), you will see that these time-critical functionalities are actually written in C++ or C. (Python even has Cython to provide C-like performance.) But on the top of them biggest amounts of code is written in higher-level languages: Java, Python, Javascript etc. See Github's chart on most-used languages.

While there are no best languages, you can find the worsts: they provide a functionality which is not necessary any more or can be done better with another technology. Even if they are doomed to extinction, they can sing their swan song for a long time if there is a critical legacy code written in them. A typical example is a nuclear reactor: it is a safety-critical system for decades, so the compliance of the code should be proven and changes are not recommended.

In these days the good languages can be recognized by their stability and a good environment: good IDE, modern package manager, good developer community, lots of available libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment