Better HN
topnewbestaskshowjobs
Log inSign up

simpaticoder

2,816 karma · joined Apr 3, 2023 (3y ago) · 658 submissions

Distributed programming Java and Node expert. Email me at hello@simpatico.io.
Submissions

comment 2y ago · link · parent

It is the rare instructor or mentor that takes pains to NOT show off their expertise, and model the expected behavior, tools, and techniques of the learner where they are at. It is the classic problem of telling someone the goal, but not how to get there. A common error-mode is repeating "the magic" over and over again, expecting it to sink in; it takes extra effort to decompose the magic into teachable, practicable parts. This teaching effort requires meta-cognition and empathy orthogonal to the effort required to become an expert, which is why expert teachers are a rare and precious gift.

comment 2y ago · link · parent

A good technique I've used as well. Call it "iterative literate programming".

comment 2y ago · link · parent

Keep trying. Try different methods. What works for me debugging and refactoring distributed systems may not work for you. The thing I tend to drive toward is a single page mind-map-like artifact that is monotonically increasing in density with a focus on system-of-record and data flow. I tend to keep notes about individual tech and important systems in whatever tools are handy, either locally or in a form that are accessible to the team. Often this takes the form of a JIRA page per topic, or an nvAlt note per topic. Tickets aren't great for this because they are ephemeral. These notes are where code snippets, error messages, anything searchable, go. I have something like the Zettlekasten[1] method in the back of my mind when deciding on scope of these support notes. However I may also start from a simple local text file, not committed to the repository, or even attached as a note to a ticket or other ephemeral trigger. But the thing that ties it all together, for me, is that mind map. Once I have that I can truly reason about the system.

1 - https://zettelkasten.de/introduction/

comment 2y ago · link · parent

The benefit of journaling is not just reentry, but that you begin to solidify the mental model into a concrete branching of possibilities that is tightly coupled to the specific problem. Your work becomes traversal and mutation of this tree. Several benefits accrue: you begin to see gaps in the tree, and can fill them in. You begin to have confidence in your mental model, recovering the time you used to spend going over the same nodes again and again in a haphazard way. In distributed systems in particular, the work is often detailed, manual, error prone and high latency - with a solid mental model you can get through a checklist of steps with minimum difficulty and high confidence that you didn't miss anything. This ability to take something abstract and make it more concrete on the fly is a critical skill.

Perhaps the greatest barrier to using it is akin to envy. We see others who apparently do this without written materials, in their head. I think we see this as evidence of intellectual superiority and harbor the doubt that using an aid like a journal means we are somehow lacking in skill or ability. This is wrong. Using an aid to map out complex problems isn't a failure, it's essential, especially for problems in systems you've never used before. Over time you may yourself build up your expertise such that you no longer need the aid, but that doesn't signal anything about your intelligence or ability either, only your experience.

comment 2y ago · link · parent

Hades has total control over the (physical) rules of the underworld[1]. Hades can make the stone roll back for arbitrary reasons. But keeping hope alive in Sisyphus is the harder problem. Hades can essentially force Sisyphus to keep trying by making it arbitrarily painful to stop trying, but then hope is no longer his motivation. Hades could reset Sisyphus' memory such that hope remains, but then this loses the profundity of an eternal punishment.

The more interesting case is that Sisyphus can contemplate the nature of the system, and reason toward an out that involved undermining Hades power over the Underworld. If he could pause and do experiments, discover the limits of the enchantment, and work around them, that would be ideal. However such an option would also be an excellent way for Hades to extend and deepen the severity of the punishment. A god's arbitrary power is arbitrarily powerful, after all.

1 - https://en.wikipedia.org/wiki/Sisyphus

comment 2y ago · link · parent

There is an interesting tension in software between measurement and validation. The two concerns are often conflated, resulting in software systems that cannot measure the world as-it-is. The world (more precisely, measurements of the world) may be in (and often is in) an 'invalid' or 'inconsistent' state. Software can only help you detect and resolve such states if it is capable of representing them.

comment 2y ago · link · parent

Idempotent, deterministic builds are an argument in favor of synthetic virtual machines. Synthetic VMs like the JVM or CLR should, at least insofar as they don't contain native code, execute in a manner largely isolated from the vagaries of minor hardware/OS differences. Not an expert, but native VMs do not and cannot isolate processes from hardware details (e.g. Xen, Virtual Box), or from OS details (e.g. Docker, containerd).

comment 2y ago · link · parent

"And it seems the mood right now is to run away from screens."

I don't think this is true. Like cigarette smoking in the mid-20th, the elite are realizing how harmful screens are, and are starting to turn the wheels of awareness and regulation to the fact of harm. But the message hasn't landed. The same struggle will ensue, but the institutional elite are far less powerful than they were then, and it's not clear that it will work. We will be left to our own devices (so to speak), and it will be up to individuals to do what is right for their minds, and look on with sorrow at the damage screens are doing to the very fabric of civilization. It is a great mercy that the bleeding always stops, one way or another.

comment 2y ago · link · parent

"Don’t underestimate the value of digging into history to investigate some bugs." Valuable advice, and it particularly highlights the risk of global state and the benefit of understanding your runtime. Browsers have popularized flamegraphs, stack traces show you the frames down to the moment of error, but global state survives multiple stack traces and the one you're looking at may not be (probably isn't) the cause of the problem. There is global state, the heap, external systems, etc that change over time and with successive calls. This is true even in single-threaded environments, and is far more complex in general multi-threaded environments. I often feel this isn't clear to beginners nor is it clear to them how you go about investigating bugs within this context.

comment 2y ago · link · parent

This problem came up for me when writing a tool to help an author index his work. He wanted to be able to enter reference ranges for a term and then combine, including disjoint ones, into a single entry. (There was also a roman numeral problem irrelevant here).

This has also come up for me in two dimensions when dealing with overlapping rectangles. For some reason the complexity of it surprised me both times. Sadly computing these cases is a straight-forward slog in 1-D; you can however reuse the solution for higher dimensions in a nice way.

comment 2y ago · link · parent

If you'd be willing to share those optimizations, I (and many others, I would guess) would be deeply grateful.

comment 2y ago · link · parent

The more pernicious form of this, in my experience, are ignored compiler/linter/test warnings. Many codebases have a tremendous number of these warnings, devs learn to ignore them, and this important signal of code quality is effectively lost.

comment 2y ago · link · parent

My first-gen Framework 13 with Ubuntu is usable, but has major issues around power. Battery life is very poor compared to ordinary laptops (I get ~3 hours of web browsing and light coding), and compared to M-series Macbooks (which have extraordinary battery life >8 hours) it is abysmal. Suspend/resume often fails in strange ways, and occasionally even power on is problematic (e.g. battery is full but it won't turn on without being plugged into a charger). Repair-ability and running OSS software is an idealistic goal that I share, however in practical terms the need to repair a laptop is very rare. So when it breaks, I'll be well ahead of the curve; when it doesn't, which is most of the time, I'm behind the curve.

comment 2y ago · link · parent

When it comes to a measured time-series, the function is always discrete and arbitrary; there is no 'curve' like that generated by a function well-defined on the reals, and so there is no real closed-form derivative. In this context derivatives are not equations so much as derived data, reducing two points to one. And this process is recursive, such that you can take 4 points, reduce the two adjacent ones to 1 point, and then reduce those two into 1 point. In fact for 2^n points you can get the nth derivative in this way. The utility of this data is highly questionable in almost every context, but its available for every time-series. (One application that comes to mind is a kind of checksum, where you recursively derive a time series and stop when local neighbors go to 0, and you're left with a sparse list of high-order numbers that in some sense characterize the series.)

comment 2y ago · link · parent

Your statement is consistent with my point which I mean to point out the psycho-social origin of such constructions and therefore the limits of their utility. I do not say they are not useful at all.

comment 2y ago · link · parent

We must remember that these constructions retcon the actual human experience with numbers, which is firmly rooted in counting and measurement, that always come after this experiential basis. Formal definitions appear driven by an aesthetic consensus, mostly about minimalism and axiom flavor. Individual human experience with numbers reflects human history and at both scales 'counting and measurement' is more fundamental in the sense that it always comes first, and therefore all constructions derive from it, must maintain consistency with it, and conflicts must be resolved within it, and it is safe to ignore inconsistencies that can't be expressed within it.

comment 2y ago · link · parent

It would be remarkable indeed if humans can invent a technology that sequesters carbon faster than self-replicating, adaptive, distributed independent biological machines that have been around for billions of years, also known as "life", which use CO2 in the atmosphere for most of their body mass. Whatever the technology, it would require something (currently science fiction) like industrial scale fusion power generators, or a miracle improvement in solar cells.

comment 2y ago · link · parent

Gen AI increases the demand for software engineers, but software engineers increase the demand for AI for code assistance. You are right, of course, but the number of programmers not using AI code assist will asymptotically approach some very low minimum, thanks for the productivity boost. I keep hearing "3x" and that feels about right to me. The same could not be said for intellisense, or at least is harder to quantify.

comment 2y ago · link · parent

Yes, but it will strongly decrease demand for new ideas. AI is a "win more" technology for current software architecture incumbents. The more popular a tech is, the more content there is about it, the more capable an LLM is of giving a usable answer. A programmer who relies on LLMs for coding assistance will be far less likely to try something new, and it will have a chilling effect on the adoption of all new tools, architectures, and libraries.

comment 2y ago · link · parent

If you're looking to be inspired to take the plunge into car repair, check out M359 Restorations YouTube channel[0]. It's a one-man shop in Frankfurt that specializes in BMW restorations. It's a good look into what it takes to do projects like this well: the tools, the space, the knowledge of the secondary market and parts suppliers, and when/how to repair a component rather than buying a new one. He does use repair manuals for some things, especially engine rebuilds, but a lot of what he does is based on "what looks right" to a person doing this for the last 10-15 years.

As a beginner looking to start with minimal infrastructure, he does some of his restorations outside his shop, often in borrowed personal garages of subscribers. Project Salt Lake City is a good example [1]. For someone looking to do a more advanced repair (arguably the most advanced possible) there are some good engine rebuilding videos, especially with Project Frankfurt[2].

One thing I find surprising is that he still uses a lot of 3rd party services. AC dis/charging, wheel alignment, tire mounting and balancing, dynamo measurement, block reconditioning, head and supercharger refreshes, and even car detailing (which he seems to be actively trying to avoid doing despite his instincts because it is a huge time sink). He is a dynamic, adaptable node in a fascinating, specialized capital network.

0 - https://www.youtube.com/@M539Restorations

1 - https://www.youtube.com/watch?v=_a9rCI2zfPM&list=PLBcFoVFuPC...

2 - https://www.youtube.com/watch?v=qyqZoNwKeOM&list=PLBcFoVFuPC...

comment 2y ago · link · parent

This comment has an off-by-one error.

comment 2y ago · link · parent

Conceptually, I've come to think of containers as a kind of "known-good starting point", the origin of a coordinate system where "movement" is adding things. A set of Dockerfiles form a trie where each line of the Dockerfile is a node in that trie's branch. The great benefit of containers is that they allow you to reach any possible point in the space for a single process, without affecting any other. The other features of containers are, to me, secondary, things like container images, or even access or resource control. The main draw of the tool is giving the user a declarative way to move reliably and repeatedly through system-space, and to do so for any number of processes. (The main cost is the ~20% overhead such a system incurs).

comment 2y ago · link · parent

Async/await vs threads is yet another entry in the ~800 volume ongoing series "Where the Indirection Go?" In this case, you put concurrency inside the process (async) or outside the process (threads). Your CPU is, in both cases, constantly rotating between workloads, and that indirection can be inside or outside the process. Once you start caring about either human usability or fractional performance, the distinction matters. Otherwise, it doesn't.

comment 2y ago · link · parent

Yes, it's a neat thing. I use a node script[1] that wraps the chrome invocation to do CLI driven acceptance testing with a node script that loads the site acceptance tests[2]. I adopted the simple convention to remove all body elements on successful completion, and checking the output string, but I've also considered other methods like embedding a JSON string and parsing it back out.

1 - https://simpatico.io/acceptance.js

2 - https://simpatico.io/acceptance

comment 2y ago · link · parent

Your example shows taking a subset of a text node and wrapping in a tag. How many XML languages use this quality? The only ones I've ever worked with go to great lengths to not mix text nodes with other children nodes. And it's easy to see why such usage is considered poor practice: if you're making a language, you generally want more structure, not less.

I'm not familiar with the distinction between 'markup languages' and 'data languages'. Ignoring the text/structured mixing issue, which I think is vestigial in XML and unused in DSLs, these are all isomorphic to each other and can nest data inside of data in a similar way:

    <person>
        <name>John Doe</name>
        <age>30</age>
        <city>New York</city>
        <employment>
            <position>Software Engineer</position>
            <company>ABC Tech</company>
            <years>5</years>
        </employment>
    </person>
    
    {
        "person": {
        "name": "John Doe",
            "age": 30,
            "city": "New York",
            "employment": {
                "position": "Software Engineer",
                "company": "ABC Tech",
                "years": 5
            }
        }
    }

    person:
      name: John Doe
      age: 30
      city: New York
      employment:
        position: Software Engineer
        company: ABC Tech
        years: 5

comment 2y ago · link · parent

If you squint at XML, JSON, or YAML you see a kind of lispy data-structure shape, an n-arry tree. The reader has a context stack that they are pushing and popping from as they read. The real problem is that every problem space is isomorphic to one that has successively tighter context. And a format that is applicable to every problem is one that is applicable to no problem. I believe that computer languages must get worse at some things to get better at others in a zero-sum way. Any attempt to avoid this trade-off leaves you with a very powerful mush.

comment 2y ago · link · parent

Yes, it would often offer unwanted and/or incorrect suggestions that I found distracting. It did not justify the 10% of useful suggestions it made. My usage pattern turns out to be quite copy/paste friendly - it leaves my editor quiet but still gives me the ability to answer "knowledge gap" type questions.
1
171819
22