(评论)
(comments)

原始链接: https://news.ycombinator.com/item?id=43751076

Hacker News上的一篇讨论围绕着一篇文章展开,该文章称赞管道化是编程语言中最喜欢的特性之一。评论者们就作者过分关注语法而忽略语义,以及调试长管道带来的挑战展开了辩论。“管道化”一词的含义模糊不清,因为它涵盖了方法链、运算符重载和一等函数,也引发了大家的担忧。一些用户建议使用“窥视步骤”之类的调试技巧。其他人则重点介绍了各种语言中的管道化实现,包括R的tidyverse、Elixir(使用`|>` 运算符)、C#的LINQ和Scala。一位Python用户抱怨说,对象方法默认不返回`self`,这阻碍了管道化。还提到了Python的替代库Pipe和pipetools。最初的文章也被认为是一篇轻松的“热议”。


原文
Hacker News new | past | comments | ask | show | jobs | submit login
Pipelining might be my favorite programming language feature (herecomesthemoon.net)
22 points by Mond_ 44 minutes ago | hide | past | favorite | 10 comments










While the author claims "semantics beat syntax every day of the week," the entire article focuses on syntax preferences rather than semantic differences.

Pipelining can become hard to debug when chains get very long. The author doesn't address how hard it can be to identify which step in a long chain caused an error.

They do make fun of Python, however. But don't say much about why they don't like it other than showing a low-res photo of a rock with a pipe routed around it.

Ambiguity about what constitutes "pipelining" is the real issue here. The definition keeps shifting throughout the article. Is it method chaining? Operator overloading? First-class functions? The author uses examples that function very differently.



You can add peek steps in pipelines and inspect the in between results. Not really any different from normal function call debugging imo.


The article also clearly points that that it's just a hot-take, and to not take it too seriously.


The tidyverse folks in R have been using that for a while: https://magrittr.tidyverse.org/reference/pipe.html


If Python object methods returned `self` by default instead of `None` you could do this in Python too!

This is my biggest complaint about Python.





LINQ is easily one of C#'s best features.


That's also why I enjoy elixir a lot.

The |> operator is really cool.



I miss F#


This is why I love Scala so much






Join us for AI Startup School this June 16-17 in San Francisco!


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



Search:
联系我们 contact @ memedata.com