ferd

Joined 15 years ago

Karma
226
Submissions
42
Member since
Jan 3
https://neuroning.com
View on Hacker News

Recent submissions

Comment · 22 hours ago
thanks! yes
Comment · 1 day ago
For terminal/cli freaks, I've just cooked a tool to view all kind of documents right on your kitty terminal

  https://github.com/dobladez/clview
I needed it. Feedback welcomed!

About to push a big optimization for big directories/collections

Comment · 22 days ago
M PLUS Code https://mplusfonts.github.io/

The most underrated font ever.

Comment · 29 days ago
here... sysop of Sudaka's BBS :-)
Comment · 1 month ago
Is inner-ear cell regeneration included in #06?
Comment · 5 months ago
Shameless plug: a code walkthru modeling the rules of chess, ment as an exercise/teaching functional programming (in Clojure):

https://neuroning.com/boardgames-exercise/notebooks/walkthro...

The implementation makes it really easy to add new piece types or rules. For example, here's the full logic for rooks (sans castling):

  (defn expand-pmove-for-rook [pmove]
    (->> pmove
      (expand-pmove-dirs [↑ ↓ ← →])
      (pmoves-discard #(or (pmove-on-same-player-piece? %)
                           (pmove-changed-direction? %)))
      (map pmoves-finish-capturing-opponent-piece)
      (pmoves-finish-and-continue))))
Comment · 7 months ago
Thanks. Tried, but doesn't look good :-(
Comment · 7 months ago
I really like Monaspace Argon, but even the narrower option looks too wide on my terminal (kitty on macos)
Comment · 8 months ago
yes! don't remember my number, Zone 4 for sure (Argentina).

Exchanging messages with people on the other side of the world felt like magic at the time (even though it took many hours/days for a msg to round-trip)

I also run "Sudaka's BBS" based on Maximus/2, with many interactive "apps" I'd developed using Maximus' proprietary C-like language. Great high-school times.

I can still hear my parents complaining about my monopolizing the phone line every night :-)

Comment · 11 months ago
I've had tinnitus for about 12 years now. High-freqquencies hearing loss. I've been using hearing aids for about 4 years... They DO help me with both hearing (of course) and tinnitus.

For example, driving a car without the aids makes my tinnitus really bad (due to the background noise of the car/engine/wind/road). With aids it's a lot less of a problem.

One fear I have is if hearing aids cause even more hearing damage (after all, what they do it inject amplified sound into you ear... the exact same thing that most doctors tell you NOT to do to avoid hearing damage)... Experts tell me they don't, but without any reasonable explanation.

Comment · 11 months ago
How so? Not sure what you mean.

If object A calls a method of object B (composition), then B cannot call back on B, and neither A nor B can override any behavior of the other (And this is the original core tenet of OO: being all about "message-passing").

Of course they can accept and pass other objects/functions are arguments, but that would be explicit and specific, without having to expose the whole state/impl to each other.

Comment · 11 months ago
> I'd argue some amount of "co-recursion" is to be expected: after all the point of the child class is to reuse logic of the parent

That's the point: You can reuse code without paying that price of inheritance. You DON'T have to expect co-recursion or shared state just for "code-reuse".

And, I think, is the key point: Behavior inheritance is NOT a good technique for code-reuse... Type-inheritance, however, IS good for abstraction, for defining boundaries, to enable polymorphism.

> I'd say this is a fact of life for all pieces of code which are reused more than once

But you want to minimize that complexity. If you call a pure function, you know it only depends on its arguments... done. If you can a method on a mutable object, you have to read its implementation line-by-line, you have to navigate a web of possibly polymorphic calls which may even modify shared state.

> This is another reason why low coupling high cohesion is so important

exactly. Now, I would phrase it the other way around though: "... low coupling high cohesion is so important..." that's the reason why using inheritance of implementation for code-reuse is often a bad idea.

Comment · 11 months ago
You are always dealing with state and control-flow in software design. The challenge is to minimize state at much as possible, make it immutable as much as possible and simplify you control-flow as much as possible. OO-style inheritance of implementation (with mutable state dispersed all over the place and pinball-style control-flow) goes against those goals.

Closer to the "ideal": declarative approaches, pure functions, data-oriented pipelines, logic programming.

Comment · 11 months ago
I've seen it a lot on Django projects. Maybe I was just unlucky on the Python projects I've joined.
Comment · 11 months ago
Good point. In Java and many other languages you can opt out instead... which might make a big difference. Is it more of a "cultural" thing?... again, many frameworks encourage it by design, and so do many courses/tutorials... so those devs would be happy to put "virtual" everywhere in C++

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton