Remix.run Logo
WalterBright 2 hours ago

Any user interface designer should take a good look at the controls on a commercial airliner. An awful lot of effort goes into making an intuitive, effective user interface. I have disagreements with it, but there's no denying it's very well done.

Designing a programming language is mostly about usability. I'll be giving a talk about that in April at Yale. It's a fun topic!

socalgal2 2 hours ago | parent | next [-]

Looking forward to your talk.

I feel like there's a taste issue which is similar to tabs vs spaces or other coding styles. Some languages kind of solve this with auto-formatting but just because they choose a standard doesn't mean their standard is as readable as some other.

In languages one taste issue that comes to mind. Many languages have the invisible scope issue

    foo = bar
In C++ for example, foo could be a local variable, a member of the enclosing class, a local module static, or a global. Some programmers like this, JBlow for example complained that in C++, switching between standalone function, member function, a lambda required too many changes. (foo = bar) isn't an example but the point is he wants that to be frictionless.

Me though, I want the line to be understandable with as little external context as possible. I don't want to have to dig up 10, 50, 100 lines to see if a local foo has been defined or if it's member. So like python or typescript. I like foo has to be this.foo or self.foo if you want it assign the current object's member. Most programmers seem to agree because they end up using mFoo or foo_ or some naming convention to work around the issue but I think I'd prefer the language to enforce it.

I don't know which if any languages make all the different scopes more explicit.

So far I haven't liked Swift though which seems more explicit. Even though it's more explicit in some areas I feel like the majority of my time is typing boilerplate and fixing trivial syntax errors. I know programming requires syntax and, as an example, I include semicolons everywhere in JavaScript even though they are not required. That said, I would like to get all the time back in my life where I compiled some C++ only to be told "error: missing semicolon at end of class definition" or "error: extra semicolon at end of member function declaration". It feels like a language should fix this stuff for the dumb human rather than make the human do random tedious work. I get there might be times where it's ambiguous but I wonder if it's also a language design issue.

WalterBright an hour ago | parent [-]

I think you're going to enjoy my talk!

user3939382 17 minutes ago | parent | prev | next [-]

My design is a cli as API+control plane which allows out of order and aliased tokens via intent resolution to IR. The GUI and CLI are homoiconic in that one builds the other or vice versa. When you layer on a nice UI library with intuitive controls, now you’re cookin’ with gas.

gyomu 2 hours ago | parent | prev [-]

Ok, except operating a commercial airliner literally takes thousands of hours of training, requires an extremely detailed mental model for how air flight works, and heavily relies on external procedures like checklists to ensure safe operation.

And fatal accidents due to poorly thought out control systems do occur.

https://www.fastcompany.com/1669720/how-lousy-cockpit-design...

Also fwiw using the word "intuitive" is an instant sign of someone not being a great designer.

https://www.asktog.com/papers/raskinintuit.html

WalterBright an hour ago | parent [-]

The 757 cockpit designers did use the word "intuitive" a lot.

The control stick movements, for example, are intuitive. (Early aircraft did not have control sticks!)

For a crazy example, airplane jargon has specific meanings. "Takeoff Power" officially means full power to take off with. Makes intuitive sense, right? Well, one day the pilot needed to abort a landing, and yelled "takeoff power". The copilot heard "take off power" (note the space), chopped the power, and the airliner crashed. The jargon was changed to "full power".

The Air Force, however, had their own jargon and stuck with "Takeoff Power", until one day they had the same accident and changed the jargon.

For another example, the levers for the flaps have a knob on them shaped like a flap. This way, the pilot has tactile feedback that his hands are on the right lever, and he doesn't need to take his eyes off his other tasks.

For a third example, cockpit designers put in a warning horn for a stall warning. It worked great, and so they put in other warning horns, each with a distinct sound. Unfortunately, the pilots would confuse them, and do the wrong thing. So the "horn" is now a voice that says "stall" (or something like that).

Using words for aural indicators still has not percolated out of the aviation industry. You don't have any for your car, for example. Just chimes, beeps, buzzes, and other primitive and hopeless sounds. Oh, lest I forget to mention, the stupid incomprehensible icons.