Readit News logoReadit News
treetide commented on Ask HN: It's 2022. Where should I direct the youths to learn about programming?    · Posted by u/slyrus
empressplay · 3 years ago
turtleSpaces is a 3D Logo environment that allows fit pretty straightforward creation of simple 2D and 3D games in the browser using turtles and can provide a bridge between Scratch and Python https://turtleSpaces.org
treetide · 3 years ago
Loose connection, but made me remember https://code.world/ uses a Haskell-like functional language to define still pictures, animations, or even games.
treetide commented on Unknown Values: The Secret to Terraform Plan   log.martinatkins.me/2021/... · Posted by u/sensiquest
treetide · 3 years ago
I suspect you could implement this as a Haskell DSL.

The discussion part where you are not allowed (from Terraform lang) to create behavior dependent on the actual values of "Unknown" values (to prevent an ambiguous / non-deterministic plan), reminds of Applicatives vs Monads a bit.

(Sketchy potentially non-100% true illustration ahead)

For example, if you write a command-line parsing library using a Monad, then the set of command-line options is not an upfront fixed set easy to list with --help, but can change depending on previous command line options (here the command line parsing can peek into the upfront "Unknown" values, the options used and their values, to generate even more options).

While if you write it using Applicative, then peeking into the actual values is not possible, you can't create branching behaviour.

treetide · 3 years ago
...but maybe you don't need to go as far as Haskell. Any language with generics could work, like Java. (Or well, void pointers or anonymous interfaces..). Just make sure the user-written plan code doesn't get any meaningful info about the unknown values, only able to pass it around.
treetide commented on Unknown Values: The Secret to Terraform Plan   log.martinatkins.me/2021/... · Posted by u/sensiquest
treetide · 3 years ago
I suspect you could implement this as a Haskell DSL.

The discussion part where you are not allowed (from Terraform lang) to create behavior dependent on the actual values of "Unknown" values (to prevent an ambiguous / non-deterministic plan), reminds of Applicatives vs Monads a bit.

(Sketchy potentially non-100% true illustration ahead)

For example, if you write a command-line parsing library using a Monad, then the set of command-line options is not an upfront fixed set easy to list with --help, but can change depending on previous command line options (here the command line parsing can peek into the upfront "Unknown" values, the options used and their values, to generate even more options).

While if you write it using Applicative, then peeking into the actual values is not possible, you can't create branching behaviour.

treetide commented on Improving GitHub Code Search   github.blog/2021-12-08-im... · Posted by u/todsacerdoti
dvirsky · 4 years ago
Are there any open source powerful code search engines out there? As a Googler the internal code search we have here is one of the most incredible things I've ever seen, it's so fast and powerful I'm amazed by it daily. Is there anything near that quality out there?
treetide · 4 years ago
For the grepping aspect, https://github.com/google/zoekt is a powerful one-stop-shop. For the navigating, I don't know. SourceGraph maybe, but the linking is somewhat heuristic I assume, not compilation-graph powered. But maybe that changes or depends per language.
treetide commented on Motivation – Keli Language   keli-language.gitbook.io/... · Posted by u/azhenley
cannabis_sam · 5 years ago
> An api that was written to simply process a list of Orders into a Report might be abstracted into a fold on some monad, which at first seems a great idea. But if you're not careful, readability suffers a lot. It's much easier to get to know an application when its code deals with business objects that you already understand well, than to read hundreds of lines of code that deal only with abstractions.

Do you have a code example? It would be interesting to see what this kind of code looks like.

Personally, I find complaining about a ”fold over a monad” to be equivalent to complaining about an ”integer indexed loop over an array”. It’s a pretty straightforward implementation detail that have very little to do with your business logic.

And business logic is far, far easier to model using ADTs (it’s literally just AND and OR, applied to data structures) than confounding object inheritance hierarchies.

In fact, I’ve seen a lot more unnecessarily abstracted garbage (usually “design pattern” workarounds to limitations in the object model) in just about every oop based web framework I’ve worked with.

treetide · 5 years ago
I just wrote about some possible pitfalls down the ADT route: https://treetide.com/posts/domain-model-pitfalls-oop-fp.html

> As more operations are demanded, it is more likely that the existing partitioning of the world into the nice distinct cases won’t suit that operation anymore. Then, as a fix, we can introduce more specific cases, or make existing ones more general - leading to ambiguity, bloat and mental load for the existing operations.

Just an aspect.

treetide commented on Show HN: Coding Career Handbook   learninpublic.org/?from=H... · Posted by u/swyx
claudiulodro · 5 years ago
Please don't take this the wrong way; I am genuinely curious. As far as I can tell, you've been a professional developer for approximately 2 years. What qualifies you to instruct people how to manage their dev career, let alone charge $40+ for the advice?
treetide · 5 years ago
About the $40+ for the advice part - seriously, that is a few hours of developer salary. Compared to the few days it would take reading, it is essentially nothing.

Now the question is, investing those few days total saves you more worries. And doesn't derail you. That's hard to evaluate, and I don't attempt to. But for information, $40 is cheap.

treetide commented on Show HN: Coding Career Handbook   learninpublic.org/?from=H... · Posted by u/swyx
treetide · 5 years ago
Shameless plug: my work-in-progress book Programming Without Anxiety [0] might be interesting for you. It got a bit of scope creep which I'll have to cut back on, but I'm pretty enthusiastic about the content so far.

[0]: https://treetide.com/book/programming-without-anxiety.html

u/treetide

KarmaCake day2July 1, 2020View Original