1,286 Matching Annotations
  1. Feb 2021
    1. provide interfaces so you don’t have to think about them

      Question to myself: Is not having to think about it actually a good goal to have? Is it at odds with making intentional/well-considered decisions?  Obviously there are still many of interesting decisions to make even when using a framework that provides conventions and standardization and makes some decisions for you...

    1. One of the main reasons to work with components is re-usability and portability, but also a delegation of responsibilities. Adding a component should be as easy as simply adding the component without having to know the inner workings (or markup) of this component. A consumer should only be aware of the properties, methods and events of a component. In order to style a child component one has to be aware of the markup as well, which violates this 'delegation of responsibility'-principle.
    1. Using a terminus to indicate a certain outcome - in turn - allows for much stronger interfaces across nested activities and less guessing! For example, in the new endpoint gem, the not_found terminus is then wired to a special “404 track” that handles the case of “model not found”. The beautiful thing here is: there is no guessing by inspecting ctx[:model] or the like - the not_found end has only one meaning!
    1. The Quest for Truth

      The quest for Truth is everywhere and not limited to the economic topics linked here. This is just a topic that started a thought process where I had access to a convenient tool (Hypothesis) to bookmark my thoughts and research.

      Primary thought is: The Quest for Truth. Subcategories would provide a structured topic for the thought. In this case the subcategory would be: US Economy, Inflation

      The TRUTH is a concept comprised of inconsistencies and targets that frequently move.

      Targets (data, methods, people, time, semantics, agenda, demographic, motive, means, media, money, status) hold a position in time long enough to fulfill a purpose or agenda. Sometimes they don't consciously change, but history over time shines light and opens cracks in original narrative that leads to new truth's, real or imagined.

      Verifying and validating certain Truth is very difficult. Why is That?
    1. In object-oriented programming, information hiding (by way of nesting of types) reduces software development risk by shifting the code's dependency on an uncertain implementation (design decision) onto a well-defined interface. Clients of the interface perform operations purely through it so if the implementation changes, the clients do not have to change.
    1. Programming to an interface means that when you are presented with some programming interface (be it a class library, a set of functions, a network protocol or anything else) that you keep to using only things guaranteed by the interface. You may have knowledge about the underlying implementation (you may have written it), but you should not ever use that knowledge.
    2. If the program was important enough, Microsoft might actually go ahead and add some hack to their implementation so the the program would continue to work, but the cost of that is increased complexity (with all the ensuing problems) of the Windows code. It also makes life extra-hard for the Wine people, because they try to implement the WinAPI as well, but they can only refer to the documentation for how to do this, which leads to many programs not working as they should because they (accidentally or intentionally) rely on some implementation detail.
    3. Say you have software to keep track of your grocery list. In the 80's, this software would work against a command line and some flat files on floppy disk. Then you got a UI. Then you maybe put the list in the database. Later on it maybe moved to the cloud or mobile phones or facebook integration. If you designed your code specifically around the implementation (floppy disks and command lines) you would be ill-prepared for changes. If you designed your code around the interface (manipulating a grocery list) then the implementation is free to change.
    1. If you have large numbers, Swift lets you use underscores as thousands separators – they don’t change the number, but they do make it easier to read.

      Strange, but I guess this is to improve or help with readability yes?

    1. “Functional programming language” is not a clearly defined term. From the various properties that are typically associated with functional programming I only want to focus on one: “Immutability” and referential transparency.

      I mean not clearly defined seems wrong, there are common accepted characteristics that make a language functional.

  2. Jan 2021
    1. after 4 decades, we can observe that not much has changed beside learning how to measure the “figuring out” time.

      Comparing 1979 to 2018 results, we spend nearly the same amount of time for maintenance/comprehension of the code:

    2. 1979 in a book by Zelkowitz, Shaw, and Gannon entitled Principles of software engineering and design. It said that most of the development time was spent on maintenance (67%).

      Where software developers spent most of their in 1979:

    1. The changes we needed to make to main to reassign post mean that this implementation doesn’t quite follow the object-oriented state pattern anymore: the transformations between the states are no longer encapsulated entirely within the Post implementation. However, our gain is that invalid states are now impossible because of the type system and the type checking that happens at compile time! This ensures that certain bugs, such as display of the content of an unpublished post, will be discovered before they make it to production.

      This is really an amazing chapter for comparing (some aspects) of object oriented and functional programming, and I have to admit I still prefer the functional approach as a default.

    1. ensure the relevance, accuracy and effective communication of its interpretation and education programs (see above for A.O.D.A. requirements) by: establishing clearly defined and measurable learning objectives and outcomes, and undertaking a process of program evaluation using appropriate expertise – including staff, volunteers, community groups, or consultants carrying out research ensure all staff involved in the development and delivery of interpretation and education programs, have the appropriate skills and training

      (2) Volunteer opportunities (programming).

    2. have a volunteer program to encourage community participation in its activities, which should include: identification and development of volunteer opportunities procedures for recruitment of volunteers matching the needs and interests of volunteers to those of the museum provision of appropriate training and supervision for volunteers provision of a safe and secure working environment for volunteers volunteer evaluation public and private recognition of volunteers' contributions

      (3) Volunteer program (adding on to).

    3. ensure the relevance, accuracy and effective communication of each exhibit by: establishing clearly defined objectives and evaluating exhibits against their objectives using appropriate expertise, including staff, volunteers, community groups, or consultants carrying out sufficient research ensure that all staff (including volunteers) involved in the planning, preparation and installation of exhibits have the necessary skills and training

      (1) Volunteer opportunities (programming).

    4. formulating written policy governing operations and defining programs securing funding necessary to carry out the museum's programs preparing or approving an annual budget and monitoring it to ensure public accountability ensuring that the purposes for which the museum exists are being fulfilled

      Program development, grant writing accountability and documentation.

  3. Dec 2020
    1. Note: The examples in Listings 10-17, 10-18, and 10-24 declare variables without giving them an initial value, so the variable name exists in the outer scope. At first glance, this might appear to be in conflict with Rust’s having no null values. However, if we try to use a variable before giving it a value, we’ll get a compile-time error, which shows that Rust indeed does not allow null values.
    1. To the brain, reading computer code is not the same as reading language Neuroscientists find that interpreting code activates a general-purpose brain network, but not language-processing centers.

      Summary of the article:

      • Understanding code is neither done by language centers, nor by mathematical centers of the brain — it’s a whole different ball game.
      • This comes from a researcher who’s studying how different cognitive functions relate to language processing parts of the brain.
      • The study involved young programmers who analysed code while their brains were scanned.
      • People either say that great coders are great at language, or great at maths - neither seems to be true, and there is no single specialized area that lights up from coding.
      • The test activated the multiple demand network in participants’ brains, a wide network for performing mentally challenging tasks.
    1. Review your own code first Write a clear changelist description Automate the easy stuff Answer questions with the code itself Narrowly scope changes Separate functional and non-functional changes Break up large changelists Respond graciously to critiques Be patient when your reviewer is wrong Communicate your responses explicitly Artfully solicit missing information Award all ties to your reviewer Minimize lag between rounds of review

      13 best practices for participating in a code review when you're the author

    1. It was great for three things: motivation (people used what I built!)feedback (they sent me the bugs they encountered)accountability (from the moment I tweeted about this publicly, I really felt like that I’d have to finish this project… otherwise, it would be embarrassing)

      Three positive things that might come after publishing your beta software: motivation, feedback and accountability

    2. I had a proof-of-concept. It was great, because when you do a project, there’s always that small uncertainty that your idea is stupid and it can’t be done at all. But when you have a working prototype, all that insecurity is gone and it becomes much easier to go on.

      So true

    3. The problem with hobby projects is that they don’t pay very well. At least, compared to real-life projects. But hobby projects have a lot of cool advantages that we tend to forget.

      With hobby projects:

      • you can learn what you want
      • you've a full control over the tech stack
      • you can add the project to your CV
    4. The user has a starting stack: 10,000 units of play money.In each round, she gets a deal. Something like “You have an x% probability to win y amount of money.”She can decide how much of her play money she wants to risk.And the goal is to win as much as she can in 50 rounds.

      Great idea for a 1st game dev project

  4. Nov 2020
    1. The Ideology of Hacking

      [..]

      The hacker movement is a political project. Like the activity of many 'alternative' subcultures that are not directly defined by their political engagement, "the struggles are at once economic, political, and cultural - and hence they are biopolitical struggles, struggles over the form of life. They are constituent struggles, creating new public spaces and new forms of community" [46]. The chief uniting and mobilising force for the hacker underground is the common enemy of Microsoft (Bezroukov, 1999a). Opposition to Microsoft draws both from socialist anarchistic principles, and from high-tech libertarianism. The rightwing drift, dubbed as the Californian Ideology, is a recent transition, and not surprising given the hegemonic dominance of the corporate sector in the United States and the greater stakes in free software for business. However, it runs counter to the roots of hacking, which essentially is a reaction against Taylorism (Hannemyr, 1999). Basic motivations to engage in free programming are the rush of technological empowerment (Sterling, 1994), the joy of un-alienated creativity (Moglen, 1999), and the sense of belonging to a community (commonly recognised by hackers themselves as 'ego', but reputation only viable within a group of peers, i.e. a community). Those values may not seem political at first sight, but they are on collision course with the commercial agenda of turning the Internet into a marketplace. The rising tension within the hacker community are illuminated by the words of Manuel Castells: "The struggle between diverse capitalists and miscellaneous working class is subsumed into the more fundamental opposition between the bare logic of capital flows and the cultural values of human experience"

      [..]

    1. Frontend frameworks are a positive sum game! Svelte has no monopoly on the compiler paradigm either. Just like I think React is worth learning for the mental model it imparts, where UI is a (pure) function of state, I think the frontend framework-as-compiler paradigm is worth understanding. We're going to see a lot more of it because the tradeoffs are fantastic, to where it'll be a boring talking point before we know it.
    1. This conflicts in very basic ways with what other engineering disciplines expect. Toyota's stylists might be able to sell their renderings in art galleries, but you can't drive to work in one. In software, you can.

      I don't really understand the sentence. Does it mean that you can't really use a project's design until it's built, in classical engineering, while instead with software all that detailed design is actually the product?

    1. When you’re implementing a bad plan yourself, instead of having a mentor bail you out by fixing it, a few really useful things happen:You learn many more details about why it was a bad idea. If someone else tells you your plan is bad, they’ll probably list the top two or three reasons. By actually following through, you’ll also get to learn reasons 4–1,217.You spend about 100x more time thinking about how you’ll avoid ever making that type of mistake again, i.e., digesting what you’ve learned and integrating it into your overall decision-making.By watching my mistakes and successes play out well or badly over the course of months, I was able to build much more detailed, precise models about what does and doesn’t matter for long-term codebase health. Eventually, that let me make architectural decisions with much more conviction.

      There's a benefit to embarking on a challenge without a more experienced authority to bail you out.

      • You learn many more details about why it's a bad idea.
      • The lessons you learn in terms of how to avoid the mistakes you made stick with you longer

      (I would add that the experience is more visceral, it activates more modalities in your brain, and you remember it much more clearly.)

      These types of experiences result in what the author calls more "detailed, precise models". For me they result in a sort of intuition.

    1. Thanks for posting this helpful, well written article. Learning programming, or any other thing one takes up, requires you to sit at one place have a plan of action for your study.

      I was going through my Firefox bookmarks and I found article. I had read this article two years back and had commented that I found it to be useful. I read it back in May 2018. As of now, November 2020, my programming skills are still novice-level. I haven't implemented the ideas or followed suggestions given here.

      It has been 2 years and 5 months since I found this article to be relevant and it baffles me that I haven't taken action by making use of the knowledge given in this article. Two long years flew by. I guess reviewing my bookmarks is something that I will do more often.

      The article was posted on May 23, 2018 and I had stumbled on it the next day itself, i.e., May 24, 2018. This gets me thinking that we could finds solutions for problems(latest ones in this case) once we identify it, articulate it, hit the search button and just read stuff. I could presume that what happened next was that I misunderstood "finding a solution" to "realizing the solution", and perhaps became complacent or maybe there were more problems that didn't come to my awareness to identify and further find solutions. I'm not quite sure. Should I have identified my problems and googled more so that I could have learned C and C++ sooner?

      I wonder what held me back from taking action to accomplish and master something that usually takes not more that 5-6 months maximum.

    2. On learning programming

      • Master one first programming language first, before moving to the next.
      • Learn at a slow for the first two programming languages. This is important for beginners
      • Practising coding is more important than watching tutorials or reading books. You learn more by practising than by reading or watching videos.
      • Apart from tutorials, immitating open source projects is very important
      • Read others code and immitate it. You'll be surprised at how fast you're learning.
      • Make use of StackOverflow, Quora and programming subreddits.Ask questions there. Interact more.
      • Practice more. Write code from time to time. Debugging skills imporove with more coding practice.
      • Test your skills with quizzes, challenges and competitive programming
    1. Conclusions Draw your own. No? Fine. Good Enough: JSON? Protobuf Cap’n Proto Flatbuffers CBOR msgpack Avoid: YAML XML Thrift? BSON

      Alternatives to JSON which are well readable by humans. In short, JSON is still fine and seems like it will be for a long time

    1. There’s a story about an art teacher that split their class in half. They told one half of the students that they’d be graded based on a single piece of work, and the other half that they would be graded on the quantity of work produced. The half that was being graded on quantity ended up producing higher quality pieces. By iterating and learning from their mistakes they actually ended up producing better work than the students that only had to produce one piece. Quantity leads to quality. Share your work Sharing work helps you to think and develop. The feedback you get feeds into the next iteration.

      Share your work as often as you can as quantity leads to quality

  5. Oct 2020
    1. In terms of Docker, a bridge network uses a software bridge which allows containers connected to the same bridge network to communicate, while providing isolation from containers which are not connected to that bridge network. The Docker bridge driver automatically installs rules in the host machine so that containers on different bridge networks cannot communicate directly with each other.
    1. Declarative programming is an enabler of abstraction. Imperative programming is an inhibitor of abstraction. Declarative programming allows you to say “I want this and I don’t care how I get it” while imperative programming requires you to define each and every step.

      Declarative programming, i.e. "build me a house, I don't care how", is an enabler of abstraction.

      Imperative programming, i.e. "build walls, windows, a roof.", is an inhibitor of abstraction.

    1. Your weekly reminder that1. You should not have your development process on a centralized platform, at least not if you're doing anything that smells of copyright issues2. If you do host on a centralized platform, have regular, decentralized backups of code and issue tracking.3. Also, avoid US-centric hosting for this kind of thing. But really, refer to 1.

      3 things to keep in mind while hosting your code

    1. Longstanding controversy surrounds the meaning of the term "hacker". In this controversy, computer programmers reclaim the term hacker, arguing that it refers simply to someone with an advanced understanding of computers and computer networks[5] and that cracker is the more appropriate term for those who break into computers, whether computer criminals (black hats) or computer security experts (white hats).
    1. All validators can be used independently. Inspried by functional programming paradigm, all built in validators are just functions.

      I'm glad you can use it independently like:

      FormValidation.validators.creditCard().validate({
      

      because sometimes you don't have a formElement available like in their "main" (?) API examples:

      FormValidation.formValidation(formElement
      
    1. One of the primary tasks of engineers is to minimize complexity. JSX changes such a fundamental part (syntax and semantics of the language) that the complexity bubbles up to everything it touches. Pretty much every pipeline tool I've had to work with has become far more complex than necessary because of JSX. It affects AST parsers, it affects linters, it affects code coverage, it affects build systems. That tons and tons of additional code that I now need to wade through and mentally parse and ignore whenever I need to debug or want to contribute to a library that adds JSX support.
    2. However, as a developer that uses JSX, I find it too useful/concise to give up in the name of syntax purity, especially when I know that what it translates to is still very isolated and computationally pure.

      What does "isolated" mean in this case? Is it a different sense than how isolated is usually used in programming context?

      What does "computationally pure" mean? Sounds like a bit of a vague weasel word, but this is an honest question of curiosity and wanting to understand/learn.

    1. it also allows for more divergence in how people write there code and where they put their logic, making different svelte codebases potentially even more different due to fewer constraints. This last point is actually something I really value, I read a lot of Svelte code by a lot of different people and broadly speaking things look the same and are in the same places.
    1. use code to parameterize calls:

      You can write Python code to parametrize calls:

      python -c "
      from mymodule import set_dragon_feeding_schedule, Creatures, Date
      set_dragon_feeding_schedule(
          feeding_times=['10:00', '14:00', '18:00'],
          dishes={Creatures.Tiger: 2, Creatures.Human: 1},
          start_day=Date('1020-03-01'),
      )
      "
      

      instead of:

      python -m mymodule \
          set_dragon_feeding_schedule \
          --feeding-times ['10:00','14:00','18:00'] # hopefully this way it gets recognized \
          # how will you define parsing a dict with enum to integer mapping? 
          --dishes=Creatures.Tiger:2 \
          --dishes=Creatures.Human:1 \
          --start-day=1020-03-21 # BTW bash allows no comments in multiline calls
      
    2. That’s it. Types are parsed, checked and converted. Defaults and description are picked from function itself. Even provides bash completions you can install. You wrote no code for that!

      Good example of writing CLI interfaces in Python with typer:

      import typer
      from pathlib import Path
      
      app = typer.Typer()
      
      @app.command()
      def find_dragon(name: str, path: Path, min_age_years: int = 200):
          <implementation goes here>
      
      @app.command()
      def feed_dragon(dragon_name: str, n_humans: int = 3):
          <implementation goes here>
      
      if __name__ == "__main__":
          app()
      

      later we can call it that way:

      python example.py find_dragon 'Drake' --path /on/my/planet
      
    1. NestedText is a file format for holding data that is to be entered, edited, or viewed by people. It allows data to be organized into a nested collection of dictionaries, lists, and strings. In this way it is similar to JSON, YAML and TOML, but without the complexity and risk of YAML and without the syntactic clutter of JSON and TOML.

      NestedText - new format similar to JSON, YAML and TOML

  6. Sep 2020
    1. Spending more time looking for a solution rather than thinking about it.

      Stack Overflow Antipattern:

      1. Encounter a problem you can’t immediately solve
      2. Google the problem
      3. Find a seemingly-satisfying solution (usually on Stack Overflow)
      4. Copy-paste the solution and test it out
      5. If it works, move on; otherwise, go back to step 2.
    1. The idea of a web browser being something we can comprehend, of a web page being something that more people can make, feels exciting to me.

      my personal hope is that we can build a more sensible coherent web, that exudes the machines inside of it, by better harkening towards custom elements ("webcomponents"). move the page from being a bunch of machines in javascript, to a bunch of machines in hypertext.

      and then build pages that start to expose & let the user play with the dom. start to build experiences that bridge the gap into the machine/page.

      and keep going. keep going. build wilder web experiences. build more machines. and keep building battlesuits for the user, out of more componenets, out of more web, to let them wrestle & tangle with & manipulate & experiment & hack on & see & observe & learn about the truthful, honest, direct hypertext that we all navigate.

    1. The main reason using classes isn't a great solution is that it completely breaks encapsulation in a confusing way, the paren't shouldn't be dictating anything, the component itself should. The parent can pass things and the child can choose to use them or not but that is different: control is still in the hands of the component itself, not an arbitrary parent.
    2. The RFC is more appropriate because it does not allow a parent to abritrarily control anything below it, that responsibility still relies on the component itself. Just because people have been passing classes round and overriding child styles for years doesn't mean it is a good choice and isn't something we wnat to encourage.
    3. For my point of view, and I've been annoyingly consistent in this for as long as people have been asking for this feature or something like it, style encapsulation is one of the core principles of Svelte's component model and this feature fundamentally breaks that. It would be too easy for people to use this feature and it would definitely get abused removing the style safety that Svelte previously provided.
    1. I think Svelte's approach where it replaces component instances with the component markup is vastly superior to Angular and the other frameworks. It gives the developer more control over what the DOM structure looks like at runtime—which means better performance and fewer CSS headaches, and also allows the developer to create very powerful recursive components.
    1. Often, allowing the parents to compose elements to be passed into components can offer the flexibility needed to solve this problem. If a component wants to have direct control over every aspect of a component, then it should probably own the markup as well, not just the styles. Svelte's slot API makes this possible. You can still get the benefits of abstracting certain logic, markup, and styles into a component, but, the parent can take responsibility for some of that markup, including the styling, and pass it through. This is possible today.
    1. It's fashionable to dislike CSS. There are lots of reasons why that's the case, but it boils down to this: CSS is unpredictable. If you've never had the experience of tweaking a style rule and accidentally breaking some layout that you thought was completely unrelated — usually when you're trying to ship — then you're either new at this or you're a much better programmer than the rest of us.
    1. It turns out that even the length of time an element has been mounted is an important piece of state that determines what pixels the user sees. And some of this state can’t simply be lifted into our application state.

      What this means is that our desire to express UI using pure functions is in direct conflict with the very nature of the DOM. It’s a great way to describe a state => pixels transformation — perfect for game rendering or generative art — but when we’re building apps on the web, the idea chafes against the reality of a stateful medium.

    2. Functions have lots of interesting and useful properties. You can isolate them. You can compose them. You can memoize them. In other words, functional UI feels correct, and powerful, in a way that wasn’t true of whatever came before it. I think this is why people get quasi-religious about React. It’s not that it’s Just JavaScript. It’s that it’s Just Functions. It’s profound.

    1. A paradigm is a model or pattern. In JavaScript, there are a number of popular paradigms including object-oriented programming (OOP) and functional programming (FP). Paradigms are more important than is sometimes recognized. They help form mental models for solving problems. Becoming well-versed in the principles of a given paradigm can help accelerate development by providing mental shortcuts for solving the challenges that arise while building applications. They can also help produce higher quality software.
    1. we need to step back and make a closer look at the DRY principle. As I mentioned earlier, it stands for "Don’t Repeat Yourself" and requires that any piece of domain knowledge has a single representation in your code base. The words domain knowledge are key here. DRY is not about duplicating code. It is specifically about duplicating domain knowledge

      This is actually a good point – to have a single representation of specific piece of domain knowledge in the code.

      DRY is not about duplicating code.

  7. Aug 2020
    1. find every email on a web page that you're on. The big kahuna - this works for every website. Inject it into a site with Chrome DevTools (more here)

      Use this code below to find every e-mail on a webpage:

      var elems = document.body.getElementsByTagName("*");
      var re = new RegExp("(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)");
      for (var i = 0; i < elems.length; i++) {
          if (re.test(elems[i].innerHTML)) {
              console.log(elems[i].innerHTML);
          }
      }
      
    1. “I came to Rust from Haskell, and I feel that Haskell is a very elegant and safe language. The biggest differentiator for me is that there is a greater difference between high-performance code and idiomatic ‘clean’ code in Haskell than in Rust. Most Rust code looks like most other Rust code, even when it performs well. Haskell can become unfamiliar real quick if someone is operating under different libraries and goals from what you are typically doing. Small differences in syntax can result in huge differences in behavior, and Rust has more uniformity on that axis.”
  8. Jul 2020
    1. When FrozenError is raised, it is usually difficult to determine from the context which was the frozen object that a modification was attempted on.Ruby 2.7 introduces FrozenError#receiver which will return the frozen object that modification was attempted on, similar to NameError#receiver. This can help pinpoint exactly what is the frozen object.