1,132 Matching Annotations
  1. Last 7 days
    1. From Jim Keller on Lex, there’s three fundamental types of compute CPU: add, multiply, load, store, compare, branch (nothing can be known about anything) GPU: add, multiply, load, store (when things happen is known, but the addresses aren’t) DSP: add, multiply (everything is known except the data) Neural networks are DSPs. All the loads and stores can be statically computed, which isn’t even possible for GPU workloads, never mind CPU ones.
    1. Emphasizing lifetime-polymorphism can also make type inference untenable, a design choice that wouldn’t fit OCaml.

      References or sources? Why? Presumably there's some research into this?

  2. May 2023
    1. I think that TANGLE-style reordering is a lot less important with modern programming languages: they don't do one-pass compilation and so can deal with forward references. Note that most of the cross-references in Knuth's program could be replaced with function calls or constant names
    1. I felt he had just written the program where the default was comment without delimiters (i.e. most just changed the syntax for the compiler).
    1. Web sites often design their APIs to optimize performance forcommon cases. Their main object-reading methods may return onlycertain “basic” properties of objects, with other methods availablefor fetching other properties. ShapirJS hides this performanceoptimization complexity from the user.

      In other words, it risks undermining the intent of the API design.

    1. How can I add, subtract, and compare binary numbers in Python without converting to decimal?

      I think the requirements of this were not spelled out well. After reading this over a couple of times, I think the problem should be…

      "Add, subtract, and compare binary numbers in Python as strings, without converting them to decimal."

      I'll take on that problem sometime when I get free time!

    1. 'handlers': { 'console': { 'level': 'INFO', 'class': 'logging.StreamHandler', 'stream': sys.stdout, 'formatter': 'verbose' }, },

      It's as simple as adding "sys.stdout" to the "stream" attribute.

    1. Available as a monolithic file, by chapters, and in PDF — git repository.

      What a cool documentation design; I love the all-in-one layout.

      Very reminiscent of the old CoffeeScript docs, to me.

  3. Apr 2023
    1. Here we have extended this model to a slightly different category, a category where morphisms are represented by embellished functions, and their composition does more than just pass the output of one function to the input of another. We have one more degree of freedom to play with: the composition itself. It turns out that this is exactly the degree of freedom which makes it possible to give simple denotational semantics to programs that in imperative languages are traditionally implemented using side effects.
  4. Mar 2023
    1. "We could use this type of DB, or this other, or that other, and these are some pros and cons… And based on all these tradeoffs, I’ll use THAT type of DB."

      Example of how to recommend a single system

    2. The difference between coding and system design is the difference between retrieving and creating.Instead of finding (or “retrieving”) a solution, you are creating a solution. In this way, coding is akin to a science, while system design is more like an art.
    1. So why aren't more people using Nim? I don't know! It's the closest thing to a perfect language that I've used by far.

      Nim sounds as the most ideal language when comparing to Python, Rust, Julia, C#, Swift, C

    1. It isn't a good long term solution unless you really don't care at all about disk space or bandwidth (which you may or may not).

      Give this one another go and think it through more carefully.

  5. Feb 2023
    1. Object-oriented Programming (OOP) is the process of converting this perfectlydefined design into a working program that does exactly what the CEOoriginally requested.


    2. Object-oriented Design (OOD) is the process of converting such requirements intoan implementation specification. The designer must name the objects, define thebehaviors, and formally specify what objects can activate specific behaviors onother objects. The design stage is all about how things should be done. The outputof the design stage is an implementation specification. If we were to complete thedesign stage in one step, we would have turned the requirements into a set ofclasses and interfaces that could be implemented in (ideally) any object-orientedprogramming language.


    3. Object-oriented Analysis (OOA) is the process of looking at a problem, system,or task that somebody wants to turn into an application and identifying the objectsand interactions between those objects. The analysis stage is all about what needsto be done. The output of the analysis stage is a set of requirements. If we were tocomplete the analysis stage in one step, we would have turned a task, such as, "Ineed a website", into a set of requirements, such as:Visitors to the website need to be able to (italic represents actions, boldrepresents objects):review our historyapply for jobsbrowse, compare, and order our products


    4. What object-oriented means

      What does the object-oriented means? Objects are models of somethings that can do certain things and have certain things done to them. Formally, an object is a collection of data and associated behaviors.

    5. The difference between object-oriented design and object-orientedprogramming

      What is the design and programming mean in OOP?



  6. Jan 2023
    1. Hints for Preparing Documents Most documents go through several versions (always more than you expected) before they are finally finished. Accordingly, you should do whatever possible to make the job of changing them easy. First, when you do the purely mechanical operations of typing, type so subsequent editing will be easy. Start each sentence on a new line. Make lines short, and break lines at natural places, such as after commas and semicolons, rather than randomly. Since most people change documents by rewriting phrases and adding, deleting and rearranging sentences, these precautions simplify any editing you have to do later. — Brian W. Kernighan, 1974

      —Brian W. Kernighan, 1974 “UNIX for Beginners” [PDF] as Bell Labs Technical Memorandum 74-1273-18 on 29 October 1974.

      For easier editing and reuse of sentences, or even portions of lines of text, one can (and should) write sentences or sentence fragments on their own lines in digital contexts.

      This way future edits or the ability to more easily cut and paste will far easier in addition to keeping your version control files simpler and easier to read and visually track your changes. (That is in many version control systems, instead of a change appearing to affect an entire paragraph, it will only show on the single line that was changed thereby making the change easier to see.)

      This particular affordance may be a particularly useful one for note takers who expect to regularly reuse their notes in other contexts. Many forms of software (including Tex, LaTeX, and even markdown) will autowrap newlines so that a sentence broken up into clauses on multiple lines will properly wrap back into a proper looking single line when printed. Take care that in many Markdown versions adding two spaces at the end of a line will automatically create a newline in your text.

    1. Literate programming worked beautifully until wegot to a stage where we wanted to refactor theprogram. The program structure was easy tochange, but it implied a radical change to thestructure of the book. There was no way we couldspend a great deal of time on restructuring thebook so we ended up with writing appendices andappendices to appendices that explained what wehad done. The final book became unreadable andonly fit for the dustbin.The lesson was that the textbook metaphor is notapplicable to program development. A textbook iswritten on a stable and well known subject whilea program is under constant evolution. Weabandoned literate programming as being toorigid for practical programming. Even if we got itright the first time, it would have failed in thesubsequent maintenance phases of the program’slife cycle.



    1. Although the architect could code, as the title suggests, there are other ways for the architect to stay engaged with the delivery, such as pairing and peer reviews.
    2. Rotating the architect role among different team members carries the benefit of increasing the overall team’s working architectural knowledge. Team members gain a better understanding of all the roles involved in delivery, leading to empathy between team roles, improved intra-team interaction, and a better overall product by diversifying the viewpoints applied to each role.

      On rotating roles

    3. Similarly, when I ask other architects how much they’ve coded recently, more often than not I hear: “It’s been a while.”
    1. Considerations

      What about chained dotted access? foo.bar.baz is probably okay as bar.baz @ (the Foo) (or even @the Foo), but probably not if it takes the form bar.baz from the Foo. (It just doesn't look reasonable to me.)

      Alternatively, what about @bar.baz for the Foo?

    1. In Lua you can write raw, multiline strings with [[]]: [[ Alice said "Bob said 'hi'". ]]

      This is indeed very good (for the reasons stated here).

    1. how important is the concrete syntax of their language in contrast to

      how important is the concrete syntax of their language in contrast to the abstract concepts behind them what I mean they say can someone somewhat awkward concrete syntax be an obstacle when it comes to the acceptance

    1. I highly recommend Advent of Code to anyone looking to sharpen (or re-sharpen) their programming skills.
    2. I used vim and make for my universal IDE.

      vim and make serve well as universal IDE for most programming languages (maybe apart from C#?)

    3. For the most part, homebrew solved the installation problem. Almost every language had a homebrew-based option.

      Homebrew can help a lot while experiment with new programming languages

    4. I stayed up each night until the problem was released (11pm my time), but I didn’t try to code up the solution right away. Instead, I read the problem description before bed and then thought about how to solve it while falling asleep. I usually woke up every morning with a full sketch of the solution in my head, or something close to it.

      Sleep tactic for solving programming challenges

  7. Dec 2022
    1. David Alfonso has done a great job and put together a repository that helps you with the export of tiddlers. All you need is to export all your tiddlers bundled as one single HTML and then follow the instructions in the README.

      TiddlyWikiPharo is capable of similar exportation and we start from the single HTML TW file that we can de/recompose almost at will, because we can manipulate the tiddlers inside a data narrative. As shown in the malleable systems wiki example, we're mostly focused in conversions from Markdown to WikiText (TW's format) as it is our most felt necessity, but migrations from WikiText to Markdown are in the radar, combining/extending TiddlyWikiPharo with Pandoc (future needs/funding will tell if/when is implemented).

    2. After going down the Emacs rabbit hole, I’ve adopted ORG mode as my main file format for writing documents, exporting these to other formats (PDF, markdown, Confluence, Jira and many others), creating diagrams (mainly plantuml), presentations, writing technical documentation and hopefully some day for publishing a whole book. For the note-taking phase I write my notes in ORG mode and create a rudimentary outline sorted by chapters/sections. Usually I use the same structure to create my blog posts from (like I did in the book summaries). Extracting pieces of information for individual tiddlers, however, tends to be a time-intensive process. I’ve managed to use the Tiddlywiki API within Emacs but my Elisp skills are still not good for doing more advanced stuff like:

      We, at the Grafoscopio community create a lot of projects (including presentations, book(lets) writing/republishing, workshops/reading notes) by connecting diverse contexts instead of keeping ourselves inside a single one. Of course, this single context would be possible on an individual level, but connecting different contexts gives account of the diversity of participants in our community and workshops. So we keep contexts limited, minimal and well connected (TW, Fossil, Pharo/GToolkit and Markdown tools like Zettlr or HedgeDoc) but not a single one.

      It is the creation of fluent workflows between different tools, that account for different experiences and participants our way to deal with context friction instead of keeping ourselves inside a single context.

      All the advanced usages of TW in the list items after this highlight are done inside the data narratives from TiddlyWikiPharo, as told in a previous note with a novice friendlier syntax (Smalltalk instead of Lisp).

    3. It became not only my primary editor, but also my RSS feeds reader, mail client, YouTube video player, IDE, API client… I basically live in Emacs Here is my config.org and try to avoid as many context switches as possible.

      My context switching friction decrease is related with the way I connect the contexts (for example TW + Glamorous Toolkit vía custom packages like TiddlyWikiPharo instead of being inside a unique context, particularly a text oriented one, with a pretty limited definition of text as it limits what our visual cortex is able to convey with richer text/visuals.

    1. A paper doesn’t even contain all the information and data required to reproduce a result. Because if it did, it would be the size of a book.
  8. Nov 2022
    1. A SimpleDelegator instance can take advantage of the fact that SimpleDelegator is a subclass of Delegator to call super to have methods called on the object being delegated to. class SuperArray < SimpleDelegator def [](*args) super + 1 end end SuperArray.new([1])[0] #=> 2
    1. In Potluck, we encourage people to write data in freeform text, and define searches to parse structure from the text.

      From a gradual enrichment standpoint I understand but from a data entry standpoint this seems like more work.

    1. In summary, terminal input is weird.  It’s weird largely because there’s a character-only pipe sitting between the terminal and shell.  And going one step back, the weirdness comes from the whole historical division of terminal vs. shell, which is based on emulating a physical hardware setup that hasn’t been built since the 80s. 

      Summary of why the terminal input is so weird.

    1. Currently Xournal++ does not have shortcuts/keybindings configurable in the preferences. However you can write your custom plugin to achieve exactly that.

      Must learn (and install) Lua (version >=5.3) to make custom shortcuts for Xournal++ via personally made plugins.

    1. What does 'passing an argument' mean in programming?You have a grinder that will grind anything that you pass on to her. You give her Rice. She grind it. You give her wheat. She grind it. You give her a Justin Bieber song CD. She grind it. She grinds every thing that you hand over to her. In programming, we create function that does the stuff we need. Say add, subtract, multiply or print the stuff that you pass on to it. Then we pass on stuff upon which the function will operate and return us the results. This process of passing the 'stuff' to be processed is referred to as passing an 'argument' in programming. Thank You.
    1. I like to say that in ECS we design bottom-up. We look at data and which behaviour depends on which data. In OO we design top-down, we search for abstractions and generic behaviours / definitions.
    1. there is no single perfect universal programming language. Until I came to that point, I wasted a lot of time thinking that GW-BASIC QBASIC QB 4.5 VB4 Delphi Java C++ C# 1.0 was the only language I would ever need
    1. There are three main types of module and function mocking in Jest:jest.fn: Mock a functionjest.mock: Mock a modulejest.spyOn: Spy or mock a function

      Esto es sólo una prueba para Juanda

    2. One of the common ways to use the Mock Function is by passing it directly as an argument to the function you are testing.


    1. Clean code examples (YouTube)Why Are You Still Creating CRUD APIs?Remove Your If-Else and Switch CasesWhy Cognitive and Cyclomatic Complexity Matters in Software DevelopmentWriting Cleaner Code (With Examples)Resources for the curious📚 Source Code (GitHub) by Nicklas Millard, the authorRESTful API Design by MicrosoftArchitectural Styles and the Design of Network-based Software Architectures by R.T. FieldingWhat is REST by codeacademyIs Crud Bad For Rest? by Boris LublinskyHATEOAS Driven REST APIs by restfulapi.netHATEOAS — a simple explanation by Bartosz JedrzejewskiWhy HATEOAS is useless and what it means for REST by Andreas ReiserRESTful Considered Harmful by Tomasz NurkiewiczTask-Based UI on cqrs.wordpress.comCRUD is an antipattern by Mathias VerraesWhy REST sucks by Troy A. Griffitts

      Useful links for Web & generic programming.

    2. RPC-like but still REST-full is way more preferred than those rotten CRUD designs.

  9. Oct 2022
    1. The first interaction with a programming language should be what it can do for you, rather than an exhaustive glossary of what it is.
    1. she says in contrast to e.g. reading, we don’t know much of anything about teaching programming. There’s no body of work

      Hermans posits that there is no actual body of work about how to effectively teach programming. In contrast to reading.

    1. it can be ‘run’ at some point, which produces the ‘running program’. Not to be confused with a ‘non-running program’, the running program is the original program plus some run time state attached to its various parts which changes as it runs.

      Reminiscent of The Pinocchio Problem.

    2. The program is a document like construct created by a programmer—it has some structure presented via a primary visual representation through which the programmer views and manipulates it.

      Reminiscent of the distinctions Martin Fowler makes on Projectional Editing.

    1. On “good” days, developers spend more time developing and less time collaborating
  10. pointersgonewild.files.wordpress.com pointersgonewild.files.wordpress.com
    1. IMO: one of the biggest problems in modern softwaredevelopment• Code breaks constantly, even if it doesn’t change• Huge cause of reliability issues and time wasted• This is somehow accepted as normal

      ⬑ "The Code Rot Problem"

    1. The program will compile, but not run, because JVM will not recognize the main() method. Remember JVM always looks for the main() method with a string type array as a parameter.

      With out String args[] in main().

    1. An object in Java is the physical as well as a logical entity, whereas, a class in Java is a logical entity only.

      Object exists but Class is just logical steps to make object. Class --> Blue print and Object ---> Car

    1. Many popular SQL clients do not use SSL by default. If you aren’t deliberate about choosing encryption, the connection will be unencrypted.

      Table with SQL clients and their default SSL mode:

    2. SSL is disabled by default in jdbc, npgsql, node-postgres, and pgx.

      Table with programming libraires and their default SSL mode:

  11. Sep 2022
    1. I have a simple coding principle: write lines of code as though instructing a real person how to do the job. And that naturally expands to designing and modelling systems like real organisations with their own divisions, departments, branches, and all the various “job positions” that need to be filled. Make the whole system appear as human as possible.
    1. A line of code containing 6+ pieces of information should be simplified.

      When to simplify a line of code?

    1. That’s why it was such a life-changing event for me when I found Dash in 2012.

      Offline docs: - macOS: Dash ($30) - Windows/Linux: Zeal (free) - Windows: [Velocity] (https://velocity.silverlakesoftware.com/) ($20) - Web: DevDocs

    1. Also be aware of how Ruby handles aliases and inheritance: an alias references the method that was resolved at the time the alias was defined; it is not dispatched dynamically.
    1. For example, whereas C programmers have argued for years about where to put their brackets, and whether code should be indented with tabs or spaces, both Rust and Go eliminate such issues completely by using a standard formatting tool (gofmt for Go, rustfmt for Rust) which rewrites your code automatically using the canonical style. It’s not that this particular style is so wonderful in itself: it’s the standardisation which Rust and Go programmers appreciate.
    2. If you like the functional style of programming, though, you’ll find a lot more facilities for it in Rust, because Rust has a lot more facilities than Go in general.
    1. The LISP part, though, is not going well. Porting clever 1970s Stanford AI Lab macros written on the original SAIL machine to modern Common LISP is hard. Anybody with a knowledge of MACLISP want to help?
    1. When you run a command like python or pip, your operating system searches through a list of directories to find an executable file with that name. This list of directories lives in an environment variable called PATH, with each directory in the list separated by a colon: /usr/local/bin:/usr/bin:/bin Directories in PATH are searched from left to right, so a matching executable in a directory at the beginning of the list takes precedence over another one at the end. In this example, the /usr/local/bin directory will be searched first, then /usr/bin, then /bin.

      What is PATH?

    1. Now, not every programmer prefers that kind of development. Some programmers prefer to think of development as a process of designing, planning, making blueprints, and assembling parts on a workbench. There’s nothing wrong with that. Indeed, a multibillion-dollar international industry has been built upon it.

      I still think they should worry about it. Production systems need to evolve and contain data; reasoning about the systems completely statically from the source code with no regard to the existing data is a lot more complicated than it needs to be.

    2. In fact, there’s a style of programming, well known in Lisp and Smalltalk circles, in which you define a toplevel function with calls to other functions that don’t yet exist, and then define those functions as you go in the resulting breakloops. It’s a fast way to implement a procedure when you already know how it should work.
    3. Moreover, because the entire language and development system are available, unrestricted, in the repl, you can define the missing function bar, resume foo, and get a sensible result.

      This seems like one of the key points. The ability to edit computations while running. Type holes with resuming gets you most of the way there but there's probably also modifications. I wonder how you can keep it from getting confusing. Something similar to FRP?

  12. Aug 2022
    1. Obnoxious.

      As someone recently pointed out on HN, it's very common nowadays to encounter the no-one-knows-else-what-they're-doing-here refrain as cover—I don't have to feel insecure about not understanding this because not only am I not alone, nobody else understands it either.

      Secondly, if your code is hard to understand regarding its use of this, then your code his hard to understand. this isn't super easy, but it's also not hard. Your code (or the code you're being made to wade into) probably just sucks. The this confusion is making you confront it, though, instead of letting it otherwise fly under the radar.* So fix it and stop going in for the low-effort, this-centric clapter.

      * Not claiming here that this is unique; there are allowed to be other things that work as the same sort of indicator.

    1. Mob requires good communication skills. There is no space for passive-aggressiveness; or arrogance. If You want to show You are better than Your colleagues, You aren’t a candidate for Mob.

      Main requirement of effective mob programming

  13. www.joelonsoftware.com www.joelonsoftware.com