Hacker News new | past | comments | ask | show | jobs | submit | mitnk's comments login

R.i.P - My id was originated from his name..




Nice series, thanks.

In day2, the author refactored some "old-school" code[1], I'd say I prefer the old-school version (the new version is less readable to me). Old-school is not out-dated nor in-correct IMO.

[1] https://ibb.co/C0cYbdt


The `times` solution was overhtought, and later I get rid of it. In the end, the code of cycle like this are handled with `range`, for example:

    var points = range(resolution).map(
      i => ({x, y: y - (i * height) / resolution})
    )
The point of the rewriting `for()` cycles is not some abstract "making them new and shiny", but expose _meaning_ (in a way that would be obvious for _my reading habits_). Generally speaking, `for()` is "how we do" instead of "what we are doing". It might mean a lot of things; porting it into `map`, or `filter`, or `zip`, etc. allows to review and rethink what was the point of iteration.

As you might see in the final code[1] the initial "cycle of noise generation" you are pointint to was gone at all (because several iterations of "making it one phrase" made it obvious that it has no context of its own, and should just be embedded in a points generation).

With that being said, I explicitly stated many times throughout the diary I don't expect the approach to be for everyones liking.

[1] https://github.com/zverok/grok-shan-shui/blob/main/grok.html...


Is there a DR version of github.com's?


pkg.go.dev --> go.dev/pkg/ would be better.


For what reason?


There is always a group of people wanting to "hack" terminals into GUI-targeting, glittering app ;)


Another direction to learn Linux/Unix is spending time to learn from decent books like TLPI.

https://man7.org/tlpi/


For `touch a b; echo "$(echo "$(echo "$(ls)")")"`, I'll think about it.

It looks like a bad command to me (nested $ and nested `"` do not smell good). Probably I would mark this a wont-fix. But if I found I does make sense (useful in some meaningful places) - I'll consider to update cicada to align with Bash. Thanks for reporting.


Nested $() is fine, and not uncommon (though 3 levels like here is rarely used). All the nested "" present here are required, as removing any of them would cause a change in behavior (caused by word splitting).


# you have to use full path to make it work:

cicada> /bin/1

A bare `1` is a math arithmetic, as described in README, which with a higher precedence.


Perhaps you should consider removing the statement "Cicada will only be a "subset" of bash" from the project FAQ.


Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: