tag:blogger.com,1999:blog-6911752388384243976.post5724501489306800427..comments2023-04-05T13:37:33.168+01:00Comments on IEC Fusion Technology: Literate ProgrammingM. Simonhttp://www.blogger.com/profile/09508934110558197375noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-6911752388384243976.post-21313194929828582212008-06-15T12:55:00.000+01:002008-06-15T12:55:00.000+01:00Hello Simon, I have wondered why it is more en...Hello Simon,<BR/> I have wondered why it is more enjoyable to write code than to read it. And I have tried to make my own code readable, perhaps even simple, because if I find it hard, how will it be for the next guy?<BR/> Steve McConnell wrote a great book called Code Complete (Microsoft Press), and it started me on the road to actually crafting code. Since then, I have read Martin Fowler's Refactoring, and Gamma et al's Design Patterns, and each gets me closer to that tantalising goal of actually writing something that doesn't have bugs! I haven't heard of theis book by Knuth (although his name is well known) so thank you Simon for bringing it to my attention.<BR/><BR/>Regards,<BR/>Tony Barrytonybarryhttps://www.blogger.com/profile/12138234067799297554noreply@blogger.comtag:blogger.com,1999:blog-6911752388384243976.post-51851685500876469432008-06-09T17:27:00.000+01:002008-06-09T17:27:00.000+01:00This has a lot to do wit Fusion. After all the con...This has a lot to do wit Fusion. After all the control systems will need a lot of code.<BR/><BR/>One of the reasons I like FORTH is that tests are easy to do and to capture.M. Simonhttps://www.blogger.com/profile/09508934110558197375noreply@blogger.comtag:blogger.com,1999:blog-6911752388384243976.post-35095993131985243372008-06-09T05:27:00.000+01:002008-06-09T05:27:00.000+01:00Though I'm a huge fan of Donald Knuth, and have al...Though I'm a huge fan of Donald Knuth, and have always tried to make my software read well, one cannot underestimate the benefits of Test-Driven Development. <BR/><BR/>First, when writing something, you should be worrying about what can go wrong. Each worry should be a distinct test. <BR/><BR/>Second, when writing tests, you have to gain access to your functionality, so you become the first user of your own interface. This forces you to create good interfaces to your functionality. <BR/><BR/>Third, when you are worrying about tests you tend to create a more "testable" design. I have a clock-radio I bought in 1973. On the main circuit board (filled with discrete components) are about a half-dozen "test points" where you could place an oscilloscope and see expected waveforms. Similarly, TDD exerts a subtle pressure upon the developer to create analogous "test points." <BR/><BR/>Finally, as people use your stuff and discover errors, you can code (should code) additional tests, one per bug, that prove your fix. And when you run all the other tests prove your fix today didn't break something that was working yesterday.<BR/><BR/>With a comprehensive suite of TDD tests, you can refactor boldly. Lacking those tests to watch your back, you are better advised to minimize the scope of any bug fixes and touch as little as possible. The result is accumulated damage to the integrity of the system. This is how software ages.<BR/><BR/>Sorry, this has nothing to do with fusion, but you did start talking about Forth and Knuth after all.Steve Polinghttps://www.blogger.com/profile/06095291939072131815noreply@blogger.com