Adam Alton Profile picture
Jul 2, 2020 11 tweets 2 min read Read on X
#HTML & #CSS are not programming. A thread…
While CSS and HTML are not a programming language as such, being able to masterfully craft things with them requires a level of logical and creative thinking which is perhaps in some ways harder than "proper" programming. Let me explain…
A programming language tends to have very clear logic to allow "if X, do Y" type things. HTML & CSS also allow you to define "if X, do Y" type things, but through a nightmarish abstraction of a nested document tree and some declarations about how the things in that tree behave.
This is further complicated by some of those behaviours cascading down the tree (e.g. box-sizing) and some not (e.g. border-color). Plus other weirdnesses, like the fact that specifying vertical padding as a percentage means a percentage of the width, not the height 🥴.
When you want to write the logic for "if the parent element is wide enough to sit both child elements side by side then spread them apart horizontally to far left and right, but if not then stack them on top of each other both aligned left", you have to…
… do a load of creative brain work to translate that into the a set of HTML & CSS that will do what you want. It essentially requires imagining different possible solutions (sometimes crazy ones) and then thinking or testing if they will work.
I'm told that HTML & CSS (combined) are Turing Complete. So in theory you can use them to, say, programmatically generate the prime numbers between 1 and 100. But I bet that takes you a lot longer in HTML & CSS than in your favourite programming language.
I think that there's sometimes a tendency for (cynical) developers to conflate these things:
"CSS is limited"
"CSS is shit"
"CSS is not programming"
"CSS is easy"
CSS is in some ways very limiting. So it can be seen as basic or simple, and therefore "easy". But its limitations are what makes it *hard*.
You have to think creatively, because you can't just write a bunch of if/else statements to logic your way out of a corner. You have to think *creatively* as well as logically to dance your way out of a corner with only one shoe.
It's probably true that you're unlikely to build as complex systems in HTML & CSS as you might do in other languages, but I still think that there's a level of creative thinking required which is often overlooked.

Happy dancing.
/END

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Adam Alton

Adam Alton Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @altonpowers

Dec 26, 2020
So then, what has caused more deaths in #London this year, #Covid19 or #AirPollution?

Let's find out…

1/
As of Christmas Eve, the official number of Covid deaths in London *in hospitals* was 8,290. data.london.gov.uk/dataset/corona…

And according to that source, approximately 75% of Covid deaths occur in hospitals, which gives us a total number of Covid deaths in London of 11,053.

2/
The 2015 King's College London report on Air Pollution put annual deaths from PM2.5 at 3,537 and from NO2 at 5,879. (This is after accounting for a 30% overlap between the effects of PM2.5 and NO2.)

london.gov.uk/sites/default/…

So 9,416 annual London air pollution deaths.

3/
Read 13 tweets
Sep 24, 2020
In London, fewer deaths have been caused by Covid-19 than are lost due to air pollution each year.

Yup.

1/
First, fact checking!..

As of 18/09/20, total hospital Covid deaths in London was 6,172. In-hospital deaths are estimated to be 73% of total.
data.london.gov.uk/dataset/corona…

So 8,455 total London Covid deaths.

2/
The 2015 King's College London report on Air Pollution put annual deaths from PM2.5 at 3,537 and from NO2 at 5,879. (This is after accounting for a 30% overlap between the effects of PM2.5 and NO2.)
london.gov.uk/sites/default/…

So 9,416 annual London air pollution deaths.

3/
Read 11 tweets
Sep 18, 2020
Here we go… Image
Can't get the damn lid off.
Ok, I'm in. But they've got a weird yellow mould on them. Might give these a swerve after all.
Read 4 tweets
Feb 16, 2020
After many years, I recently ditched @googlechrome and switched back to @firefox, and it's wonderful. So wonderful in fact, that I feel compelled to tweet about it.

Here are some of the things that I love about it…
Firstly, you can send a tab to your phone (or vice versa), which is really handy.

I'm sure Chrome used to have this, and then they scrapped it 🤷‍♂️
Secondly, the "awesome bar". Remember the awesome bar? It's like Chrome's address bar but provides waaay better suggestions from your history.

That article you read last week… about carrots, but you can't recall the title or the site it was on 🤔.The awesome bar will find it.
Read 13 tweets
Feb 9, 2020
No.

A voting system needs to be inspect-able by members of general public. For an electronic system that means everything including the hardware, operating system, how/who that OS is installed (by), the interface software, data transfer & storage all must be open to scrutiny.
I've worked as a programmer for 10 years, and I wouldn't be competent at scrutinising all of those things.
If we gave every voter their own cryptographic key for voting, and they knew how to use it, then we could ignore most of the things in that^ list and just check the final data in the #blockchain. But I imagine such a requirement would hinder vast numbers of voters.
Read 8 tweets
Jan 26, 2020
Hi @OurWorldInData, this article of yours appears to contain 2 crucial mistakes/typos in one of its calculations [thread]

ourworldindata.org/food-choice-vs…
It says:

"Transporting food by boat emits 23 grams of CO2eq per kilogram of product per kilometer. To transport the 9000 kilometers from Central America to the UK therefore emits 0.27 kilograms CO2eq [9000km * 23g per tonne-kilometer / 1000 / 1000 = 0.27 kg CO2eq per kg].”
The calculation doesn't match the description. Is it 23g of CO2eq per kg of product per *tonne* or per kilometre!

And either way, the result of the calculation isn't right. It would either be 0.207 kg, or 207kg, but not 0.27kg.
Read 4 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(