|
Feb 24: Miami:
Future of Web Apps |
|
Wanted: Perl Developer
at Shoebuy.com, Inc. (Boston, MA).
See this and other great job listings at
jobs.joelonsoftware.com.
13This item ran on the Joel on Software homepage on Monday, October 13, 2003Exceptions People have asked why I don't like programming with exceptions. In both Java and C++, my policy is:
The reasoning is that I consider exceptions to be no better than "goto's", considered harmful since the 1960s, in that they create an abrupt jump from one point of code to another. In fact they are significantly worse than goto's:
A better alternative is to have your functions return error values when things go wrong, and to deal with these explicitly, no matter how verbose it might be. It is true that what should be a simple 3 line program often blossoms to 48 lines when you put in good error checking, but that's life, and papering it over with exceptions does not make your program more robust. I think the reason programmers in C/C++/Java style languages have been attracted to exceptions is simply because the syntax does not have a concise way to call a function that returns multiple values, so it's hard to write a function that either produces a return value or returns an error. (The only languages I have used extensively that do let you return multiple values nicely are ML and Haskell.) In C/C++/Java style languages one way you can handle errors is to use the real return value for a result status, and if you have anything you want to return, use an OUT parameter to do that. This has the unforunate side effect of making it impossible to nest function calls, so result = f(g(x)) must become:
This is ugly and annoying but it's better than getting magic unexpected gotos sprinkled throughout your code at unpredictable places. PHP If someone wants to write up a nice article about how to develop multilingual, Unicode applications with PHP or point me to an existing article on the subject I will link to it here. Right now both the PHP documentation and a google search for "PHP Unicode" make it look like you're pretty screwed if you really want to do Unicode in PHP. There is some existing documention of mb_ functions that people have pointed me to, which is badly written and confusing, and appears to only support a handful of encodings, not Unicode in general. It also seems to be an extension that you have to turn on, which means, I think, that the average PHP installation does not support this out of the box. My new book is here! Apress has just published a new collection of 36 essays from Joel on Software, aptly named More Joel on Software. Get yours today! Available from Amazon.com or wherever fine cheese is sold. About the Author: I’m your host, Joel Spolsky, a software developer in New York City. Since 2000, I've been writing about software development, management, business, and the Internet on this site. For my day job, I run Fog Creek Software, makers of FogBugz—the smart bug tracking software with the stupid name, and Fog Creek Copilot—the easiest way to provide remote tech support over the Internet, with nothing to install or configure. Enter your email address to receive a (very occasional) email whenever I write a major new article. You can unsubscribe at any time, of course. |
I'm your host, Joel Spolsky, a software developer in New York City. Since 2000, I've been writing about software development, management, business, and the Internet on this site. More about me.
There's a complete archive of everything going back to 2000. The home page is reserved for minor, ephemeral thoughts, but occasionally I write a longer article. You can sign up to receive email whenever this happens at the bottom of this page. We also have one of those RSS thingamajiggies. If you don't know what that is, consider yourself lucky.
This site is actively translated by volunteers around the world into more than thirty languages.
Want to hire great developers? Looking for a job that doesn't suck? Over 200,000 great programmers read my job board at jobs.joelonsoftware.com.
Have feedback? There are several popular discussion boards on this site: Joel on Software
Business of Software Design of Software .NET Questions TechInterview.org CityDesk FogBugz Fog Creek Copilot You can also email me directly, although my mailbox is an official disaster area.
For my day job, I'm the CEO of Fog Creek Software, a bootstrapped software company in New York, NY.
We also make Fog Creek Copilot, which lets you control someone else's computer (with their permission, of course) over the Internet. It's the best way to fix someone's computer problems remotely. There's nothing to install, it's simple as heck, and it works through any kind of firewall, NAT, or proxy situation with zero configuration. More
If you're in college, Fog Creek Software has a very cool paid internship program (last year's interns developed Copilot in one summer). We also run a Software Management Training Program, an intensive two year program for college graduates to learn about managing high tech that combines a Masters in Technology Management with extensive hands-on experience in a variety of positions.
Wondering what it's like to develop software at Fog Creek? The documentary Aardvark'd covers the story of the development of Copilot. It's available on DVD.
Fog Creek co-founder Michael Pryor has his own site on Technical Interview Questions.
© 1999-2008 Joel Spolsky. All Rights Reserved. Linking, quoting and reprinting
|
|
| Home | Email | Bug Tracking Software | Remote Assistance | Complete Archive | ||