具有严重面向对象约束的编程范式
嘿。我记得在某处读到过关于编程范式的内容,该范式对面向对象有非常严格的限制。它完全禁止嵌套的 if 和 else,避免全局命名空间中与类不关联的函数,等等。据说还蛮有名的有谁知道它怎么称呼?谢谢。
我举个例子。这不应该是一个完全严肃的范例——它只是为了改进你的“面向对象风格”的严格限制。例如,在 FizzBuzz 程序中,您将创建一个继承自整数并具有方法“representMyself”的对象,以及一个对象“FizzBuzzNumbersRange”,该对象使用“representAll”方法保存 FizzBuzz 数字数组或其他内容。等等等等
Hey. I remember reading somewhere about a programimng paradigm that has very tough restrictions about OO. It forbids nested ifs and elses entirely, avoid functions in the global namespace not associated with a class, and stuff like that. It's supposedly pretty famous. Does anyone know how it is called? Thanks.
I'll give an example. This is not supposed to be a totally serious paradigm - its just heavy restrictions to improve your "OO style". For example a FizzBuzz program you'll make an object that inherits from integer and has a method 'representMyself', and an object 'FizzBuzzNumbersRange' which holds an array of FizzBuzz numbers with a method 'representAll', or something. etc. etc.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您指的是物体健美操,它具有以下规则:
方法
两个实例变量
特性
I think you're refering to Object Calisthenics which have the following rules:
method
two instance variables
properties