程序员编程培训(程序员,从培训班出来的都是垃圾?)

程序员编程培训Thanks to a proliferation of free online tutorials, virtually anyone can learn how to code. Once you’ve been a developer for a while though, you

本文最后更新时间:  2023-03-17 08:59:51

程序员编程培训

Thanks to a proliferation of free online tutorials, virtually anyone can learn how to code. Once you’ve been a developer for a while though, you quickly start to realize that all code is not created equal. Programming forums are awash with horror stories detaiLing ginormous if-else blocks, massive spaghetti-like algorithms and redundant code that serve no purpose.

由于免费在线教程的大量增加,几乎任何人都可以学习编码。 一旦成为开发人员已有一段时间,您就会很快开始意识到并非所有代码都是平等的。 编程论坛上充斥着恐怖的故事,详细描述了巨大的if-else块,大量类似于意大利面条的算法以及毫无用处的冗余代码。

While these may seem like rookie errors that only bedevil persons just starting out, many programmers carry on these bad habits well into their career with disastrous results.

尽管这些看上去像菜鸟般的错误,只是让那些刚起步的人迷上了,但许多程序员却将这些不良习惯带入了他们的职业生涯,并带来了灾难性的后果。

Image Source

图片来源

Below are some of the useful principles of programming that you must keep in mind while writing code.

以下是编写代码时必须记住的一些有用的编程原理。

1.简单性(1. Simplicity)

Simplicity is the ultimate sophistication and perhaps nowhere more than in programming. It all begins with how you document and dissect program requirements. Each requirement should be well articulated to the extent that once you start to code, you can satisfy these requirements using the simplest of techniques.

简单性是最终的复杂性,也许在编程中无处不在。 这一切都始于您如何记录和分析程序需求。 每个要求都应明确阐明,以便您开始编码后就可以使用最简单的技术来满足这些要求。

Complex code not only takes more time to design and write but is also more vulnerable to errors and bugs. A labyrinth of code can makeweb app monitoringtedious. Beware of feature creep where you start to add new features to the program that the customer didn’t ask for as this only needlessly entangles the software.

复杂的代码不仅需要花费更多的时间来设计和编写代码,而且更容易出错和出现错误。 迷宫般的代码会使Web应用程序监视变得 乏味。 当心功能蔓延,在这里您开始向客户不需要的程序添加新功能,因为这只会不必要地纠缠软件。

2.不要重复自己(2. Do Not Repeat Yourself)

Minimal repetition is a sign of quality code. Avoid duplicating logic and data. To know whether your program has excessive repetition, think about how much code you’d need to modify if you wanted to alter one aspect of the application’s behavior.

重复最少是质量代码的标志。 避免重复逻辑和数据。 要知道您的程序是否重复过多,请考虑如果您想改变应用程序行为的一个方面,需要修改多少代码。 上一页123下一页

温馨提示:内容均由网友自行发布提供,仅用于学习交流,如有版权问题,请联系我们。