In Defence of the Single Page Application
Trenchant, brilliant stuff by William Kennedy 💯
(Cached)
Trenchant, brilliant stuff by William Kennedy 💯
(Cached)
Via Wikipedia. I am “not able rightly to apprehend the kind of confusion of ideas that could provoke” the genesis of other styles. “Haskell Style” has to be a joke (like this masterpiece) and I just pray I don’t encounter it in the wild1 🙏
// Allman
while (x === y)
{
func1();
func2();
}
// Horstmann
while (x === y)
{ func1();
func2();
}
// Kernighan & Ritchie
while (x === y) {
func1();
func2();
}
// GNU
while (x === y)
{
func1();
func2();
}
// Haskell style
while (x === y)
{ func1()
; func2()
;
}
// Ratliff style
while (x === y) {
func1();
func2();
}
// Whitesmiths
while (x === y)
{
func1();
func2();
}
// Lisp style
while (x === y)
{ func1();
func2(); }
See also: “Vertical Hanging Indent” is the One True Indentation Style
Update: Not exactly HS but good grief. ↩︎
Molly White asks if Web3 is bullshit. Short and excellent talk.
It’s what all the Patagonia-clads are raving about. They tell me it solves all perf problems in a snap.
Update
Here’s an NPM package. And, of course, Java if you’d like to deploy this in an Enterprise™ setting.
I don’t know whether to laugh or cry. This really got me:
My job is to keep our code running while other packagers are changing theirs.
Lord have mercy. NPM continued use and existence is proof that (Almost) Every Day is a Miracle ✨
Really cool stuff. Trained on the New York Times ingredients corpus (large 13.5MB CSV) and turns this
ingredients = [
"3 large melons",
"5 1/2 cups water",
"2 cups flour",
]
into this
[
{
"name": "melons",
"unit": None,
"qty": 3.0
},
{
"name": "water",
"unit": "cups",
"qty": 5.5
},
{
"name": "flour",
"unit": "cups",
"qty": 2
}
]
Saved me a ton of time with small project I’m working on right now. Looks like it’s written in C.
Software is and has been engaged in an endless race to the bottom.
Wrong. The Achievements of the software industry over the last thirty years are astonishing. They’ve managed to entirely negate several orders of magnitude of performance improvements provided by the hardware industry.
Here’s a giant list of games people have created with it. Here’s a teeny little introductory adventure. I plan on playing The Quest of DuBebe this evening:
This reminds me of falsehoods programmers believe about time. See also: Decimal Time.
Someday aliens are going to land their saucers in a field somewhere in New Jersey and everything is going to go just fine right up until we try to explain our calendar to them
“yeah we divide our year into a number of sub units called ‘months’ made up a number of days, and they’re not all the same length”
“I guess that’s unavoidable, if your rotations-count per orbit is a prime number”
“yeah, our’s isn’t prime”
“but surely you have most of these ‘months’ the same length and just make the last one shorter or longer?”
“No… They’re different lengths following no logical pattern”
“what”
“and we further subdivide the months into ‘weeks’, which is 7 days.”
“ahh, so each month is an integer multiple of weeks?”
“that would make sense, but no. Only one is, sometimes”
“SOMETIMES?!”
“yeah our orbit around the sun isn’t an integer number of days, so we have to change the number of days to in a year from time to time”
“oh yes, a similar thing happens on Epsilon Indi 7, where they have to add an extra day every 39 years to keep holidays on track”
“yeah that’s how ours work! Although the ratio doesn’t work out cleanly, so we just do every 4 years, except every 100 years, except except every 400 years”
“oh, you number your years? What’s the epoch?”
“uh, it’s supposed to be the birth of a religious leader, but they got the math wrong so it’s off by 4 years, if he existed at all.”
“if? You based your calendar off the birth date of someone you’re not sure exists?”
“yeah. He’s written about in a famous book but historical records are spotty.”
“interesting. I didn’t realize your planet was one of the ones with a single universal religion, that usually only happens in partial or complete hive minds.”
“uhh, we’re not.”
“You’re not?!”
“yeah we have multiple religions.”
“oh but they all have a common ancestor, which agrees on the existence of that leader, right?”
“uh, no. Two of the big ones do, but most of the others don’t believe in him”
“YOUR CALENDAR IS BASED ON A RELIGIOUS LEADER THAT NOT EVERYONE BELIEVES IN?”
“well, on his birth. And yeah, we got it wrong by a couple years.”
“OK, fine. So, you have somewhat complicated rules about when you change the length of your years, and I’m scared to ask this, but… You definitely just add or subtract that extra day at the end, right?”
“… Nope.”
"At the start of the year? "
“nah. The end of the second month”
“WHY WOULD IT BE THE SECOND MONTH?”
“I’m not sure, really.”
“huh. So at this point I’m dreading asking this, but how do you measure time within each day?”
“oh that’s much simpler. Each day is divided into hours, each hour has minutes, and each minute has seconds.”
“ok. And 10 of each?”
“10 hours? No. There’s 24 hours, 60 minutes, 60 seconds”
“… I thought you said you used a base-10 counting system”
“we do! Mostly. But our time system came from some long gone civilization that liked base-60 like 5000 years ago”
“and you haven’t changed it since?”
“No.”
“huh. Okay, so why 24? That’s not a divisor of 60”
“oh because it’s actually 12!”
“what”
“yeah each day is 24 hours but they are divided into two sets of 12.”
“and that’s 5 12s, right, I see the logic here, almost. So like, after hour 12, it becomes the second half, which is 1?”
“No, after 11.”
“oh, you zero-index them! So it’s hours 0-11 in the first half, then 12-23 in the second half?”
“No. 12 to 11 in the first half, and again in the second half”
“please explain that before my brain melts out my mouth”
“the first hour is 12. Then the next one is 1, then it goes back up to 11, then 12 again”
“that is not how numbers work. And how do you tell first 12 apart from second 12?”
“oh we don’t use numbers for that!”
“you don’t number the two halves of your day?”
“nah, we call them AM and PM”
“WHAT DOES THAT MEAN”
“I think it’s ante-meridian and post-meridian? But I’m not sure, I dont know much Latin”
“Latin?”
“yeah it’s an ancient language from an old empire which controlled a lot of the world and we still use some of their terms”
“oh, and that was the civilization that liked base-60 and set up your time system?”
“that would make sense, but… No, completely different one.”
“okay, and what do you do to if you want to measure very short times, shorter than a second?”
“oh we use milliseconds and microseconds”
“ahh, those are a 60th of a second and then 60th of the other?”
“No. Thousandths.”
“so you switch to base-10 at last, but only for subdivisions of the second?”
“yeah.”
“but at thousands, ie, ten tens tens”
“yeah. Technically we have deciseconds and centiseconds, which are 1/10 of a second, and 1/100 of a second, but no one really uses them. We just use milli.”
“that seems more like a base-1000 system than a base-10 system.”
“it kinda is? We do a similar thing with measures of volume and distance and mass.”
“but you still call it base-10?”
“yeah”
“so let me see if I get this right: Your years are divided in 10 months, each of which is some variable number of days, the SECOND of which varies based on a complex formula… and each day is divided into two halves of 12 hours, of 60 minutes, 60 seconds, 1000 milliseconds?”
“12 months, actually.”
“right, because of the ancient civilization that liked base-60, and 12 is a divisor of 60.”
“No, actually, that came from the civilization that used latin. Previously there were 10.”
“what”
“yeah the Latin guys added two months part of the way through their rule, adding two more months. That’s why some are named after the wrong numbers”
“you just said two things I am having trouble understanding. 1. Your months are named, not numbered? 2. THE NAMES ARE WRONG?”
“yep! Our 9th month is named after the number 7, and so on for 10, 11, and 12.”
“your 12th month is named… 10?”
“yeah.”
“what are the other ones named after?!”
“various things. Mainly Gods or rulers”
“oh, from that same religion that your epoch is from?”
“uh… No. Different one.”
“so you have an epoch based on one religion, but name your months based on a different one?”
“yeah! Just wait until you hear about days of the week.”
“WHAT”
“so yeah we group days into 7-day periods-”
“which aren’t an even divisor of your months lengths or year lengths?”
“right. Don’t interrupt”
“sorry”
“but we name the days of the week, rather than numbering them. Funny story with that, actually: there’s disagreement about which day starts the week.”
“you have a period that repeats every 7 days and you don’t agree when it starts?”
“yeah, it’s Monday or Sunday.”
“and those names come from…”
“celestial bodies and gods! The sun and moon are Sunday and Monday, for example”
“but… I looked at your planet’s orbit parameters. Doesn’t the sun come up every day?”
“yeah.”
“oh, do you have one of those odd orbits where your natural satellite is closer or eclipsed every 7 days, like Quagnar 4?”
“no, the sun and moon are the same then as every other day, we just had to name them something.”
“and the other days, those are named after gods?”
“yep!”
“from your largest religion, I imagine?”
“nah. That one (and the second largest, actually) only has one god, and he doesn’t really have a name.”
“huh. So what religion are they from? The Latin one again?”
“nah, they only named one of the God-days”
“only on… SO THE OTHER DAYS ARE FROM A DIFFERENT RELIGON ENTIRELY?”
“Yep!”
“the third or forth biggest, I assume?”
“nah, it’s one that… Kinda doesn’t exist anymore? It mostly died out like 800 years ago, though there are some modern small revivals, of course”
“so, let me get confirm I am understanding this correctly. Your days and hours and seconds and smaller are numbered, in a repeating pattern. But your years are numbered based on a religious epoch, despite it being only one religion amongst several.”
“correct so far”
“and your months and days of the week are instead named, although some are named after numbers, and it’s the wrong numbers”
“exactly”
“and the ones that aren’t numbers or rulers or celestial objects are named after gods, right?”
“yup!”
“but the months and the days of the week are named after gods from different religons from the epoch religion, and indeed, each other?”
“yeah! Except Saturday. That’s the same religion as the month religion”
“and the month/Saturday religion is also from the same culture who gave you the 12 months system, and the names for the two halves of the day, which are also named?”
“right! Well, kinda.”
“please explain, slowly and carefully”
“yeah so cultures before then had a 12 month system, because of the moon. But they had been using a 10 month system, before switching to 12 and giving them the modern names”
“the… Moon? Your celestial body?”
“yeah, it completes an orbit about every 27 days, so which is about 12 times a year, so it is only natural to divide the year into 12 periods, which eventually got called months”
“ok, that makes sense. Wait, no. Your orbital period is approximately 365.25 days, right?”
“yeah. That’s why we do 365 or 366 based on the formula”
“but that doesn’t work. 365 divided by 27 is ~13.5, not 12”
“yeah I’m not sure why 12 was so common then. Maybe it goes back to the base 60 people?”
“okay so one final check before I file this report: Years are numbered based on a religious leader. Years always have 12 months, but the lengths of those months is not consistent between each other or between years.”
“don’t forget the epoch we number our years from is wrong!”
“right, yes. And your months are named, some after a different religion, and some after numbers, but not the number the month is in the year.”
“right. And when we change the month lengths, it’s the second one we change”
“how could I forget? After months you have a repeating ‘week’ of 7 days, which is named after gods from two religons, one of which is the month-naming one, and a nearly extinct one. And you don’t agree when the week starts.”
“nope! My money is on Monday.”
“that’s the Monday that’s named after your moon, which supposedly influenced the commonality of the 12 months in a year cycle, despite it orbiting 13 times in a year?”
“correct!”
“and as for your days, they split into two halves, named after a phrase you don’t really understand in the long dead language of the same culture that named the months and Saturday.”
“Yep. I took some in college but all I remember is like, ‘boy’, ‘girl’, ‘stinky’, ‘cocksucker’”
“charming. And then each half is divided into 12 hours, but you start at 12, then go to 1, and up to 11”
“all I can say is that it makes more sense on analog clocks.”
“i don’t know what that is and at this point I would prefer you not elaborate. So each of those hours is divided into 60 minutes and then 60 seconds, and this comes from an ancient civilization, but not the one that gave you the month names”
“yep. Different guys. Different part of the world.”
“ok. And then after seconds, you switch to a ‘base-10’ system, but you only really use multiples of a thousand? Milliseconds and microseconds?”
“right. And there’s smaller ones beyond that, but they all use thousands”
“right. Got it. All written down here. Now if you’ll excuse me, I just gotta go make sure I didn’t leave my interociter on, I’ll be right back.”
The tall alien walks back into their saucer without a wave. The landing ramp closes.
The ship gently lifts off as gangly landing legs retract. There’s a beat, then a sudden whooshing sound as air rushes back into the space that previously held the craft, now suddenly vacuum.
NORAD alarms go off briefly as an object is detected leaving the earth’s atmosphere at a significant fraction of the speed of light.
In the years to come, many technological advances are made from what was left behind, a small tablet shaped object made of some kind of artifical stone/neutrino composite material.
The alien message left on screen is eventually translated to read “Untitled Document 1 has not been saved, are you sure you wish to quit? (yes) (no) (cancel)”
Many years have passed, and we await the day the aliens return. They have not.
With our new advancements, we build space-radar systems and can see the many species flying around the galaxy. It’s not long before we realize they’re intentionally giving earth a wide berth.
Drone ships criss-cross the galaxy, but when they get within a lightyear of earth they detour around it.
We finally get a subspace radio working, and start working to decode the noisy traffic of a thousand civilizations talking to each other. We broadcast a message of greetings and peace
Less than a week later, the subspace net goes quiet. Our space radar reports the solar system is now surrounded by small vessels, suspected to be some kind of automated probe, and they’re blocking all radio traffic in or out. Even the pulsars go quiet, all radio waves are gone.
We focus on cracking the secret of FTL travel. The first prototype never makes it off the ground, as before the rocket can even ignite, it’s crushed by a small meteor
Forensic reconstruction suggests it was a sundial, carved from rock dug out of the far side of the moon.
Anyway if anyone wants to, like, draw or animate this or film this (or something inspired by it)? That’d be sweet, you don’t need permission from me, go ahead. I’d do it but I don’t have the time or skills. Just put like “based on a story by Foone” somewhere in the credits.
It’s always weird saying that because it kinda sounds like I’m implying I think this is like A MOVIE SCRIPT THAT’S GOING TO HOLLYWOOD! or something. I don’t, I just want to make sure everyone knows it’s free to adapt and remix and all that.
It amused me to type, I hope it amused you to read, and if it amuses you to make something based on it, go right ahead. I’d love to see it.
This (beautifully formatted and well-paced-and-delivered and surprisingly sparsely attended) talk by Gabriel Lebec on the fundamentals of Lambda Calculus is one of my favorite talks ever.
As Lebec explains, the lovely bird names come from this book called “To Mock a Mockingbird” by mathematician and logician Raymond Smullyan. The naming is simply delightful. As Matthew Gilliard explains:
The premise is that there are enchanted forests which contain many (or sometimes very few) talking birds. Smullyan dedicated the book to Haskell Curry - an early pioneer in combinatory logic and an avid bird-watcher. The birds, which I suppose represent the combinators, have an interesting characteristic:
Given any two birds A and B, if you call out the name of B to A it will respond by calling out the name of some bird to you.This bird whose name A calls when you call B is denoted as AB. Once you have several birds in place, a single call can cascade around the forest with each call following rules depending on who produces it.
The very first bird we are introduced to is the Mockingbird whose characteristic behaviour is that whatever name you call to the Mockingbird, it will reply as if it is the bird whose name you called. This is denoted:
Mx = xx
For any bird
x
we can say thatMx
(the result of callingx
to a Mockingbird) is the same asxx
(the result of callingx
to a bird of typex
). It really does mock other birds! And what’s more, the existence of the Mockingbird, in combination with various others, unlocks some really fascinating group behaviour from these birds.
And!
Soon we discover that birds have certain properties: The can be fond of other birds, they can be egocentric if they are fond of themselves. The can be hopelessly egocentric if they only ever talk about themselves. There are happy birds, normal birds, agreeable birds and many others. We also meet other types of birds with specific properties - the Lark, the Kestrel, Sage birds, Bluebirds, aristocratic birds, Eagles, the list goes on and on. Luckily there is a Who’s Who list of birds in the back to keep track.
Excellent stuff, particularly the mechanical keyboard envy1. There’s a Nikhil in it too! 💁♂️
I don’t think I’ll get into them. Got myself one of these (brown switches) about three years ago after outsourcing the research to a highly enthusiastic and helpful co-worker. The “L” key sticks sometimes but zero complaints so far, even after spilling beer on it once 😬 ↩︎
The key takeaways in no particular order.
<noscript>
. If you are using it, use it a lot more.I’m omitting CDN uptime (can’t do anything about this) and Browser compatibility (supporting 5+ year-old browsers is not something I care about doing given the work I do.)
Finally, not every fucking thing needs to be an App. For instance, your Terms of Service page can actually be a document on the Internet 😱
And not just the ones you install. I know of situations where a Chrome plugin was mandated by Corporate IT security (not my current employer.) ↩︎
The point is, some products are sold directly to the end user, and are forced to prioritize usability. Other products are sold to an intermediary whose concerns are typically different from the user’s needs. Such products don’t HAVE to end up as unusable garbage, but usually do.
Jira and Confluence, which I use at work, come to mind as formerly amazing products which have gone down the shitter with unnecessary Enterprise™ feature-bloat over the past few years. I wonder if there’s a way out of this mire (maybe start saying “No”?) Until then, #jobsecurity I guess.
My university just announced that it’s dumping Blackboard, and there was much rejoicing. Why is Blackboard universally reviled? There’s a standard story of why “enterprise software” sucks. If you’ll bear with me, I think this is best appreciated by talking about… baby clothes!
There are two types of baby outfits. The first is targeted at people buying gifts. It’s irresistible on the rack. It has no fewer than 18 buttons. At least 3 people are needed to get a screaming baby into it. It’s worn once, so you can send a photo to the gifter, then discarded.
Other baby outfits are meant for parents. They’re marked “Easy On, Easy Off” or some such, and they really mean it. Zippers aren’t easy enough so they fasten using MAGNETS. A busy parent (i.e. a parent) can change an outfit in 5 seconds, one handed, before rushing to work.
The point is, some products are sold directly to the end user, and are forced to prioritize usability. Other products are sold to an intermediary whose concerns are typically different from the user’s needs. Such products don’t HAVE to end up as unusable garbage, but usually do.
OK, back to Blackboard! It’s actually designed to look extremely attractive to the administrators (not professors and definitely not students) who make purchase decisions. Since they can’t easily test usability, they instead make comparisons based on… checklists of features. 🤦🏽♂️
And that’s exactly what’s wrong with Blackboard. It has every feature ever dreamed up. But like anything designed by a committee, the interface is incoherent and any task requires at least fifteen clicks (and that’s if you even remember the correct sequence the first time).
Software companies can be breathtakingly clueless when there’s a layer of indirection between them and their users. Everyone who’s suffered through Blackboard will have the same reaction to this: try having less functionality! edscoop.com/how-canvas-cam…
The grumbling about Blackboard has finally gotten loud enough that schools are paying a modicum of attention to usability when evaluating alternatives. Blackboard’s market share has dropped dramatically and this will probably continue. Good.
Here’s the kicker, though. It’s extremely likely that whichever vendor emerges on top will fall into the same trap. The incentives almost guarantee it. Once profs and students put down the pitchforks, committees will go back to their checklists, and feature creep will resume.
Blackboard is 20 years old. If Twitter is around in 20 years, let’s see how this prediction holds up. And now I have to go rescue a three-month old from an extremely cute and equally uncomfortable outfit.
Lovely stuff. Cached here.
>>> n = 0
>>> print "%d item%s" % (n, "s"[n==1:])
0 items
>>> n = 1
>>> print "%d item%s" % (n, "s"[n==1:])
1 item
>>> n = 2
>>> print "%d item%s" % (n, "s"[n==1:])
2 items
# If you might want to print negative items, add abs to the test:
>>> n = -1
>>> print "%d item%s" % (n, "s"[abs(n)==1:])
2 items
# If a word has irregular plural morphology, use a list:
>>> n=1
>>> print "%d %s" % (n, ['abacus','abaci'][n!=1])
1 abacus
>>> n=2
>>> print "%d %s" % (n, ['abacus','abaci'][n!=1])
2 abaci
LaTeX, pdfTeX, XeTeX, LuaTeX and ConTeXt. That’s a lot of TeX! This was most helpful, even though MacTeX solves all my problems.
A still-very-relevant 9-year old article. Pandas has gone from strength to strength since he wrote that.
In terms of expressing your computations, Hadoop is strictly inferior to SQL. There is no computation you can write in Hadoop which you cannot write more easily in either SQL, or with a simple Python script that scans your files.
SQL is a straightforward query language with minimal leakage of abstractions, commonly used by business analysts as well as programmers. Queries in SQL are generally pretty simple. They are also usually very fast - if your database is properly indexed, multi-second queries will be uncommon.
Hadoop does not have any conception of indexing. Hadoop has only full table scans. Hadoop is full of leaky abstractions - at my last job I spent more time fighting with java memory errors, file fragmentation and cluster contention than I spent actually worrying about the mostly straightforward analysis I wanted to perform.
If your data is not structured like a SQL table (e.g., plain text, json blobs, binary blobs), it’s generally speaking straightforward to write a small python or ruby script to process each row of your data. Store it in files, process each file, and move on. Under circumstances where SQL is a poor fit, Hadoop will be less annoying from a programming perspective. But it still provides no advantage over simply writing a Python script to read your data, process it, and dump it to disk.
In addition to being more difficult to code for, Hadoop will also nearly always be slower than the simpler alternatives. SQL queries can be made very fast by the judicious use of indexes - to compute a join, PostgreSQL will simply look at an index (if present) and look up the exact key that is needed. Hadoop requires a full table scan, followed by re-sorting the entire table. The sorting can be made faster by sharding across multiple machines, but on the other hand you are still required to stream data across multiple machines. In the case of processing binary blobs, Hadoop will require repeated trips to the namenode in order to find and process data. A simple python script will require repeated trips to the filesystem.
From over 10 years ago (I’m sorting through my old bookmarks). A single object looks like this:
{
"ACCTOUNT_NUMBER":"1234567890",
"CUSTOMER_NAME":"ACME Products and Services, Inc.",
"ADDRESS":"123 Main Street",
"CITY":"Albuquerque",
"STATE":"NM",
"ZIP":"87101-1234"
}
He tested the usability of a given browser while it loaded between 1 and 1,000,000 such records.
From this test, I am considering the sweet spot to be around 10,000 records at (1.55MB). The maximum number of usable records I would push to a browser would be around 25,000 records (3.87MB). Keep in mind there are numerous factors to keep in mind when determining how many records you should return to your JavaScript application. The purpose of this test was to help identify a general maximum number for conversations around large record sets with JSON.
Would love to see an updated version of the tests.
Estimate | Actual Time |
---|---|
Very Easy | 1 Hour |
Easy | 2 Hours |
Quite Easy | 4 Hours |
Looks Quite Easy | 6 Hours |
Average | 8 Hours |
Looks Average | 12 Hours |
No Clue | 16 Hours |
Seems Complex | 24 Hours |
Complex | 30 Hours |
Very Complex | 40 Hours |
Can Take Some Time | 48 Hours |
Fuck | 60 Hours |
Yeah Looks Pretty Easy | 80 Hours |
Combine: “No Clue. Can take some time, but yeah… looks pretty easy” = 16 + 48 + 80 = 144 hours.
Source Unknown. See also: “Midwest Distances”
I loved how the author imagined persistence 💗
me, a software engineer: large scale production systems are complex and require teams of experts to keep running. It’s near impossible to get right 100% of the time
me, when an app I use goes down once: these fucking clowns, what the fuck
Uber in 2016: “We have thousands of microservices.”
Everyone: “That sounds insane."Uber in 2020: “It turns out that was insane.”
With the trailing comma and sorted properties/imports/arguments/whatever. Makes symbols easy to scan from top-to-bottom and looks like this in Python:
from constants import (
EXIT_CODE_ARTICLE_ROOT_NOT_FOUND,
EXIT_CODE_NOT_A_GIT_REPOSITORY,
EXIT_CODE_NOT_AN_ABSOLUTE_PATH,
MARKDOWN_EXTENSION_CONFIG,
MARKDOWN_EXTENSIONS,
MARKDOWN_FILE_EXTENSION,
MAX_NUMBER_OF_WORKERS,
PATHS_TO_REMOVE,
)
In which universe are these shittier alternatives considered readable or maintainable?
from constants import (MAX_CHARS_IN_SEARCH_RESULTS,
MAX_CHARS_SURROUNDING_SEARCH_HIGHLIGHT,
MAX_SEARCH_RESULTS, MIN_CHARS_IN_SEARCH_TERM,
SEARCH_INDEX_PATH)
or
from constants import (MAX_CHARS_IN_SEARCH_RESULTS,
MAX_CHARS_SURROUNDING_SEARCH_HIGHLIGHT,
MAX_SEARCH_RESULTS,
MIN_CHARS_IN_SEARCH_TERM,
SEARCH_INDEX_PATH)
or
from constants import (
MAX_CHARS_IN_SEARCH_RESULTS, MAX_CHARS_SURROUNDING_SEARCH_HIGHLIGHT,
MAX_SEARCH_RESULTS, MIN_CHARS_IN_SEARCH_TERM, SEARCH_INDEX_PATH)
That’s for Python and the modes are from the excellent isort’s docs. I am glad that Prettier does VHI by default (although you have to specify the trailing-comma and object properties are not sorted.)
See also: K&R is the One True Indentation Style
[…] it’s not okay to block old browsers, but it’s a waste of time to support them 100%.
A handy-dandy visual guide to the <script>
tag, its various attributes, and how they relate to HTML parsing. Source unknown.
It’s very simple and clever. This is an example of what’s rendered from this giant Markdown file 💙
I love this more than I can describe.
I just met you,
And this is crazy,
But here’s my number (delegate),
So if something happens (event),
Call me, maybe (callback)?
Back in the good old days – the “Golden Era” of computers, it was easy to separate the men from the boys (sometimes called “Real Men” and “Quiche Eaters” in the literature). During this period, the Real Men were the ones that understood computer programming, and the Quiche Eaters were the ones that didn’t. A real computer programmer said things like “DO 10 I=1,10” and “ABEND” (they actually talked in capital letters, you understand), and the rest of the world said things like “computers are too complicated for me” and “I can’t relate to computers – they’re so impersonal”. (A previous work [1] points out that Real Men don’t “relate” to anything, and aren’t afraid of being impersonal.)
But, as usual, times change. We are faced today with a world in which little old ladies can get computerized microwave ovens, 12 year old kids can blow Real Men out of the water playing Asteroids and Pac-Man, and anyone can buy and even understand their very own Personal Computer. The Real Programmer is in danger of becoming extinct, of being replaced by high-school students with TRASH-80s!
There is a clear need to point out the differences between the typical high-school junior Pac-Man player and a Real Programmer. Understanding these differences will give these kids something to aspire to – a role model, a Father Figure. It will also help employers of Real Programmers to realize why it would be a mistake to replace the Real Programmers on their staff with 12 year old Pac-Man players (at a considerable salary savings).
The easiest way to tell a Real Programmer from the crowd is by the programming language he (or she) uses. Real Programmers use FORTRAN. Quiche Eaters use PASCAL. Nicklaus Wirth, the designer of PASCAL, was once asked, “How do you pronounce your name?”. He replied “You can either call me by name, pronouncing it ‘Veert’, or call me by value, ‘Worth’.” One can tell immediately from this comment that Nicklaus Wirth is a Quiche Eater. The only parameter passing mechanism endorsed by Real Programmers is call-by-value-return, as implemented in the IBM/370 FORTRAN G and H compilers. Real programmers don’t need abstract concepts to get their jobs done: they are perfectly happy with a keypunch, a FORTRAN IV compiler, and a beer.
If you can’t do it in FORTRAN, do it in assembly language. If you can’t do it in assembly language, it isn’t worth doing.
Computer science academicians have gotten into the “structured programming” rut over the past several years. They claim that programs are more easily understood if the programmer uses some special language constructs and techniques. They don’t all agree on exactly which constructs, of course, and the examples they use to show their particular point of view invariably fit on a single page of some obscure journal or another – clearly not enough of an example to convince anyone. When I got out of school, I thought I was the best programmer in the world. I could write an unbeatable tic-tac-toe program, use five different computer languages, and create 1000 line programs that WORKED. (Really!) Then I got out into the Real World. My first task in the Real World was to read and understand a 200,000 line FORTRAN program, then speed it up by a factor of two. Any Real Programmer will tell you that all the Structured Coding in the world won’t help you solve a problem like that – it takes actual talent. Some quick observations on Real Programmers and Structured Programming:
Data structures have also gotten a lot of press lately. Abstract Data Types, Structures, Pointers, Lists, and Strings have become popular in certain circles. Wirth (the above-mentioned Quiche Eater) actually wrote an entire book [2] contending that you could write a program based on data structures, instead of the other way around. As all Real Programmers know, the only useful data structure is the array. Strings, lists, structures, sets – these are all special cases of arrays and and can be treated that way just as easily without messing up your programing language with all sorts of complications. The worst thing about fancy data types is that you have to declare them, and Real Programming Languages, as we all know, have implicit typing based on the first letter of the (six character) variable name.
What kind of operating system is used by a Real Programmer? CP/M? God forbid – CP/M, after all, is basically a toy operating system. Even little old ladies and grade school students can understand and use CP/M.
Unix is a lot more complicated of course – the typical Unix hacker never can remember what the PRINT command is called this week – but when it gets right down to it, Unix is a glorified video game. People don’t do Serious Work on Unix systems: they send jokes around the world on USENET and write adventure games and research papers.
No, your Real Programmer uses OS/370. A good programmer can find and understand the description of the IJK305I error he just got in his JCL manual. A great programmer can write JCL without referring to the manual at all. A truly outstanding programmer can find bugs buried in a 6 megabyte core dump without using a hex calculator. (I have actually seen this done.)
OS/370 is a truly remarkable operating system. It’s possible to destroy days of work with a single misplaced space, so alertness in the programming staff is encouraged. The best way to approach the system is through a keypunch. Some people claim there is a Time Sharing system that runs on OS/370, but after careful study I have come to the conclusion that they are mistaken.
What kind of tools does a Real Programmer use? In theory, a Real Programmer could run his programs by keying them into the front panel of the computer. Back in the days when computers had front panels, this was actually done occasionally. Your typical Real Programmer knew the entire bootstrap loader by memory in hex, and toggled it in whenever it got destroyed by his program. (Back then, memory was memory – it didn’t go away when the power went off. Today, memory either forgets things when you don’t want it to, or remembers things long after they’re better forgotten.) Legend has it that Seymour Cray, inventor of the Cray I supercomputer and most of Control Data’s computers, actually toggled the first operating system for the CDC7600 in on the front panel from memory when it was first powered on. Seymour, needless to say, is a Real Programmer.
One of my favorite Real Programmers was a systems programmer for Texas Instruments. One day, he got a long distance call from a user whose system had crashed in the middle of some important work. Jim was able to repair the damage over the phone, getting the user to toggle in disk I/O instructions at the front panel, repairing system tables in hex, reading register contents back over the phone. The moral of this story: while a Real Programmer usually includes a keypunch and lineprinter in his toolkit, he can get along with just a front panel and a telephone in emergencies.
In some companies, text editing no longer consists of ten engineers standing in line to use an 029 keypunch. In fact, the building I work in doesn’t contain a single keypunch. The Real Programmer in this situation has to do his work with a text editor program. Most systems supply several text editors to select from, and the Real Programmer must be careful to pick one that reflects his personal style. Many people believe that the best text editors in the world were written at Xerox Palo Alto Research Center for use on their Alto and Dorado computers [3]. Unfortunately, no Real Programmer would ever use a computer whose operating system is called SmallTalk, and would certainly not talk to the computer with a mouse.
Some of the concepts in these Xerox editors have been incorporated into editors running on more reasonably named operating systems. EMACS and VI are probably the most well known of this class of editors. The problem with these editors is that Real Programmers consider “what you see is what you get” to be just as bad a concept in text editors as it is in women. No, the Real Programmer wants a “you asked for it, you got it” text editor – complicated, cryptic, powerful, unforgiving, dangerous. TECO, to be precise.
It has been observed that a TECO command sequence more closely resembles transmission line noise than readable text [4]. One of the more entertaining games to play with TECO is to type your name in as a command line and try to guess what it does. Just about any possible typing error while talking with TECO will probably destroy your program, or even worse – introduce subtle and mysterious bugs in a once working subroutine.
For this reason, Real Programmers are reluctant to actually edit a program that is close to working. They find it much easier to just patch the binary object code directly, using a wonderful program called SUPERZAP (or its equivalent on non-IBM machines). This works so well that many working programs on IBM systems bear no relation to the original FORTRAN code. In many cases, the original source code is no longer available. When it comes time to fix a program like this, no manager would even think of sending anything less than a Real Programmer to do the job – no Quiche Eating structured programmer would even know where to start. This is called “job security”.
Some programming tools NOT used by Real Programmers:
Where does the typical Real Programmer work? What kind of programs are worthy of the efforts of so talented an individual? You can be sure that no real Programmer would be caught dead writing accounts-receivable programs in COBOL, or sorting mailing lists for People magazine. A Real Programmer wants tasks of earth-shaking importance (literally!):
Some of the most awesome Real Programmers of all work at the Jet Propulsion Laboratory in California. Many of them know the entire operating system of the Pioneer and Voyager spacecraft by heart. With a combination of large ground-based FORTRAN programs and small spacecraft-based assembly language programs, they can to do incredible feats of navigation and improvisation, such as hitting ten-kilometer wide windows at Saturn after six years in space, and repairing or bypassing damaged sensor platforms, radios, and batteries. Allegedly, one Real Programmer managed to tuck a pattern-matching program into a few hundred bytes of unused memory in a Voyager spacecraft that searched for, located, and photographed a new moon of Jupiter.
One plan for the upcoming Galileo spacecraft mission is to use a gravity assist trajectory past Mars on the way to Jupiter. This trajectory passes within 80 +/- 3 kilometers of the surface of Mars. Nobody is going to trust a PASCAL program (or PASCAL programmer) for navigation to these tolerances.
As you can tell, many of the world’s Real Programmers work for the U.S. Government, mainly the Defense Department. This is as it should be. Recently, however, a black cloud has formed on the Real Programmer horizon.
It seems that some highly placed Quiche Eaters at the Defense Department decided that all Defense programs should be written in some grand unified language called “ADA” (registered trademark, DoD). For a while, it seemed that ADA was destined to become a language that went against all the precepts of Real Programming – a language with structure, a language with data types, strong typing, and semicolons. In short, a language designed to cripple the creativity of the typical Real Programmer. Fortunately, the language adopted by DoD has enough interesting features to make it approachable: it’s incredibly complex, includes methods for messing with the operating system and rearranging memory, and Edsgar Dijkstra doesn’t like it [6]. (Dijkstra, as I’m sure you know, was the author of “GoTos Considered Harmful” – a landmark work in programming methodology, applauded by Pascal Programmers and Quiche Eaters alike.) Besides, the determined Real Programmer can write FORTRAN programs in any language.
The real programmer might compromise his principles and work on something slightly more trivial than the destruction of life as we know it, providing there’s enough money in it. There are several Real Programmers building video games at Atari, for example. (But not playing them. A Real Programmer knows how to beat the machine every time: no challange in that.) Everyone working at LucasFilm is a Real Programmer. (It would be crazy to turn down the money of 50 million Star Wars fans.) The proportion of Real Programmers in Computer Graphics is somewhat lower than the norm, mostly because nobody has found a use for Computer Graphics yet. On the other hand, all Computer Graphics is done in FORTRAN, so there are a fair number people doing Graphics in order to avoid having to write COBOL programs.
Generally, the Real Programmer plays the same way he works – with computers. He is constantly amazed that his employer actually pays him to do what he would be doing for fun anyway, although he is careful not to express this opinion out loud. Occasionally, the Real Programmer does step out of the office for a breath of fresh air and a beer or two. Some tips on recognizing real programmers away from the computer room:
What sort of environment does the Real Programmer function best in? This is an important question for the managers of Real Programmers. Considering the amount of money it costs to keep one on the staff, it’s best to put him (or her) in an environment where he can get his work done.
The typical Real Programmer lives in front of a computer terminal. Surrounding this terminal are:
The Real Programmer is capable of working 30, 40, even 50 hours at a stretch, under intense pressure. In fact, he prefers it that way. Bad response time doesn’t bother the Real Programmer – it gives him a chance to catch a little sleep between compiles. If there is not enough schedule pressure on the Real Programmer, he tends to make things more challenging by working on some small but interesting part of the problem for the first nine weeks, then finishing the rest in the last week, in two or three 50-hour marathons. This not only inpresses his manager, who was despairing of ever getting the project done on time, but creates a convenient excuse for not doing the documentation. In general:
What of the future? It is a matter of some concern to Real Programmers that the latest generation of computer programmers are not being brought up with the same outlook on life as their elders. Many of them have never seen a computer with a front panel. Hardly anyone graduating from school these days can do hex arithmetic without a calculator. College graduates these days are soft – protected from the realities of programming by source level debuggers, text editors that count parentheses, and user friendly operating systems. Worst of all, some of these alleged computer scientists manage to get degrees without ever learning FORTRAN! Are we destined to become an industry of Unix hackers and Pascal programmers?
On the contrary. From my experience, I can only report that the future is bright for Real Programmers everywhere. Neither OS/370 nor FORTRAN show any signs of dying out, despite all the efforts of Pascal programmers the world over. Even more subtle tricks, like adding structured coding constructs to FORTRAN have failed. Oh sure, some computer vendors have come out with FORTRAN 77 compilers, but every one of them has a way of converting itself back into a FORTRAN 66 compiler at the drop of an option card – to compile DO loops like God meant them to be.
Even Unix might not be as bad on Real Programmers as it once was. The latest release of Unix has the potential of an operating system worthy of any Real Programmer. It has two different and subtly incompatible user interfaces, an arcane and complicated terminal driver, virtual memory. If you ignore the fact that it’s structured, even C programming can be appreciated by the Real Programmer: after all, there’s no type checking, variable names are seven (ten? eight?) characters long, and the added bonus of the Pointer data type is thrown in. It’s like having the best parts of FORTRAN and assembly language in one place. (Not to mention some of the more creative uses for #define.)
No, the future isn’t all that bad. Why, in the past few years, the popular press has even commented on the bright new crop of computer nerds and hackers ([7] and [8]) leaving places like Stanford and M.I.T. for the Real World. From all evidence, the spirit of Real Programming lives on in these young men and women. As long as there are ill-defined goals, bizarre bugs, and unrealistic schedules, there will be Real Programmers willing to jump in and Solve The Problem, saving the documentation for later. Long live FORTRAN!
I would like to thank Jan E., Dave S., Rich G., Rich E. for their help in characterizing the Real Programmer, Heather B. for the illustration, Kathy E. for putting up with it, and atd!avsdS:mark for the initial inspriration.
The argument here being that, since the ‘general form’ of the conjecture is undecidable, TypeScript’s type system is undecidable. How does one even think of doing these things?
I love Typescript, but it isn’t nearly ambitious enough. It would be vastly improved with an
--extremelyStrict
flag enforcing that your Typescript code is free of side-effects; that is – no Javascript code is generated at all. Real programmers do all of their computation within the type system. Otherwise, they can’t be sure their program will work in production and should be duly fired.
Mad Lad. Via HN. (Cached)
About as ‘essential’ as it gets if you want to appreciate a tool you work with every day. (Cached)
“Every program attempts to expand until it can read mail. Those programs which cannot so expand are replaced by ones which can.” Coined by Jamie Zawinski (who called it the “Law of Software Envelopment”) to express his belief that all truly useful programs experience pressure to evolve into toolkits and application platforms (the mailer thing, he says, is just a side effect of that). It is commonly cited, though with widely varying degrees of accuracy.
Here’s a fairly recent (Dec 2018) interview with the creators of chrome://dino
. It was called Project Bolan (which I had to look up), had 270M games played every month1, with most users coming “from markets with unreliable or expensive mobile data, like India, Brazil, Mexico, or Indonesia” and took quite a bit of development to work on all platforms.
We built it to max out at approximately 17 million years, the same amount of time that the T-rex was alive on Earth… but we feel like your spacebar may not be the same afterwards.
I suppose they know this thanks to the “I agree to everything” button one clicks while installing Chrome… ↩︎
Nexe and pkg are two compilers that create self-contained executables out of your Node scripts.
Deno introduced this in a recent release, which got me looking for Node-based alternatives.
Dylan Beattie is my new favorite nerd on YouTube.
This is a new personal record. Will go six months the next time 🎸
The Scunthorpe problem (or the Clbuttic Mistake) is the unintentional blocking of websites, e-mails, forum posts or search results by a spam filter or search engine because their text contains a string of letters that appear to have an obscene or otherwise unacceptable meaning.
Examples would be: shitake mushrooms, Herman I. Libshitz, magna cum laude, Arun Dikshit.
I’m not a great developer, I’m just really good at finding the magic one-liner fix on the 14th page on a repo’s GitHub Issues
a GraphQL server is just a SOAP API that’s studied abroad
From a presentation by Jeff Dean. What about when technology evolves? Here’s a handy visualization. And here’s a way to think about these numbers. Nathan Hurst visualized the distances on Google Maps1.
Operation | Time (ns) | Light Distance (m) | Approximate Light Distance |
---|---|---|---|
L1 cache reference | 0.5 | 0.15 | Diagonal across your smartphone |
Branch mispredict | 5 | 1.5 | Height of Natalie Portman |
L2 cache reference | 7 | 2.1 | Height of Shaq |
Mutex lock/unlock | 25 | 7.5 | Height of a school flag pole |
Main memory reference | 100 | 30 | Half a Manhattan city block (North/South) |
Compress 1K bytes with Zippy | 3,000 | 900 | Width of Central Park |
Send 1K bytes over 1 Gbps network | 10,000 | 3,000 | Width of Manhattan |
Read 4K randomly from SSD* | 150,000 | 45,000 | NYC to Hempstead on Long Island |
Read 1 MB sequentially from memory | 250,000 | 75,000 | NYC to Princeton/Trenton, NJ |
Round trip within same datacenter | 500,000 | 150,000 | NYC to Scranton, PA |
Read 1 MB sequentially from SSD* | 1,000,000 | 300,000 | NYC to Boston, MA |
Disk seek | 10,000,000 | 3,000,000 | NYC to Austin, TX |
Read 1 MB sequentially from disk | 20,000,000 | 6,000,000 | NYC to Paris, France (also the diameter of the Earth) |
Send packet CA → Netherlands → CA | 150,000,000 | 45,000,000 | Once around the equator |
Here’s how the author made that list. Here’s a cached version.
Well… not really. Maybe. Brian Will examines the history of the OOP way of thinking and it’s over-application as a panacea to every problem domain, particularly in The Enterprise™
Dear web developers, The answer is zero. Zero. Get it through your thick skulls. Zero is the number of times anyone has EVER wanted something to autoplay on your site and start making noise. I’d honestly rather you mine crypto-currency in my browser than use my speakers. #kthxbye
Learn C and build a basic Lisp #VALUE 😍
One should be good 80%+ of time between that and the awesome pgcli
.
Woo! Covers the biggest reason why I use jq
(grep for fields) which, as the gron
author notes, is more general-purpose and takes a little more effort to understand and use.
Here’s a community-maintained "List of Dirty, Naughty, Obscene, and Otherwise Bad Words" across various languages on Github. I was curious about a naïve frequency distribution of consonants across the English-language corpus (NSFW, obviously) and wrote a small script. Here are the results:
Letter | Count |
---|---|
t | 211 |
s | 208 |
n | 193 |
r | 186 |
l | 167 |
g | 147 |
c | 124 |
b | 121 |
p | 116 |
h | 97 |
d | 91 |
m | 91 |
k | 72 |
y | 70 |
f | 48 |
w | 41 |
v | 29 |
j | 21 |
x | 19 |
z | 7 |
q | 5 |
Not sure what I’m going to do with this information but here it is. 🤬
On why GNU grep
is fast. Via HN.
Headed over to “Wisdom of Chopra” to get myself a slice of Deepak’s #cosmiconscious insight.
Took that and had GPT-2 use it as a seed for more wisdom. Behold:
The invisible is the foundation of total belongingness: When we feel like we belong and are at home, we are happy, healthy and in good spirits. Without our sense of belonging, we feel anxious, sad, depressed, disengaged, and negative.
In the struggle to locate our identity, we can limit our awareness of who we are. We become prisoners of our own identities, which is usually the result of trying to fulfill our parents’ or society’s expectations of us.
It takes wisdom and intelligence to become an invisible expert, and this is not only to create a safe space for self-knowledge, but also to create safe spaces for others to be able to be themselves.
Imagine all the different spiritual and emotional benefits when we do not see or know about another’s stories, feelings, anxieties or challenges.
Imagine how freeing it would be for a Buddhist monk or a leader to have all their body, thoughts and speech remain invisible to everyone, including themselves.
How liberating would it be to know your gifts and be free from the burden of being in constant search of knowledge or validation, simply knowing that you are a gift to yourself and the world, and you matter to you.
As the Torah tells us: “You have been born for such a time as this” (Ecclesiastes 3:11). We have been given the gift of life to explore our true identities, free of expectations and limitations, to finally reach out into the unknown to create the power and joy of the divine within.
In a world that seems to be in constant change and evolution, it is easy to feel alone and afraid. Yet we are never alone, and it is always safe to be true to ourselves.
There is power in transforming into the master of our own universe. In the words of the Buddha: “The job of a bodhisattva is not to be a creator, but to create a creator.”
In the depths of our souls, the divine resonates with us, nudging us to release our inner monologue of fear and the unconscious power it holds over us. Each and every one of us has within us the potential to embody divine love and compassion for ourselves and all of creation, and in the embodiment of this divine potential, we ignite our own personal power.
Gather the courage to become the master of our own universe and to discover the true magic that dwells within.
Aum Shanti 🙏
and Advanced Custom Fields Pro are two must-have plugins for advanced Wordpressing according to my friend Mike, a seasoned Wordpresser.
The software industry is currently going through the “disposable plastic” crisis the physical world went through in the mid-20th century (and is still paying down the debt for). You can run software from 1980 or 2005 on a modern desktop without too much hassle, but anything between there and 2-3 years ago? Black hole of fad frameworks and brittle dependencies. Computer Archaeology is going to become a full-time job.
– Source
See also: “Creating a QR Code step by step”
On the developer side, what I hope people are doing is trying to make, not just good code, but these days we’ve been very good about having explanations for the code. So commit messages to me are almost as important as the code change itself. Sometimes the code change is so obvious that no message is really required, but that is very very rare. And so one of the things I hope developers are thinking about, the people who are actually writing code, is not just the code itself, but explaining why the code does something, and why some change was needed. Because that then in turn helps the managerial side of the equation, where if you can explain your code to me, I will trust the code.
A lot of open source in general is about communication. And part of it is the commit messages, part of it is just the email going back and forth. Communicating what you’re trying to do or communicating why something doesn’t work for you is really important.
– Linus Torvalds, in conversation with Dirk Hohndel (emphasis mine)
This is pretty much what mine look like. For my personal stuff, I get so lazy, I use a list of developer excuses to generate a commit log that looks like this 🤦♀️
I hereby swear to read this document and make writing good commit messages a habit ✋🚀
Being a satirical take on the state of enterprise software development, and authored by smart people who presumably like to watch the world burn. The issues are highly entertaining as well.
Started with this blog post about why one would need a monad (from a typing standpoint.) Then watched “What the 𝒇 is a Monad” which made a lot of things clear. Then watched this excellent, excellent talk on Lambda Calculus (with JS and Haskell code!) by Gabriel Lebec.
Finished with a quick practical, toy example by @mpjme and this Scala horror-show (to me.)
I’ve usually heard this phenomenon called “incidental duplication”, and it’s something I find myself teaching junior engineers about quite often.
There are a lot of situations where 3-5 lines of many methods follow basically the same pattern, and it can be aggravating to look at. “Don’t repeat yourself!” Right?
So you try to extract that boilerplate into a method, and it’s fine until the very next change. Then you need to start passing options and configuration into your helper method… and before long your helper method is extremely difficult to reason about, because it’s actually handling a dozen cases that are superficially similar but full of important differences in the details.
I encourage my devs to follow a rule of thumb: don’t extract repetitive code right away, try and build the feature you’re working on with the duplication in place first. Let the code go through a few evolutions and waves of change. Then one of two things are likely to happen:
- you find that the code doesn’t look so repetitive anymore, or,
- you hit a bug where you needed to make the same change to the boilerplate in six places and you missed one.
In scenario 1, you can sigh and say “yeah it turned out to be incidental duplication, it’s not bothering me anymore.” In scenario 2, it’s probably time for a careful refactoring to pull out the bits that have proven to be identical (and, importantly, must be identical across all of the instances of the code).
Whatever. I say we continue to abstract away and make better and better hammer factories and beam at our sophistication in creating unnecessary complexity #jobsecurity
Dependencies (coupling) is an important concern to address, but it’s only 1 of 4 criteria that I consider and it’s not the most important one. I try to optimize my code around reducing state, coupling, complexity and code, in that order.
I’m willing to add increased coupling if it makes my code more stateless.
I’m willing to make it more complex if it reduces coupling.
And I’m willing to duplicate code if it makes the code less complex.
Only if it doesn’t increase state, coupling or complexity do I dedup code.
The reason I put stateless code as the highest priority is it’s the easiest to reason about. Stateless logic functions the same whether run normally, in parallel or distributed. It’s the easiest to test, since it requires very little setup code. And it’s the easiest to scale up, since you just run another copy of it. Once you introduce state, your life gets significantly harder.
I think the reason that novice programmers optimize around code reduction is that it’s the easiest of the 4 to spot. The other 3 are much more subtle and subjective and so will require greater experience to spot. But learning those priorities, in that order, has made me a significantly better developer.
crun1r
on HackerNews (emphases and formatting mine.)I thought using loops was cheating, so I programmed my own using samples. I then thought using samples was cheating, so I recorded real drums. I then thought that programming it was cheating, so I learned to play drums for real. I then thought using bought drums was cheating, so I learned to make my own. I then thought using premade skins was cheating, so I killed a goat and skinned it. I then thought that that was cheating too, so I grew my own goat from a baby goat. I also think that is cheating, but I’m not sure where to go from here. I haven’t made any music lately, what with the goat farming and all.
I’ve made this mistake all too often, especially when trying to learn something new.
Things that quote kinda reminds me of:
Was looking try something other than my beloved Operator Mono and came across Dank Mono which claims to be a “rather special coding font.” I love it. Looks like the cooler twin of Inconsolata. I remain quite tickled by how many of my co-workers find the italic variants of monospaced fonts ‘disturbing’ when they look at my screen.
Linus Torvalds on git
I’d also like to point out that unlike every single horror I’ve ever witnessed when looking closer at SCM products, git actually has a simple design, with stable and reasonably well-documented data structures. In fact, I’m a huge proponent of designing your code around the data, rather than the other way around, and I think it’s one of the reasons git has been fairly successful
[. . .]
I will, in fact, claim that the difference between a bad programmer and a good one is whether he considers his code or his data structures more important. Bad programmers worry about the code. Good programmers worry about data structures and their relationships.
When I was little — and by the way, I was little once — my father told me a story about an 18th century watchmaker. And what this guy had done: he used to produce these fabulously beautiful watches.
And one day, one of his customers came into his workshop and asked him to clean the watch that he’d bought. And the guy took it apart, and one of the things he pulled out was one of the balance wheels. And as he did so, his customer noticed that on the back side of the balance wheel was an engraving, were words.
And he said to the guy, “Why have you put stuff on the back that no one will ever see?” And the watchmaker turned around and said, “God can see it.”
Now I’m not in the least bit religious, neither was my father, but at that point, I noticed something happening here. I felt something in this plexus of blood vessels and nerves, and there must be some muscles in there as well somewhere, I guess. But I felt something. And it was a physiological response. And from that point on, from my age at the time, I began to think of things in a different way. And as I took on my career as a designer, I began to ask myself the simple question: Do we actually think beauty, or do we feel it?
I want it to be as beautiful as possible, even if it’s inside the box. A great carpenter isn’t going to use lousy wood for the back of a cabinet, even though nobody’s going to see it. When you’re a carpenter making a beautiful chest of drawers, you’re not going to use a piece of plywood on the back, even though it faces the wall and nobody will ever see it. You’ll know it’s there, so you’re going to use a beautiful piece of wood on the back. For you to sleep well at night, the aesthetic, the quality, has to be carried all the way through.
Do quite a bit more, good and invisible things, than required for the MVP or for the bloody “sprint.” You will then smile a lot and sleep quite well indeed. Excellence is a habit. It is yours. Nobody steals this from you.
Saved here via Stephanie Harcrow’s post.
No Code is the best way to write secure and reliable applications. Write nothing; deploy nowhere.
Start by not writing any code.
Brilliant. I love both the presence and contents of the Dockerfile
in that repo. As is always the case with such projects, the issues and pull requests are 💯
And if one is tempted to go against the tenets of No Code, there’s always my beloved fuckitpy, a (strangely well-thought-out) “Python error steamroller”1:
@fuckit
def buggy_function():
problem_solved
@fuckit
class BuggyClass(object):
def __init__(self):
everything_works_now
And:
This module is like violence: if it doesn’t work, you just need more of it.
See also: The Fuck, another Python-based utility that addresses CLI frustrations.
Michael Leggett, lead designer of Gmail from 2008-2012
“It’s like Lucky Charms got spewed all over the screen,” he says to me, as he scrolls through his inbox. It’s true. Folders, contacts, Google apps like Docs and Drive–and at least half a dozen notifications–all clutter Gmail at any given moment. And of course, there’s that massive Gmail logo that sits in the upper left-hand corner of the screen. Just in case you forgot that you just typed “gmail.com” into your browser bar three seconds ago. “Go look at any desktop app and tell me how many have a huge fucking logo in the top left,” rants Leggett. “C’mon. It’s pure ego, pure bullshit. Drop the logo. Give me a break.”
– Fast Company, “The former lead designer of Gmail just fixed Gmail on his own”
So he made this plugin for Chrome and Firefox that cuts out all the terrible visual noise of Gmail. I’m never uninstalling this one.
And while I’m on the subject, who signed off on this disaster?
Because we all know that the only way to attact attention to a UI element is to adorn it with a big blue goddamn fucking tumor.
Good talk by Siteshwar Vashisht at FOSDEM 2019 on maintaining the Korn shell and old codebases in general. I came by his work while reading up on the fish
shell. Featured this nugget
He talks about how they removed dead/inapplicable code and micro-optimizations, refactored a lot of legacy code, improved tests, switched to a new build and CI system, and so on.
Began with this baffling one-liner that won the International Obfuscated C Contest in 1987
main() { printf(&unix["\021%six\012\0"],(unix)["have"]+"fun"-0x60);}
And reminded me of this Aaron Sorkin-esque story about David Korn which I heard via BLN
Greg Sullivan, a MicroSoft product manager (henceforth MPM), was holding forth on a forthcoming product that will provide Unix style scripting and shell services on NT for compatibility and to leverage UNIX expertise that moves to the NT platform. The product suite includes the MKS (Mortise Kern Systems) windowing Korn shell, a windowing Perl, and lots of goodies like awk, sed and grep. It actually fills a nice niche for which other products (like the MKS suite) have either been too highly priced or not well enough integrated.
An older man, probably mid-50s, stands up in the back of the room and asserts that Microsoft could have done better with their choice of Korn shell. He asks if they had considered others that are more compatible with existing UNIX versions of KSH.The MPM said that the MKS shell was pretty compatible and should be able to run all UNIX scripts.
The questioner again asserted that the MKS shell was not very compatible and didn’t do a lot of things right that are defined in the KSH language spec. The MPM asserted again that the shell was pretty compatible and should work quite well.
This assertion and counter assertion went back and forth for a bit, when another fellow member of the audience announced to the MPM that the questioner was, in fact David Korn of AT&T (now Lucent) Bell Labs. (DavidKorn is the author of the KornShell).
Uproarious laughter burst forth from the audience, and it was one of the only times that I have seen a (by then pink cheeked) MPM lost for words or momentarily lacking the usual unflappable confidence. So, what’s a body to do when Microsoft reality collides with everyone else’s?
Via Rotten Tomatoes and with the awesome ChartJS. Dots are episodes, contiguous lines are seasons (static version.)
A search for episode titles on GitHub yielded this indescribably amazing, mostly hand-curated GoT Dataset by Jeffrey Lancaster (who published a Medium article describing his process. Has a Stranger Things dataset as well.)
Update: MFW watching the final episode.
Vicki Boykis’ excellent article on every aspect of ‘Data Science’ I can think of: a little history, employment prospects, skills, education, and continuous learning.
It would appear that more than half the job, at least, is wrangling (replicating, cleaning, imputing, transferring, understanding, augmenting) data. It’s boring and super-important so, of course, is the least favorite thing 🙃
Peter Norvig: (How to Write a (Lisp) Interpreter (in Python)).
See also: HyLang. Looks super cool and always makes me wonder if anyone’s ever used it in production.
Back in the second century BC, Cato the Elder ended his speeches with the phrase ‘Carthago delenda est,’ which is to say, ‘Carthage must be destroyed.’ It didn’t matter what the ostensible topic of the speech was: above all, Carthage must be destroyed.
My opinion towards JavaScript is much like Cato’s towards Carthage: it must be rooted out, eliminated and destroyed entirely. I don’t know if I’d go quite so far as to say that the fundamental challenge of mass computing is the final destruction of JavaScript — but I want to say it, even though it’s false.
JavaScript is a pox, a disaster, a shame. It is the most embarrassingly bad thing to become popular in computing since Windows 3.1. Its one virtue (that it’s on every client device) is outshone by its plethora of flaws in much the same way that a matchstick is outshone by the sun, the stars and the primordial energy of the Big Bang added together.
JavaScript is the XML, the Yugo, the Therac-25 of programming languages. The sheer amount of human effort which has been expended working around its fundamental flaws instead of advancing the development of mankind is astounding. The fact that people would take this paragon of wasted opportunity and use it on the server side, where there are so many better alternatives (to a first approximation, every other programming language ever used), is utterly appalling.
JavaScript delenda est.
I don’t know what my newfound affection for it says about me. Via HackerNews.
Via GLP, a University Title Generator that generates “prestigious” titles and associated salaries. A few random gems
OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things. It can be done in Smalltalk and in LISP. There are possibly other systems in which this is possible, but I’m not aware of them.
– Dr. Alan Kay on the Meaning of “Object-Oriented Programming”
So… Erlang? (RIP Joe Armstrong 🙏) And that was before this
(I’m not against types, but I don’t know of any type systems that aren’t a complete pain, so I still like dynamic typing.)
Indeed, Dr. Kay.
Garrett Whisten made a most amazing CVS receipt generator (cached).
He even wrote a scraper that gets real product names off their website 🙏 🙌
A pure CSS still life by Ben Evans who appears to be working on an online story with pure CSS illustrations as well. Via Deepu.
In programming, it is also common to refer to the “NIH syndrome” as the tendency towards reinventing the wheel (reimplementing something that is already available) based on the belief that in-house developments are inherently better suited, more secure, more controlled, quicker to develop, and incur lower overall cost (including maintenance cost) than using existing implementations. In-house developments are often collaborative with each other. When two in-house developments come together, it is informally known as “computer incest.”
Found when I was looking for a dependency-free XML-to-JSON parser wherein the author notes the “fine NIH tradition of JavaScript developers everywhere.” Reminded me of this
A highly configurable, free-for-private-use typeface
For a single project I made the mistake of working on in my Dropbox folder:
Wonder what the downsides are to hardlinking by default. And, fundamentally, why creating an amazing, Python-like standard library is such an intractable problem in the first place.
[. . .]
core-js
is also utils library, quite a big one honestly! It has so many functions inside I bet a lot of other packages will be using it!Not really. Only
babel-runtime
has it in its deps. Oopsie.
And returning to the starting point,cli
uses only 3 (trivial) methods from common-tags —stripIndents
,stripIndent
,oneLine
. Oopsie daisy.In order to use these 3 methods
node_modules
needs 1826 files. And that’s just 4 of mentioned 976 installed packages.
– Mateusz Morszczyzna, What’s really wrong with node_modules and why this is your fault
🤦♂️ The portion of the article that listed functionally similar packages and is-*
packages was particularly dismaying. As he points out, there’s a good reason why jQuery and lodash are as immensely popular as they are1.
Was wondering if we’ll ever get back to the magic of hand-crafted web pages and found this article which led me to this modern Geocities clone 💖 ↩︎
Made a “Literary Clock” inspired by Jaap Meijer’s repurposing of an old Kindle. Might not be a bad use for an old iPad. Reminds me that I need to get Mark Formanek’s Standard Time onto a Raspberry Pi at some point.
Update 08/24/18 There’s an app (of course)
Saw this minor dis by Safari
and then this video on the history of Java. Also by the author: something of a tribute to Flash (RIP.)
margin: 0;
padding: 0;
...
margin: 0 !important;
padding: 0 !important;
...
sudo margin: 0 !important;
sudo padding: 0 !important
via @thebarrytone
This project adds ligatures to Operator Mono, my favorite coding typeface
😍
Fira Code is also very beautiful and ships with ligatures
XKCD. Add to the mix
Then there’s Python’s packaging and distribution kerfuffle…
Peruse from time to time to learn more than ye olde {print $3}