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
    • IT Management

    Software Makes Uncommon Sense

    Written by

    Peter Coffee
    Published January 30, 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.

      Nonprogrammers underestimate the challenge of writing programs that actually work, all the time, with never a strange behavior or erroneous result. It might be useful, if perhaps insanely difficult, to attempt to convey that challenge by writing a laymans interpretive guide to a book such as “Java Puzzlers: Traps, Pitfalls, and Corner Cases,” published last year by Addison-Wesley.

      Assembled from talks and articles by Google developers Joshua Bloch and Neal Gafter, “Java Puzzlers” is almost recreational reading for anyone whos ever programmed—even for someone whos never coded in Java. The basic truths are that universal.

      The messages of the book are especially pointed, though, in the context of Java, a relatively modern language and one that goes to considerable lengths to eliminate many common and venerable sources and types of programmer error.

      /zimages/4/28571.gifThe latest Eclipse tool aids Java app creation. Click here to read more.

      I hope that Bloch and Gafter will forgive me for spoiling Puzzle 48 of the 95 puzzles in the book. Its a perfect example of the gap between the vague ideas of software technology that one finds in the mainstream business press and the sharp-edged realities of actually trying to apply those ideas.

      The puzzle shows a piece of code that defines a class “Dog,” whose members bark, with a subclass “Basenji,” whose members specifically do not bark. When that code is executed, both an instance of Dog (rightly) and an instance of Basenji (wrongly) yield a “Woof!”

      Why does this happen? The answer depends on knowing the difference between things that happen when code is compiled and things that happen when code is actually run. Two different ways of writing this program will differ in this crucial respect: One program will know only that its dealing with Dogs at the time that it decides how each object will behave, ignoring the run-time knowledge that one of those Dogs is a special-case subclass.

      There are plenty of books of programmer puzzles and challenges on my shelves, but “Java Puzzlers” does something I find especially useful: It doesnt merely explain why an odd behavior occurs; it also offers suggestions distinctly aimed at Java users in particular and programming language designers in general.

      In this case, for example, it suggests to the Java coder, “Do not hide static methods—there is nothing to gain, and much to lose, from reusing the name of a superclasss static method in a subclass.” It suggests to the language designer, “Invocations of class and instance methods should look different from each other.”

      None of this might seem to matter to anyone whos not a full-time developer—or even more recherché, a full-time designer of developers tools. In the modern era, though, I suggest that this is too narrow a view of the occupations that benefit from—if perhaps dont actually require—this insight into how complex systems actually behave, or misbehave.

      Even nonprogrammers are becoming participants in the design of business processes that will be carried out by software—insight into language design is also insight into the design of more robust processes. Without that kind of insight, people expect too much common sense from technology-based systems.

      The other day, for example, someone asked me why a voice mail system was demanding a setup procedure before it would play a message. “I already did set it up,” that frustrated user insisted. I made a critical error by replying, “If the system thinks you didnt, then you didnt.”

      I meant the system was not in the desired state—for whatever reason—and that the user would have to humor it and go through the setup process again. The user was furious with me: He thought I was accusing him of being a liar, an idiot or otherwise incompetent. It was a painful conversation.

      Understanding how programs can look right but work wrong is like understanding how a car can skid before you drive on ice or like knowing that a bulging can is a sign that you shouldnt put it in your grocery cart. Knowing how to use technology when it works correctly is good; knowing how it can fail to work, with what consequences, is also vital.

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

      /zimages/4/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.