《C/C++实用状态图》封面

C/C++实用状态图

Practical Statecharts in C/C++

Miro Samek · 初版 2002 年

1人推荐
3位读者提及
4次提及

Hacker News 上怎么说

  • 《Practical Statecharts in C/C++》:https://www.amazon.com/Practical-Statecharts-Quantum-Program... 或者更普适地说,去研究一下 Hierarchical State Machines。里面有一些见解你可以应用到自己的状态机上,会……

    Practical Statecharts in C/C++: https://www.amazon.com/Practical-Statecharts-Quantum-Program... Or more generically, look into Hierarchical State Machines. There's a few insights that you can apply to your state machines that will…

  • Miro Samek 博士的《Practical Statecharts in C/C++》(2002)里,也用了一个(有 bug 的)Windows 计算器来演示概念:[pdf] https://www.state-machine.com/doc/PSiCC.pdf

    A (buggy) Windows calculator is also used to demonstrate concepts in Dr. Miro Samek's Practical Statecharts in C/C++ (2002): [pdf] https://www.state-machine.com/doc/PSiCC.pdf

  • > 没有样板代码的 OOP。确实同意。Samek 博士也是这么说的,并且在《Practical Statecharts in C/C++》里展示了一个面向对象的 C 语言版本,即 C+。谢谢你的回复。如果你碰巧看到这条评论,我想问问关于具象化(reification)的问题。模式是思想,设计则具象化——“实现”——了该模式。而别的东西——无论是代码,……

    > OOP without the boilerplate Agreed. Dr. Samek says as much too and presents an object-oriented version of C, C+, in Practical Statecharts in C/C++. Thank-you for your replies. If you happen to see this comment, I wanted to ask about reification. The pattern is the idea, the design reifies--"makes real"--the pattern. Something else--whether code,…

  • ……状态转换不过是换了个马甲的“goto”。状态机自有其用武之地,但往往是 write-only 的(极难阅读和修改),因此理想情况下应该越小越少越好。以前在一家公司待过,那帮人全喝了 Miro Samek《Practical Statecharts in C/C++》的 kool-aid(彻底被洗脑)……捅了好多篓子。所以只要能把 control flow 线性化的地方,我都改用这种 pattern。如果结合这种 pattern 还需要状态机,我直接用 goto 就行。关于把……深表同感

    …State transitions are "goto" by another name. State machines have their place but tend to be write-only (hard to read and modify) so are ideally small and few. Worked at a place that drank Miro Samek's "Practical Statecharts in C/C++" kool-aid... caused lots of problems. So instead I use this pattern everywhere that I can linearize control flow. And if I need a state machine with this pattern I can just use goto. Agreed re: making…

正在加载完整评论……

键盘快捷键

/
聚焦搜索框
j / k
下一本 / 上一本
Enter
打开选中的书
Esc
关闭 / 返回
g h
回到首页
g b
值得读精选
g t
历史总榜
g r
上升最快
g l
我的书架
?
显示本帮助