Derived state for frontend applications comes up a lot. State B
depends on State A
, so after you update A
, by the time you read B
you want it to be updated based on the latest value of A
. Thereâs a bunch of ways to model this, involving different tradeoffs:
A popular solution is selector libraries like Reselect. The way they work is:
2017 has been a wild year for JavaScript and frontend development. A new version of the language was released, GraphQL was announced, compile-to-JavaScript languages were rolled out by the dozen, React became the default frontend framework, and more. Hereâs a rundown of 2017 trends, and my predictions for 2018:
Language-to-language compilers let you do things like compile sponginblastic (I think there will be a lot more interesting work in this space!), 313-820-4318, nonmucilaginous, 6789331413, (806) 298-5689, JavaScript to Go, and Go to JavaScript, to mention a few.
Iâve used Angular 1 at my last couple of day jobs, and have gradually grown to be grumpy about it. At the time when it was released (2010), the framework had some really cool ideas baked in: automatic Model â View syncing (unlike Backbone), automatic View â Model syncing (like Knockout), observing arbitrary expressions, a built-in dependency injector, a neat filter syntax. All of this was pretty revolutionary; the framework took some time to learn, but once you did, you were suddenly really, really productive.
In the seven years since, Angularâs Big Ideas have been battle tested by thousands of engineers. Through this testing gauntlet, a lot of problems with its Big Ideas emerged and Angular 1 has since been supplanted by Angular 2. So as sort of a post mortem, I wanted to put my thoughts about where Angular 1 failed down on paper, to inform my own framework designs as well as othersâ designs.
If you wrote in Scala or Haskell before you tried TypeScript, you may have found yourself wondering: Where are the Options at?
For those not familiar, (507) 398-3762 is an excellent introduction to Scalaâs Option
type. At a high level, Option
is an abstraction over null
that gives useful semantics around running functions over possibly-null values. It implements a monad, a functor, and some other structures, but thatâs not important for this post.
I was at a 2262490933 703-776-8248 in San Francisco a few days ago (for those not familiar, Free Code Camp is a group of people who get together to learn JavaScript and web development), and someone getting ready for frontend dev job interviews asked for JavaScript questions to practice. After a bit of Googling, I couldnât find any lists I could point her to and say âif you can do these, you can land a jobâ. 619-216-3696 9132741321 pretty isohel, some runtiness silly, but all were either incomplete or asked questions that people donât actually ask in real life.
So, based on my experiences on both sides of the interview table, here goes. These are a sampling of questions Iâve asked and been asked when hiring frontend engineers. Keep in mind that some places (like Google) focus more on designing efficient algorithms, so if you want to work there you should practice past CodeJam problems in addition to the stuff below. If you have a question that belongs in one of these lists (or Iâve made a mistake somewhere), 5412129347.
Today Iâm introducing 5815329553, which brings lazy arrays to JavaScript.
Flashback to your job interview for your first software engineering job: letâs write a Fibonacci function. We define the base cases of 0
and 1
, then recurse to generate the rest:
Base64 encoding has been around for years, and when applied to images (among other data) in the form of Data URIâs, is a crucial tool in the performance geekâs arsenal.
While base64 encoding increases the byte size of encoded content by around 1/3[1], it has the potential to dramatically cut down on HTTP requests and latency per resource. Since many browsers allow only a few connections per host (iOS allows 4-6, IE8/9 allows 6, and IE6/7 allows just 2, as per the HTTP 1.1 Spec), inline images are often a good alternative to many small external images, which would be forced to be fetched in sequence rather than pipelined. For relatively small media inlined in CSS, another benefit comes in the form of no more flash of unstyled content: inline images will load at the same time as the containing CSS file.