Hi. This is stereobooster's personal blog

I’m a software developer interested in UX, a11y, type systems, performance.

Github · Twitter

Currying reimagined

What is currying? Currying is the process of transforming a function that takes multiple arguments in a tuple as its argument, into a function that takes just a single argument and returns another function which accepts further arguments, one by one – https://wiki.haskell.org/Currying E.g. it’s process of converting funtion like that: 1const func = (x, y, z) => [x, y, z]; 2func(1, 2, 3) === [1, 2, 3]; to

Dev.to posts quality

In response to: I feel like the quality of posts in Dev is deteriorating Improving the way DEV elevates the good stuff This is quite an interesting case for study. On one hand, we have websites that optimize for popularity (engagement) of posts, like hacker news and reddit. Users can upvote and downvote content. Those sites tend to be toxic and elitist. It is hard to get on top, but if the author gets on top they will get a lot of views and comments.

Why technologies go out of trend?

How to distinguish over-hyped technologies (which gonna die) from innovative technologies which gonna stay? Yes, I know: it is better to choose stabile technologies over trends it is better to choose tools you know over trends it is better to use tool appropriate for the task But if the technology is popular (trendy) it means, there is big a community, which means easier to get support, a bigger number of community-driven libraries, a bigger number of vacancies, a bigger number of candidates to hire.

Is this a type error? (2)

Continuation of previous post: Is this a type error?. I wrote a small lisp-like language. To create a variable in this language you would write: 1(define x 1) in JavaScript, you would write: 1const x = 1; Because define is structurally similar to a function, language handles it in the same manner (but it doesn’t evaluate the first argument). It is possible to write, for example: 1(define 1 1) But this is an error, first argument suppose to be “symbol”, not a number.

Is this a type error?

What is a type error? Let’s say this is an error when the operation is applied to the value of the wrong type. For example, is division by zero a type error? If we define division type signature as (Number, Number) -> Number than it is not a type error. But on the other hand, the division is a partial function e.g. it is not defined for all possible inputs (denominator can’t be zero).

Are Dart and Java type systems sound?

From Dart docs: Soundness is about ensuring your program can’t get into certain invalid states. A sound type system means you can never get into a state where an expression evaluates to a value that doesn’t match the expression’s static type. For example, if an expression’s static type is String, at runtime you are guaranteed to only get a string when you evaluate it. Dart’s type system, like the type systems in Java and C#, is sound.

Styled-components 3 ways

Style Objects 1const Button = styled.button((props) => ({ 2 color: props.color, 3 border: `2px solid ${props.border}`, 4 background: props.background, 5})); styled-components optionally supports writing CSS as JavaScript objects instead of strings. This is particularly useful when you have existing style objects and want to gradually move to styled-components. Tagged Template Literals 1const Button = styled.button` 2color: ${(props) => props.color}; 3border: 2px solid ${(props) => props.border}; 4background: ${(props) => props.

A short history of web development

A small overview of web development approaches and when they appeared. Documents vs Applications This is a popular argument to justify SPAs and CSS-in-JS. The web was invented for documents, but now we use the Web for applications. Also, it’s called Sites vs Apps. Documents - is when you mostly read the content. For example, a static website generated with something like Jekyll, or Hugo, or Eleventy, etc. Applications - is when you create, read, update, and delete (CRUD) content.

Code navigation

Code navigation - one of the basic techniques required for code comprehension. For example, you want to understand how some piece of code works, you need to understand how each function (or class, or subroutine, etc) works, to do this you can jump to the definition of each function and read source (or read the documentation if it is a built-in function). Text search Most universal approach. I use it if everything else fails.

Code comprehension

I have thought that the following characteristics are important for code quality (ordered by priority): readability correctness performance Note: Yes readability is more important because it would be easy to fix readable code, but it would be harder to change unreadable code. Recently I realized that code readability is a too narrow term here - code comprehensibility is the better one. Reading is only one of the activities required for understanding the code.

Except where otherwise noted, content on this site is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0