Close
  • Latest News
  • Artificial Intelligence
  • Video
  • Big Data and Analytics
  • Cloud
  • Networking
  • Cybersecurity
  • Applications
  • IT Management
  • Storage
  • Sponsored
  • Mobile
  • Small Business
  • Development
  • Database
  • Servers
  • Android
  • Apple
  • Innovation
  • Blogs
  • PC Hardware
  • Reviews
  • Search Engines
  • Virtualization
Read Down
Sign in
Close
Welcome!Log into your account
Forgot your password?
Read Down
Password recovery
Recover your password
Close
Search
Logo
Subscribe
Logo
  • Latest News
  • Artificial Intelligence
  • Video
  • Big Data and Analytics
  • Cloud
  • Networking
  • Cybersecurity
  • Applications
  • IT Management
  • Storage
  • Sponsored
  • Mobile
  • Small Business
  • Development
  • Database
  • Servers
  • Android
  • Apple
  • Innovation
  • Blogs
  • PC Hardware
  • Reviews
  • Search Engines
  • Virtualization
More
    Subscribe
    Home Development
    • Development

    Making Code Perfectly Clear

    Written by

    Peter Coffee
    Published February 6, 2006
    Share
    Facebook
    Twitter
    Linkedin

      eWEEK content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.

      As January drew to a close, Microsoft proposed to meet European courts demands for documentation of key interfaces by disclosing source code to competitors. Company counsel Brad Smith called this “the ultimate documentation” of the technologies.

      Its useful to understand why that is not so, because the same question could come up in your own environment—for example, in outsourcing arrangements or in any of several other plausible situations.

      QUIZ QUESTION: When someone says, “The source code is the documentation,” its an example of (check all that apply):

      (a) Accuracy

      (b) Irony

      (c) Laziness

      (d) Genius

      (e) Guilt

      GRADING NOTES: When a program springs from someones mind to take tangible form, the program itself is clearly meant to define what it does. Answer (a) is therefore right—but, if unqualified, is also dangerously wrong.

      Your worst students will argue that (a) is a weak form of the only accurate answer—that the program is ipso facto a perfect definition of what it does. That is not correct. Exams submitted with (a) as the only checked answer should receive a grade of F, regardless of the answers to any other questions. If challenged on this by students or their tuition-paying parents, remind them that Ken Thompsons Turing Award lecture in 1984 showed how a programmer could manipulate system software to make programs carry out functions that were completely absent from the source code.

      Thompsons scenario assumed either personal control or a successful conspiracy that would be hard to maintain. But, even so, no one should get away with saying, “Of course thats how it works! Read the code!” Answer (b) is therefore also correct, and no partial credit should be given to any student who does not include (b) among the checked responses.

      /zimages/6/28571.gifLarry Seltzer wonders why Microsoft didnt make its source code available to competitors years ago. Click here to read his column.

      Further, when code is written in a language that can be compiled for any of several hardware architectures or even for different operating systems on the same hardware, the same source code can yield different behaviors. The difference might be due to one compiler treating the “natural” size of a simple numeric value as a 16-bit quantity, while another considers it to be 32 bits; it might be due to one operating system allocating time across multiple threads of equal priority “fairly,” while another tries to maximize efficiency by letting a task complete unless interrupted by another thread thats declared to be more important.

      Documentation for a program should therefore indicate the programmers intentions and, if possible, show that the desired behavior is actually specified to occur. A combination of the language specification and version number, the compiler version number, and the operating system specification and version number may all be needed in the documentation in addition to whats in the source code if the program behavior is to be accurately predicted—or its misbehavior quickly understood.

      Its far more likely that the program will be tested on a single environment, debugged until it works correctly there, and released with “documentation” consisting of the dates and version numbers of the test suites thereby passed. Answer (c) is therefore correct; give no partial credit if this choice is not checked.

      Students may argue that source code comments are the best documentation, since nothing else is certain to follow the code in its travels. Remind them of the infamous comment, RIPJSB, once found next to the value 1750. Only after much lost time was this deduced to mean “RIP Johann Sebastian Bach,” 1750 being the year of the composers death.

      Comments, in short, say as much or as little about the behavior of the code as the coders whims may dictate. Answer (d) may be correct, but code maintainers may nonetheless suffer: Give credit for either response.

      Truth or falsity of (e) is beyond the scope of this course—but Microsoft is invited to explain its answer.

      /zimages/6/28571.gifTo read reader response to this article, click here.

      Technology Editor Peter Coffee can be reached at [email protected].

      /zimages/6/28571.gifCheck out eWEEK.coms for the latest news, reviews and analysis in programming environments and developer tools.

      Peter Coffee
      Peter Coffee
      Peter Coffee is Director of Platform Research at salesforce.com, where he serves as a liaison with the developer community to define the opportunity and clarify developers' technical requirements on the company's evolving Apex Platform. Peter previously spent 18 years with eWEEK (formerly PC Week), the national news magazine of enterprise technology practice, where he reviewed software development tools and methods and wrote regular columns on emerging technologies and professional community issues.Before he began writing full-time in 1989, Peter spent eleven years in technical and management positions at Exxon and The Aerospace Corporation, including management of the latter company's first desktop computing planning team and applied research in applications of artificial intelligence techniques. He holds an engineering degree from MIT and an MBA from Pepperdine University, he has held teaching appointments in computer science, business analytics and information systems management at Pepperdine, UCLA, and Chapman College.

      Get the Free Newsletter!

      Subscribe to Daily Tech Insider for top news, trends & analysis

      Get the Free Newsletter!

      Subscribe to Daily Tech Insider for top news, trends & analysis

      MOST POPULAR ARTICLES

      Artificial Intelligence

      9 Best AI 3D Generators You Need...

      Sam Rinko - June 25, 2024 0
      AI 3D Generators are powerful tools for many different industries. Discover the best AI 3D Generators, and learn which is best for your specific use case.
      Read more
      Cloud

      RingCentral Expands Its Collaboration Platform

      Zeus Kerravala - November 22, 2023 0
      RingCentral adds AI-enabled contact center and hybrid event products to its suite of collaboration services.
      Read more
      Artificial Intelligence

      8 Best AI Data Analytics Software &...

      Aminu Abdullahi - January 18, 2024 0
      Learn the top AI data analytics software to use. Compare AI data analytics solutions & features to make the best choice for your business.
      Read more
      Latest News

      Zeus Kerravala on Networking: Multicloud, 5G, and...

      James Maguire - December 16, 2022 0
      I spoke with Zeus Kerravala, industry analyst at ZK Research, about the rapid changes in enterprise networking, as tech advances and digital transformation prompt...
      Read more
      Video

      Datadog President Amit Agarwal on Trends in...

      James Maguire - November 11, 2022 0
      I spoke with Amit Agarwal, President of Datadog, about infrastructure observability, from current trends to key challenges to the future of this rapidly growing...
      Read more
      Logo

      eWeek has the latest technology news and analysis, buying guides, and product reviews for IT professionals and technology buyers. The site’s focus is on innovative solutions and covering in-depth technical content. eWeek stays on the cutting edge of technology news and IT trends through interviews and expert analysis. Gain insight from top innovators and thought leaders in the fields of IT, business, enterprise software, startups, and more.

      Facebook
      Linkedin
      RSS
      Twitter
      Youtube

      Advertisers

      Advertise with TechnologyAdvice on eWeek and our other IT-focused platforms.

      Advertise with Us

      Menu

      • About eWeek
      • Subscribe to our Newsletter
      • Latest News

      Our Brands

      • Privacy Policy
      • Terms
      • About
      • Contact
      • Advertise
      • Sitemap
      • California – Do Not Sell My Information

      Property of TechnologyAdvice.
      © 2024 TechnologyAdvice. All Rights Reserved

      Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.