5-tips-for-creating-good-code-every

优秀程序员的五大习惯
本文介绍了成为一名优秀程序员的五个关键习惯:制定每日待办事项清单、专注于单一任务、确保工作质量、彻底完成每一项任务以及适时调整解决方案。通过遵循这些实践,程序员可以提高工作效率并保证代码质量。
成为一个优秀的程序员和成为其他优秀的专业人员一样,需要尽可能多的做一些有质量的工作。有句很流行的话可以总结:做,正确做事,立马就做。(Do it. Do it right. Do it right now)
  1. 将一天要做的事情列成清单
  完成复杂活动(activity)的最好方法是将其拆分成简单的各项活动。每天早上,将你一天要完成的活动进行拆分,然后制定一个相应的日程安排表,这样能够帮助你:
  更好的理解这个活动。
  每天都有一个集中的目标。
  提高你的估计能力,几天之后,你会发现你能预测一天的工作量。
  2. 一次只做一件事
  集中于一项任务比同时做多项任务更多产,不同的研究已经证明这个观点,并且发布在不同的媒体上(例如CNN)。
  集中精力工作25分钟,休息5到10分钟。你可以用诸如“番茄工作法”这种流行的技术来帮助你管理时间。还有工具能帮助你测量你花在各项不同任务上的时间,我最喜欢的是CoolTimer,这里也有10个不错的时间追踪应用程序。
  3. 正确做事
  以下两个是考察事情是否正确完成的关键:
  要为解决方法感到到自豪,因为这不仅仅只是个普通的解决方法,这是个好的方法。遵循“软件质量金字塔”的原则
  解决方法至少要经过一次检查。在你的同事中,请一位你尊敬的优秀开发人员检查你的方法,并接受他的真诚建议。
  4. 不要半途而废
  众所周知,若仍有一个玻璃杯需要清洗,则不能说已经洗完了。粉刷墙壁或驱车前往某处这些事情上我们也认可同样的道理,但在软件开发上我们却不这么认为了。即便我们没有完成所有的单元测试,或者我们没有核实实现方式是否符合用户的需要,我们也说完成了任务。这是典型来自Hope Driven Development的行为,是非常有害的。
  需求没有更改时,只有当你百分之百确认再也没有必要改善那个解决方法时,才能算完成任务。
  5. 与其道歉,不如补救,而放弃最不可取。
  如果你要花额外的时间来完成一些代码的测试,或者重构不可读的类,那么就去做,因为这是为将来投资时间。但是如果你在某件事上面卡住了或者将项目拖延的太久,那么寻找一个更容易的方案。它可能不如你目前正在实现的方。


原文:
Being a good developer is like being any other good professional, it’s all it’s about doing as much quality work as possible. There is a popular sentence that summarises it: “Do it. Do it right. Do it right now”.
1.- Have your own to do list for the day.

The best approach to complete complex activities is to break them down into simple activities. Do this every morning by breaking down the different activities you would like to complete for the day and assign them a schedule. This will help you to:
Have a better understanding of the activity.
Have a focused goal for the day
Improve your estimating skills. After a few days you will find that you can predict how much work you can do in a day.
2.- Do one thing at a time.

It’s been proven by different studies and published in different media (ie CNN) that it  is more productive to be focus only on one task than to do multitasking.
Work in short batches of intense work of about 25 minutes with a 5-10 minutes rest. There are popular techniques like the pomodoro technique to help you manage the time. There are also tools to help you measure the time you spent on the different tasks, my favorite one is CoolTimer.
3.- Do it right.

There are two keys to know if something is done right
To be proud of the solution; it is not just any solution, it is a good solution. It follows the principles of the “Pyramid of the software quality“.
The solution passes at least one review. Ask one of your colleagues that you respect as a good developer to review your solution and for his sincere opinion.
4.- Don’t finish something until it’s completely done.

We all know that if there’s still a glass to wash, we cannot say that we have done the dishes, the same applies for painting a wall or driving to a destination but in software development we don’t do that, we say that we are done even when we haven’t completed all the unit tests or when we haven’t checked if the implementation is correct with the customer, that’s a typical behavior from Hope Driven Development and that’s evil.
Something is only done when you are 100% sure that it won’t be necessary to work at all on that solution unless the requirements change.
5.- Better late than sorry BUT better sorry than never.

If it’s going to take you an extra day to complete the testing of some code, or to refactor a class which is unreadable, do it, that’s an investment in time for the future, but if you are stuck with something and you are delaying the project too much, just find an easier solution. It may not be as elegant as the one you are implementing, but at least you will have a solution. Make sure to document it as future risk for the project and something that will probably need to be revisited.

内容概要:本文设计了一种基于PLC的全自动洗衣机控制系统内容概要:本文设计了一种,采用三菱FX基于PLC的全自动洗衣机控制系统,采用3U-32MT型PLC作为三菱FX3U核心控制器,替代传统继-32MT电器控制方式,提升了型PLC作为系统的稳定性与自动化核心控制器,替代水平。系统具备传统继电器控制方式高/低水,实现洗衣机工作位选择、柔和过程的自动化控制/标准洗衣模式切换。系统具备高、暂停加衣、低水位选择、手动脱水及和柔和、标准两种蜂鸣提示等功能洗衣模式,支持,通过GX Works2软件编写梯形图程序,实现进洗衣过程中暂停添加水、洗涤、排水衣物,并增加了手动脱水功能和、脱水等工序蜂鸣器提示的自动循环控制功能,提升了使用的,并引入MCGS组便捷性与灵活性态软件实现人机交互界面监控。控制系统通过GX。硬件设计包括 Works2软件进行主电路、PLC接梯形图编程线与关键元,完成了启动、进水器件选型,软件、正反转洗涤部分完成I/O分配、排水、脱、逻辑流程规划水等工序的逻辑及各功能模块梯设计,并实现了大形图编程。循环与小循环的嵌; 适合人群:自动化套控制流程。此外、电气工程及相关,还利用MCGS组态软件构建专业本科学生,具备PL了人机交互C基础知识和梯界面,实现对洗衣机形图编程能力的运行状态的监控与操作。整体设计涵盖了初级工程技术人员。硬件选型、; 使用场景及目标:I/O分配、电路接线、程序逻辑设计及组①掌握PLC在态监控等多个方面家电自动化控制中的应用方法;②学习,体现了PLC在工业自动化控制中的高效全自动洗衣机控制系统的性与可靠性。;软硬件设计流程 适合人群:电气;③实践工程、自动化及相关MCGS组态软件与PLC的专业的本科生、初级通信与联调工程技术人员以及从事;④完成PLC控制系统开发毕业设计或工业的学习者;具备控制类项目开发参考一定PLC基础知识。; 阅读和梯形图建议:建议结合三菱编程能力的人员GX Works2仿真更为适宜。; 使用场景及目标:①应用于环境与MCGS组态平台进行程序高校毕业设计或调试与运行验证课程项目,帮助学生掌握PLC控制系统的设计,重点关注I/O分配逻辑、梯形图与实现方法;②为工业自动化领域互锁机制及循环控制结构的设计中类似家电控制系统的开发提供参考方案;③思路,深入理解PL通过实际案例理解C在实际工程项目PLC在电机中的应用全过程。控制、时间循环、互锁保护、手动干预等方面的应用逻辑。; 阅读建议:建议结合三菱GX Works2编程软件和MCGS组态软件同步实践,重点理解梯形图程序中各环节的时序逻辑与互锁机制,关注I/O分配与硬件接线的对应关系,并尝试在仿真环境中调试程序以加深对全自动洗衣机控制流程的理解。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值