开发者

no procedural code and non mvc in ruby and python?

开发者 https://www.devze.com 2022-12-18 21:56 出处:网络
i know that these 2 languages require oop. but inside the classes, could you have procedural code? and for the mvc part, that pattern comes with their frameworks right?

i know that these 2 languages require oop.

but inside the classes, could you have procedural code?

and for the mvc part, that pattern comes with their frameworks right?

nothing to do with the actual language 开发者_Go百科itself?


Neither of these languages require OOP, especially Python. In Python you can write as many ordinary functions as you want, and there are plenty of modules which don't define any classes. In Ruby you can do the same thing, except instead of functions you have methods on a module.

You are correct that MVC is related to the frameworks and not to the languages themselves.


They don't require OOP, but they do require procedural code, as they are imperative languages, and not functional ones. You can use some functional techniques.

There are plenty of frameworks that use MVC for both languages, yes.

0

精彩评论

暂无评论...
验证码 换一张
取 消