An increasing number of computer lanuages are making use of unicode symbols, offering the tantalizing possibility of elegant, easy-to-read code that's a pleasure, rather than a pain, for untrained humans to read and debug.
Consider the following equations:
In older languages such as Fortran, C, and C++, variable names were restricted to alphnumeric characters. The above equations would have been implemented like this:
Not very easy to see what's going on, seemingly unrelated to the original equations, and painstaking to debug.
However unicode-enabled languages such as Java, Python 3, C#, or Julia enable implementations such as this:
This is significantly easier to read and so much closer to the original equations that even someone with no software background can easily read and debug the script.
To be user-friendly and legible, two things need to happen:
If ♃ᵦ ω̃ ξ⃗ n̈₀ ∛Δ̇‴
shows up as ⍰⍰⍰⍰
, your browser cannot handle the necessary Unicode characters.
It's no good typing beautiful scripts if you can't read them. All interfaces on which you view and edit code must use a unicode-enabled font.
First, pick a unicode-enabled, fixed-width font (I've listed a few here). Then change the default font in your browsers, shells, and text editors (instructions here).
Typing unicode characters must become as straightforward as tpying alphanumeric characters otherwise no-one will bother. Auto-completions automatically correct typing nddot
to n̈
.
Implementations vary depending on program and operating system, but I've collected a few ideas here.
That's it! By changing system fonts and using auto-completions, your scripts can be more user-friendly and efficient than ever before.
Test letters:
- Browsers
- Chrome '⋮' → 'Settings' → 'Show advanced settings' → 'Customize fonts' → Change the default 'fixed-width font' setting.
- Firefox '≡' → 'Options' → 'Content' → 'Advanced' → Change the default 'Monospace' setting.
- Safari Save this file. Open it in a text editor and change 'Consolas' to the name of your desired fixed-width font, and save the changes. In Safari, go to 'Safari' → 'Preferences' → 'Advanced' → 'Style Sheet' → 'Other' → Select the .css file you just downloaded and altered.
- Internet Explorer '⚙' → 'Internet Options' → 'General' → 'Fonts' → Change the default 'Plain text font' setting.
- Shells
- OSX Terminal 'Terminal' → 'Preferences' → 'Profiles' → 'Font' → 'Change' → Change default 'family' setting.
- Windows Command Prompt Right-click on taskbar → 'Properties' → 'Font' → Change the default font setting. If the font you've installed is not visible, follow the instructions on this page.
- Linux Shell Same process as for Safari.
-
Most browsers will need to be restarted before the changes below will take effect.
- Operating Systems
- OSX
- Windows Download AutoHotkey. Open command prompt and run
- Text Editors
- Sublime Text Download and install this package. Instructions on page.
- Notepad++
- Vim
- Emacs
shell:startup
to open your startup folder. Save this autocomplete file to your startup folder. Double-click it to start it running right now.