为什么数据流编程不规范?
我编写了一个简单的遗传算法来进化字符串“helloworld”。我写了两次。第一次是用类来写的。第二次仅使用函数编写,其中遗传世界的整个状态从一个函数传递到下一个函数......以模仿数据流范例。令人惊讶的是,代码对于这两种实现都运行良好。然而,我只有在煞费苦心地消除每一个错误后才让它工作,这是一个相当费力的过程。
我问自己……一定有更好的方法。使用类编写代码比使用简单函数编写相同的代码相对困难,并且我相信以可视化方式编写相同的代码,例如使用labview之类的东西比仅使用简单函数编写要容易得多。
就这一点而言,我读过有关数据流编程和可视化编程的内容,坦率地说,以可视化、面向数据的方式进行编程似乎比以语句方式进行编程更自然和直观,这是大多数编程语言使我们能够实现的今天要做的事。我的问题是..如果是这样的话,为什么像“labview”这样的数据流、可视化编程没有成为标准?
I wrote a simple genetic algorithm to evolve the string "helloworld". I wrote it twice. The first time was written using classes. And the second time was written using just functions where the entire state of the genetic world is passed from one function to the next...to mimic the data flow paradigm. Surprisingly, the code worked well for both the implementations. However, I managed to get it working only after painstakingly removing each and every bug, which was quite a laborious process.
And I asked myself.. there has got to be a better way. Write the code using classes was comparatively difficult than writing the same code using simple functions and I believe writing the same code visually, using something like labview for example would be a lot more easier than writing it only using simple functions.
To that extent, I read about data flow programming and visual programming and quite frankly it seems like it is more natural and intuitive to program in a visual, data oriented manner than in a statement-wise manner, which is what most programming languages enable us to do today. My question is.. if this is the case, why hasn't data flow, visual programming like "labview" become the standard?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不相信数据流/“可视化编程”具有几乎设计良好的代码的性能。
基于文本的代码可以表达比任何图形更复杂和微妙的数据结构和流程。它为程序员提供了对复制内容、访问内容的详细控制,以及对步骤顺序的精确控制。我很难理解数据流如何具有如此丰富的表现力。
最终,数据流/可视化编程只能描述已知的事物。文本编程(由于缺乏更好的术语)实际上可以让您表达更多。程序员可以创建尚未以视觉方式表示的全新数据结构和算法。
I do not believe that data-flow / "Visual Programming" has nearly the performance of well-designed code.
Text-based code can express far more complex and subtle data structures and flows than anything graphical. It gives programmers detailed control over what gets copied, what gets accessed, and precise control over sequences of steps. I have a hard time seeing how data-flow could be that expressive.
Ultimately, data-flow /visual programming can only describe things that are already known. Text-programming (for lack of a better term) actually lets you express more. Programmers can create entirely new data structures and algorithms that simply haven't been represented visually yet.
使用单个问题作为如何设计编程语言的基础是危险的。例如,我不确定数据流范例将如何改进 GUI 框架设计。
It is dangerous to use a single problem as the basis for how programming languages should be designed. I'm not sure how the data-flow paradigm would improve GUI framework design, for instance.