The Haskell Phrasebook is a free quick-start Haskell guide comprised
of a sequence of small annotated programs. It provides a cursory
overview of selected Haskell features, jumping-off points for
further reading, and recommendations to help get you writing
programs as soon as possible.
In this article we’ll learn how to build shared libraries and
install them properly on several platforms. For guidance, we’ll
examine the goals and history of dynamic linking on UNIX-based
operating systems.
Content for the article comes from researching how to create a
shared library, wading through sloppy conventions that people
recommend online, and testing on multiple Unix-like
systems. Hopefully it can set the record straight and help improve
the quality of open source libraries.
This articles covers several common components and why CSS isn’t
sufficient for covering accessibility by detailing the JavaScript
requirements. These requirements are based on the Web Content
Accessibility Guidelines
(WCAG) and
additional research from accessibility experts. I won’t prescribe
JavaScript solutions or demo CSS, but rather examine what needs to
be accounted for when creating each component. A JavaScript
framework can certainly be used but is not necessary in order to add
the events and features discussed.
I am a big proponent of the First Rule of
ARIA (don’t use
ARIA). But ARIA brings a lot to the table that HTML does not, such
as complex widgets and state information that HTML does not have
natively.
A lot of that information can be hidden to the average developer
unless they are checking the accessibility inspectors across
browsers or testing with a suite of screen readers. This is one of
the reasons I always advocate for making your styles lean on
structure and attributes from the DOM, to make it easier to spot
when something is amiss.
It is also, in my opinion, a way to reduce the surface area for
accessibility bugs. If your sort icon orientation is keyed to the
ARIA property that conveys that state programmatically, then getting
that ARIA property wrong will have two effects — a broken interface
and a weird icon. Addressing the accessibility issue will fix the
visual style.
A logical fallacy is an error in reasoning that makes your argument
less effective and convincing. And you want to be able to spot these
fallacies in other people's arguments (and your own) so you can call
them out or fix your own strategy.
A reluctant Hobbit, Bilbo Baggins, sets out to the Lonely Mountain
with a spirited group of dwarves to reclaim their mountain home, and
the gold within it from the dragon Smaug.
I’m essentially a believer in You Aren’t Gonna Need
It — the principle that
you should add features to your software — including generality and
abstraction — when it becomes clear that you need them, and not
before.
However, there are some things which really are easier to do earlier
than later, and where natural tendencies or a ruthless application
of YAGNI might neglect them.
YAGNI—You Ain’t Gonna Need It—is a rule that says you shouldn’t add
a feature just because it might be useful in the future—only write
code when it solves a direct problem.
When should you over-ride YAGNI? When the cost of adding something
later is so dramatically expensive compared with the cost of adding
it early on that it’s worth taking the risk. On when you know from
experience that an initial investment will pay off many times over.
As you embark on a design, build, or specification, it is important
you, the stakeholders, and the team understand what you are
producing and why. When you say pop-up, which one of the following
terms or concepts do you mean? What about your client? Your
designer? Your developer? The user (who calls the help line)? The
screen reader? The voice control software?
The map data-structure is incredibly useful when programming. The
first time I used Perl the thing that most impressed me was how easy
it was to use hashes, as they call them. I used them for everything!
Map is a central feature in Go too — it’s one of the built-in object
types with syntax support and generics. I think most people who
program in Python have a similar experience. They call them
dictionaries, and they are everywhere. In JavaScript, too, every
object is a sort of a hash map. When I worked on
V8
we had to go to huge
lengths
to hide the performance consequences of that decision, but I’m still
a fan of easy-to-use hash maps in languages.
Compressing files adds an overhead. It takes time to compress the
file, and it takes time again to uncompress it. However, it may be
many times faster to send over the network a file that is many times
smaller. The benefits of compression go down as the network
bandwidth increases. Given the large gains we have experienced in
the last decade, compression is maybe less important today. Having
fast decompression is important.
In iOS 15, we got a new Formatter API. Apple provides a new
formatter across the board, numbers, dates, times, and more. Why do
we need another formatter? How does it differ from the old one?
Let's find out.
What is structured concurrency? Well, long story short, it's a new
task-based mechanism that allows developers to perform individual
task items in concurrently.
There are three different types of inheritance going on.
Ontological inheritance is about specialisation: this thing is
a specific variety of that thing (a football is a sphere and
it has this radius)
Abstract data type inheritance is about substitution: this
thing behaves in all the ways that thing does and has this
behaviour (this is the Liskov substitution principle)
Implementation inheritance is about code sharing: this thing
takes some of the properties of that thing and overrides or
augments them in this way. The inheritance in my post On
Inheritance is
this type and only this type of inheritance.
These are three different, and frequently irreconcilable,
relationships. Requiring any, or even all, of them, presents no
difficulty. However, requiring one mechanism support any two or more
of them is asking for trouble.
Today I am going to introduce a new concept for Python developers:
typeclasses. It is a concept behind our new dry-python library
called classes.
I will tell you in advance, that it will look very familiar to what
you already know and possibly even use. Moreover, we reuse a lot of
existing code from Python’s standard library. So, you can call this
approach “native” and “pythonic”. And it is still going to be
interesting: I am showing examples in 4 different languages!
But, before discussing typeclasses themselves, let’s discuss what
problem they do solve.
The Python import system is pretty straightforward... to a
point. Importing code present in the same directory you’re working
in is very different from importing between multiple files present
in multiple directories. Through this post, I try to analyse the
different import scenarios that one might encounter, hopefully
making it easier to create your own packages.
Python standard library includes many great modules that can help
you make your code cleaner and simpler and functools is definitely
one of them. This module offers many useful higher order functions
that act on or return other functions, which we can leverage to
implement function caching, overloading, creating decorators and in
general to make our code a bit more functional, so let's take a
tour of it and see all the things it has to offer...
This post goes into details of 5+ JITs and various optimization
strategies and discuss how they work with different
JITs. Information in this blog post is more depth-first, thus
there are many important concepts that may be skipped. That also
means that this blogpost is not enough information to draw
meaningful conclusions on any comparisons of
implementations/languages.
OK, I hate long intros, so: this is a checklist of some of the
most important UX tips for creating usable signup and login
forms. It’s based on my experience looking at hundreds of beginning
designer login flows, thanks to my courses Learn UI
Design and Learn UX
Design.
For production web servers, most people assume scaling means needing
faster (and more expensive) hardware. Before spending more money on
servers, first make sure your web server process is using the
maximum available connections supported by your Linux kernel. There
are 3 layers you need to check and configure:
Kernel file-max
Process file-max (ulimit)
Systemd/Server config file-max (LimitNOFILE)
Any one of these layers can limit the number of max connections your
web server process is allowed.