355 Matching Annotations
  1. Last 7 days
  2. Jun 2021
  3. test-prof.evilmartians.io test-prof.evilmartians.io
    1. That's it! Just replace let! with let_it_be. That's equal to the before_all approach but requires less refactoring.
    2. That technique works pretty good but requires us to use instance variables and define everything at once. Thus it's not easy to refactor existing tests which use let/let! instead.
    1. I've seen (and fixed) Ruby code that needed to be refactored for the client objects to use the accessor rather than the underlying mechanism, even though instance variables aren't directly visible. The underlying mechanism isn't always an instance variable - it can be delegations to or manipulations of a class you're hiding behind a facade, or a session store with a particular format, or all kinds. And it can change. 'Self-encapsulation' can help if you need to swap a technology, a library, an object specification, etc.
    2. Also, Sandi Metz mentions this in POODR. As I recall, she also advocates wrapping bare instance variables in methods, even when they're only used internally. It helps avoid mad refactoring later.
    3. But sure, go ahead and enforce self-encapsulation if you like; it makes it easier to do memoization or whatever later on.
    1. better “decision hygiene” such as designating an observer for group decisions, to prevent common biases and noisy judgments. For example, they can ensure that participants in a team reach independent assessments before coming together as a group to aggregate their decisions.

      Approaches for decreasing noise in decision making

  4. May 2021
    1. For dynamic routes, such as our src/routes/blog/[slug].svelte example, that's not enough. In order to render the blog post, we need to fetch the data for it, and we can't do that until we know what slug is. In the worst case, that could cause lag as the browser waits for the data to come back from the server. We can mitigate that by prefetching the data. Adding a sveltekit:prefetch attribute to a link... <a sveltekit:prefetch href="blog/what-is-sveltekit">What is SvelteKit?</a> ...will cause SvelteKit to run the page's load function as soon as the user hovers over the link (on a desktop) or touches it (on mobile), rather than waiting for the click event to trigger navigation. Typically, this buys us an extra couple of hundred milliseconds, which is the difference between a user interface that feels laggy, and one that feels snappy.
    2. makes your app inaccessible to users if JavaScript fails or is disabled (which happens more often than you probably think).
    1. Career decision making involves so much uncertainty that it’s easy to feel paralysed. Instead, make some hypotheses about which option is best, then identify key uncertainties: what information would most change your best guess?

      We tend to think that uncertainties can't be weighted in our decision-making, but we bet on uncertainties all the time. Rather than throw your hands up and say, "I don't have enough information to make a call", how can we think deliberately about what information would reduce the uncertainty?

    1. Because constants in Ruby aren't meant to be changed, Ruby discourages you from assigning to them in parts of code which might get executed more than once, such as inside methods.
  5. Apr 2021
    1. Explicit affordances are obvious, perceptual features of an item that clue you in on how it is to be used. With explicit affordances, physical appearance and any accompanying language or text inform the user of how an object is to be used.
  6. Mar 2021
    1. I like this approach more because I can scan the code that renders the Box component and easily spot that it takes two children. If the Box took any props, they'd be within the opening <Box> tag, and they would be distinct from any children props.
    1. Sociologist Michael Warner built on this some ten years later, saying:Counterpublics are spaces of circulation in which it is hoped that the poiesis of scenemaking will be transformative, not replicative merely.Poiesis is a fancy way of talking about the art and the act of creating, inventing — and it’s closely related to technique. Consciously making a scene that others can join in with.Economist Kim Crayton’s antiracism programme, Cause a Scene speaks directly to this: she is bringing a clear set of principles to life through leadership training and sharing content to achieve “strategic disruption of the status quo in technical organizations”.Making a scene is galvanising and welcoming, dynamic and inclusive by default.

      I like this idea of creating a space and causing a scene to pull people in.

      Not too dissimilar to the aculturation Hollywood does to help normalize certain activities just by showing them increasingly.

      Definitely want to circle back to this with additional examples and expand on it.

    1. Chapman, G. B., & Coups, E. J. (2006). Emotions and preventive health behavior: Worry, regret, and influenza vaccination. Health Psychology: Official Journal of the Division of Health Psychology, American Psychological Association, 25(1), 82–90. https://doi.org/10.1037/0278-6133.25.1.82

    1. Baker, C. M., Campbell, P. T., Chades, I., Dean, A. J., Hester, S. M., Holden, M. H., McCaw, J. M., McVernon, J., Moss, R., Shearer, F. M., & Possingham, H. P. (2020). From climate change to pandemics: Decision science can help scientists have impact. ArXiv:2007.13261 [Physics]. http://arxiv.org/abs/2007.13261

    1. The number one problem that I see developers have when practicing test-first development that impedes them from refactoring their code is that they over-specify behavior in their tests. This leads developers to write more tests than are needed, which can become a burden when refactoring code.
    1. Unfortunately, given how widely used concat_javascript_sources is, this required changing a lot of tests. It would be nice if we could remove some of the duplication in these tests (so that similar changes would not require updating this many tests), but that can come in another PR.
    1. The Model macro literally does what our model! step did.

      That information is not generally relevant. Only makes sense for someone who actually knew about or used the old interface.

      The docs shouldn't assume you are an experienced user / a user of the previous version.

      Would have been appropriate in a Changelog entry or announcement, but not in the general docs.

  7. Feb 2021
    1. While Trailblazer offers you abstraction layers for all aspects of Ruby On Rails, it does not missionize you. Wherever you want, you may fall back to the "Rails Way" with fat models, monolithic controllers, global helpers, etc. This is not a bad thing, but allows you to step-wise introduce Trailblazer's encapsulation in your app without having to rewrite it.
    1. Universal Links allow you to register a series of domains that are allowed to interact with an installed application. If the application is not installed, the universal link is opened with Safari, allowing you to inform the user of the existence of an application or whatever is necessary.
    1. Implicit intents do not name a specific component, but instead declare a general action to perform, which allows a component from another app to handle it. For example, if you want to show the user a location on a map, you can use an implicit intent to request that another capable app show a specified location on a map.
    1. Yes, you do face difficult choices (moral) but you don't care about it. All you care are the reputation bars. So... Let's kill this guy, who cares if he is innocent, but this faction needs it or I'm dead. Sounds great on paper but to be honest... you just sit there and do whatever for these reputation bars. If you won't, then you lose
    1. Say, for instance, a hypothetical self-driving car is sold as being the safest on the market. One of the factors that makes it safer is that it “knows” when a big truck pulls up along its left side and automatically moves itself three inches to the right while still remaining in its own lane. But what if a cyclist or motorcycle happens to be pulling up on the right at the same time and is thus killed because of this safety feature?

      I think that an algorithm that's "smart" enough to move away from a truck is also "smart" enough to know that it cannot physically occupy the same space as the motorcycle.

    1. Part of me thinks that open source can be more rewarding to the creators/contributors. But maybe the real contribution is the permanent addition to the tools available to humanity, and if you have the wits, you can make a decent business out of it without tainting open source.
    2. For a sufficiently successful and industry-relevant open source project, it's possible for the main developers to earn a living e.g. by selling related consulting services.
  8. Jan 2021
    1. We informed and documented. We made it easy for you to understand the problem and also to take action if you disagreed. I hope you didn’t read https://linuxmint-user-guide.readthedocs.io/en/latest/snap.html#how-to-install-the-snap-store-in-linux-mint-20. I can’t understand how it could be simpler.
    2. Is it harder to enable it in Mint than it is to disable it in Ubuntu? Not at all. Is how to enable it better documented in Mint than how to disable it in Ubuntu? Absolutely: https://linuxmint-user-guide.readthedocs.io/en/latest/snap.html.