A Message to the Future
来源:互联网 发布:虚拟自动化实验室软件 编辑:程序博客网 时间:2024/05/29 08:01
Maybe it's because most of them are smart people, but in all the years I've taught and worked side-by-side with programmers, it seems that most of them thought that since the problems they were struggling with were difficult that the solutions should be just as difficult for everyone (maybe even for themselves a few months after the code was written) to understand and maintain.
I remember one incident with Joe, a student in my data structures class, who had to come in to show me what he'd written. "Betcha can't guess what it does!" he crowed.
"You're right," I agreed without spending too much time on his example and wondering how to get an important message across. "I'm sure you've been working hard on this. I wonder, though, if you haven't forgotten something important. Say, Joe, don't you have a younger brother?"
"Yep. Sure do! Phil! He's in your Intro class. He's learning to program, too!" Joe announced proudly.
"That's great," I replied. "I wonder if he could read this code."
"No way!" said Joe. "This is hard stuff!"
"Just suppose," I suggested, "that this was real working code and that in a few years Phil was hired to make a maintenance update. What have you done for him?" Joe just stared at me blinking. "We know that Phil is really smart, right?" Joe nodded. "And I hate to say it, but I'm pretty smart, too!" Joe grinned. "So if I can't easily understand what you've done here and your very smart younger brother will likely puzzle over this, what does that mean about what you've written?" Joe looked at his code a little differently it seemed to me. "How about this," I suggested in my best 'I'm your friendly mentor' voice, "Think of every line of code you write as a message for someone in the future — someone who might be your younger brother. Pretend you're explaining to this smart person how to solve this tough problem.
"Is this what you'd like to imagine? That the smart programmer in the future would see your code and say, 'Wow! This is great! I can understand perfectly what's been done here and I'm amazed at what an elegant — no, wait — what a beautiful piece of code this is. I'm going to show the other folks on my team. This is a masterpiece!'
"Joe, do you think you can write code that solves this difficult problem but will be so beautiful it will sing? Yes, just like a haunting melody. I think that anyone who can come up with the very difficult solution you have here could also write something beautiful. Hmm... I wonder if I should start grading on beauty? What do you think, Joe?"
Joe picked up his work and looked at me, a little smile creeping across his face. "I got it, prof, I'm off to make the world better for Phil. Thanks."
By Linda Rising
This work is licensed under a Creative Commons Attribution 3
- A Message to the Future
- A Message to the Future
- What goes in to the message of a transaction signature?
- The Future According to ASP+
- A Message To Garcia
- The Semantic Web : A Guide to the Future of XML, Web Services, and Knowledge Management
- How to distinguish a human and a robot in the future?
- Software Engineering: A Look Back and A Path to the Future
- JOB报错:ORA-23420: interval must evaluate to a time in the future
- Performing a deep fetch of the `master` specs repo to improve future performance
- Performing a deep fetch of the `master` specs repo to improve future performance
- Performing a deep fetch of the `master` specs repo to improve future performance
- Animate to display a dialog message box in the right-bottom of the window screen
- Back to the Future with Smart Clients
- what to do for the future?
- C++09: A Glimpse into the Future
- TOJ-2234. A+B In the Future
- svn: The log message is a pathname (was -F intended?); use '--force-log' to override
- iphone开发点滴-Could not launch app - No such file or directory
- [Html5开发] viewport 的使用
- Oracle 存储过程
- VB.NET函数——字母串函数
- SVN提交更新的一个准则
- A Message to the Future
- centos eclipse配置heritrix 3.1.1
- 排序算法稳定性分析
- WebLogic中修改端口号和省略端口号的做法
- 深入探讨C++中的引用
- MySQL 中文乱码问题总结
- Oracle存储过程基本语法
- 新窗口window.open() url不显示参数,后面页面可以接收参数 ——后面页面为jsp
- VB.NET函数——日期时间函数