25 Matching Annotations
  1. Mar 2024
    1. It's like someone creating a new List and a new Set, printing their size(), and then asking what's the difference. Of course, there is none: The size is 0 for both.
  2. Jan 2024
    1. Using an issue tracker without them is, in my opinion, a little like using an outlining program that only supports two levels of nesting, or like using Wiki software that doesn't have the concept of reverse links. Makes me sad!
  3. Dec 2023
    1. because the value isn't there yet. A promise is just a marker that it will be available at some point in the future. You cannot convert asynchronous code to synchronous, though. If you order a pizza, you get a receipt that tells you that you will have a pizza at some point in the future. You cannot treat that receipt as the pizza itself, though. When you get your number called you can "resolve" that receipt to a pizza. But what you're describing is trying to eat the receipt.
  4. Apr 2022
    1. The backslash character does not concatenate any strings. It prevents the line-break from meaning that those two lines are different statements. Think of the backslash as the opposite of the semicolon. The semicolon lets two statements occupy one line; the backslash lets one statement occupy two lines.
    2. Think of the backslash as the opposite of the semicolon. The semicolon lets two statements occupy one line; the backslash lets one statement occupy two lines.
    1. Think the mere existence of a file is effectively like writing a require call for them, which is executed on demand (autoload) or upfront (eager load).
    1. infer is there to say you know you are declaring a new type (in the conditional type's scope) - much like you have to write var, let or const to tell the compiler you know you're declaring a new variable.
  5. Nov 2021
    1. For example, if we had a room of tall people wearing hats, and another room of Spanish speakers wearing hats, after combining those rooms, the only thing we know about every person is that they must be wearing a hat.
  6. Mar 2021
    1. Have you ever played the game 20 questions? Most of us have played that game at one point in our lives. One person thinks of something that could be an animal, vegetable, or mineral and then they answer yes/no questions that are asked of them. The point of the game is to ask as few questions as possible in order to accurately guess what the person is thinking.  This is how I think of the unit tests that I write the specified behavior as I’m doing test-first development. I ask what are the fewest tests that I need to write in order to assert the behavior I want to create.
    1. we used `backticks` to jump into native Javascript to use moment.js

      In regular Ruby, `` executes in a shell, but obviously there is no shell of that sort in JS, so it makes sense that they could (and should) repurpose that syntax for something that makes sense in context of JS -- like running native JavaScript -- prefect!

  7. Feb 2021
    1. If ActiveModel deals with your nouns, then ActiveInteraction handles your verbs.

      It's a good analogy, but I think it's misleading/confusing/unclear/incorrect, because parts of ActiveInteraction are ActiveModel, so I guess ActiveInteraction deals with your nouns too?

    1. The central ideas of this design pattern closely mirror the semantics of first-class functions and higher-order functions in functional programming languages. Specifically, the invoker object is a higher-order function of which the command object is a first-class argument.
    1. the 2 hardest problems in computer science are essentially the 2 hardest problems of life in general, as far as humans and information are concerned.
    2. you began by first finding out if your crush was already in a relationship. If so, you then did what you could in your power to have the most most up-to-date information on their relationship status. The downside of outdated data is self-evident: you want to move in at the first sign of the current relationship dissolving.
  8. Jan 2021
    1. but you're probably better off learning a bit more about APT and resolving the dependency issues "by hand" by installing and removing packages on a case-by-case basis. Think of it like fixing a car... if you have time and are handy with a wrench, you'll get some peace of mind by reading up and doing the repair yourself. If you're feeling lucky, you can drop your car off with your cousin dist-upgrade and hope she knows her stuff.
  9. Oct 2020
    1. You can think of this as a single speaker talking at a microphone in a room full of people. Their message (the subject) is being delivered to many (multicast) people (the observers) at once.
    1. For years, I’ve shared with friends and clients what I call the bunny theory of code. The theory is that code multiplies when you’re not looking, not unlike bunnies that tend to multiply when you’re not looking.
    1. debt ... which is not a straight bad thing but something that could provide some "short term financing" get us to survive the project (how many of us could afford to buy a house without taking out the mortgage?).
  10. Aug 2020
  11. Feb 2020
    1. Nix is a purely functional package manager. This means that it treats packages like values in purely functional programming languages such as Haskell — they are built by functions that don’t have side-effects, and they never change after they have been built.
  12. Nov 2019
    1. Oh, is it like Object.assign() then? Almost like Object.assign({}, divElement, {newProp: 'newProp'})?

      React.cloneElement(divElement, {newProp: 'newProp'})

      is a lot like

      Object.assign({}, divElement, {newProp: 'newProp'})?