如果我是项目中唯一的开发人员,是否还需要使用封装? [英] If I'm the only developer on a project, do I still need to use encapsulation?

查看:83
本文介绍了如果我是项目中唯一的开发人员,是否还需要使用封装?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我总是听到,只要编写面向对象的代码,就需要封装。如果我是项目中唯一的开发人员,是否还需要使用封装?

I always hear that we need to encapsulate whenever we write object-oriented code. If I'm the only developer on a project, do I still need to use encapsulation?

推荐答案

一种给出答案的方法:从概念上讲,存在封装用于编写更好,更安全,更不易出错的代码。首先,它不存在,以方便团队一起处理代码(这可能是副作用,但这不是目的)。

One way to put an answer: Encapsulation, conceptually, exists for writing better, safer, less error-prone code. It doesn't exist, primarily, to facilitate teams working together on code (that might be a side effect, but that's not the purpose).

封装的商品试图将规模从一个编码员扩大到许多编码员,尽管这些货物在项目和团队规模越大的情况下可能会表现出更强的表达力,但它们确实与编码员数量无关。

So the goods that encapsulation seeks to foster scale from one coder to many coders, and they are goods that do not really have to do with the number of coders, although those goods may find stronger expression the larger the project and teams are.

这篇关于如果我是项目中唯一的开发人员,是否还需要使用封装?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆