Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Dr.Dobb's journal.2006.03

.pdf
Скачиваний:
25
Добавлен:
23.08.2013
Размер:
928.95 Кб
Скачать

my case, that’s pronounced “guess”) the correct answer:

(B) 44.8 liters.

In the afternoon, you’re tested on your major: Chemical, Civil, Electrical, Environmental, Industrial, Mechanical, and Other/General engineering. Software engineering isn’t an option, so you’d probably pick EE and face 60 questions in nine topic areas: Circuits, Power, Electromagnetism, Control Circuits, Communications, Signal Processing, Electronics, Digital, and Computer.

Each topic generally has a diagram and a group of questions along the lines of:

The power drawn by the bank of synchronous motors is most nearly…

followed by five possible answers. You must answer questions in all topics, although you may choose one of two separate question groups for some topics.

If you’ve been out of school for a few years, you may vaguely remember learning that stuff and subsequently forgetting it. If you’re now in school and plan to get a PE license, take the FE exam as soon as possible after Graduation Day, very early in the first half-life of your book learning.

Frankly, had I taken the FE as a new graduate, I probably wouldn’t have passed: Thermo and Chem weren’t my strong subjects.

The PE exam, taken after a few years of applying your knowledge, measures your mastery of more complex topics. You pick a relevant test in your area of specialization, ranging from Agricultural through Nuclear to Structural Engineering. The current exam list includes a specialization in “Electrical and Computer” topics, and you must know quite a bit about both.

The morning Electrical and Computer test measures your breadth of knowledge with 40 questions on Basic EE, Circuits and Components, Controls and Communication, and Power Systems. The afternoon test assesses your depth of knowledge in a subspecialty. In particular, the Computer exam poses 40 questions on General Computer Systems, Hardware, Software, and Networks. If you’ve been concentrating on wireless networks and forgot whatever you once knew about digital circuit metastability, you might have some difficulty.

Being in need of a PE license and realizing that I wasn’t ready for the exams, I signed up for a pair of 60-hour review courses for the FE (then known as the EIT: Engineer-In-Training) and PE exams at the local community college. I took them simultaneously, then nailed the FE and PE exams on two consecutive spring days. I can’t say whether this was a good idea or not, but it worked for me.

Hint: Clear your calendar during the review courses. Unlike many adult-education classes, these provide copious homework, you will need your calculator, and you won’t have time for anything else.

The Licenses

After clearing the requisite hoops, I hung my PE license on the wall, quit my day job (a decade before the mass layoffs, so the exit interviewer could say, “We don’t get many people quitting after ten and a half years” with a straight face) and discovered, unsurprisingly, that my clients neither knew nor cared about my PE license. Because my projects never involved public works or safety, none received an impression of my seal.

For reasons that made perfect sense each time, over the course of the next two

ns

Tip #7: Controlled Failures Need Exceptions

 

 

Exceptio

 

 

Sometimes, exceptions need to be used as a way to control program flow.

This is true when writing unit tests, too. Here, the execution of the code to

test is expected to produce a failure. It would be problematic if a failure

does not occur. By asserting “not null” on the exception in the finally clause

(as in the following example), the unit test passes:

public void testExceptionIsThrown {

Exception exception;

Pragmatic

try{

// something that generates an exception

 

 

...

 

 

} catch( Exception x ) {

 

exception = x;

 

} finally {

 

assertNotNull("Exception was thrown", exception);

 

}

 

 

}

—Benjamin Booth

 

 

 

 

http://www.benjaminbooth.com/

 

 

 

decades we moved from New York to Connecticut, to North Carolina, then back to New York. Both states had comity with New York, so that acquiring a license involved filling out some paperwork and paying the fees.

However, they required references from PEs familiar with your work, which posed a significant problem for a solo practitioner in a field with very few PEs. I pressganged friends and clients into producing canonical reference letters, although I was certain that this simply measured my armtwisting ability rather than my engineering competence.

Shortly after we moved out of North Carolina, the state imposed continuing education requirements for PEs. Although I maintain that my actions had nothing to do with the new rules, New York recently imposed similar requirements. NYS Education Law Section 7211 defines the requirements:

2. During each triennial registration period an applicant for registration shall complete a minimum of thirty-six hours of acceptable continuing education.

Because my registration renewal date came due two years after the rule went into effect, I must take 24 hours of Professional Development Hours (PDH) or Continuing Education Units (CEU).

The flyers filling my mailbox tout a wide variety of courses, most of which clearly fall outside my specialty: Toxic Mold Part 1 (8 PDH) and Stormwater Sediment and Erosion Control (7 PDH). Some have broad appeal that might be relevant: Engineering Ethics 1 (4 CEU) and Contracts for Engineers and Surveyors (4 PDH). A few might work: Electric Motor Application and Selection (3 PDH) and Digital Electronics (3 CEU). None relate to firmware, software, or embedded systems.

In round numbers, one PDH costs $50. Fulfilling the three-year education requirement thus costs about two kilobucks, reasonable in light of typical collegetuition rates.

The time required for the courses is another matter. Although you can take some courses by DVD, the majority are in-person courses two or three hours away from Poughkeepsie. A one-day, 8- to-5, 8-CEU course thus requires an overnight stay, at least for this bear who doesn’t arrive fresh and ready to learn after a protracted rush-hour commute into New York City.

So, to maintain my Professional Engineering license, I must travel to inconvenient places, take largely irrelevant courses, and pay a few kilobucks. As nearly as I can tell from the course descriptions, the net benefit would be close to zero.

Although I may be too cynical for my own good, I decided that the correct

50

Dr. Dobb’s Journal, March 2006

http://www.ddj.com

course of action was to simply stop being a PE. If having a license was required for what I do, that wouldn’t be an option.

The Consensus

It seems I’m not alone. While I cannot find current figures, a 1999 article in Mechanical Engineer magazine noted that the number of engineers taking PE exams had dropped dramatically. That may have been due to the rise in employment and drop in “consulting” gigs during the mid-’90s good times, but it seems to me that anybody who didn’t absolutely have to be a PE decided that it simply wasn’t worth the effort or expense.

The subsequent tech implosion dumped a disproportionate number of engineers into the “consulting” market. The IEEE (of which I’m a member) belatedly discovered most of its members lacked PE licenses and, thus, weren’t allowed to advertise themselves as engineers. They’re now in the difficult position of “recommending” licensing to a membership that’s either covered under the industrial exemption or employed in fields where licensing is irrelevant.

In the late ’90s, Texas established Software as a distinct engineering field, so that “software engineers” must be licensed. Despite some effort, it seems there’s no generally applicable Software Engineering Body of Knowledge (SWEBOK) upon which to base a Software Engineering examination, so (as I understand it) a Texas engineer seeking a PE license for software activities must demonstrate a suitable amount of experience, as attested by letters of recommendation.

A 2001 ACM task force report on Licensing of Software Engineers Working on Safety-Critical Software concluded that professional licensing as it stands today simply wouldn’t work in that field. They observe that very few “software engineers” have an engineering degree accredited by the Accreditation Board for Engineering and Technology, which all state PE licensing boards require. Most programmers, it seems, don’t have the opportunity to forget Thermo and Chem, having not studied them in the first place.

Software development also moves much faster than the NCEES testing process. Mechanical and electrical engineering questions dating back three decades remain perfectly useful, but most recent graduates have little knowledge of Fortran and GOTOs. Heck, even structured programming has come and gone in that time.

Another interesting side effect of being licensed should give you pause. If you produce work as a PE, you must follow established design practices or risk a malpractice lawsuit when your design fails. Software engineering, even in the embedded field, simply doesn’t have any

known-good design practices: Most projects fail despite applying the current crop of Best Practices.

I don’t have a good resolution for this situation. I do know that current PE licensing isn’t the right answer for software professionals, if only because the examinations cover irrelevant topics. Application programming and embedded programming have common features, but the difference remains so vast that a single “software engineering” test won’t work.

Worse, without a good self-imposed technical solution, we’re definitely going to get legislative requirements that won’t solve the problem. Perhaps I should get a clue and segue into the target construction biz?

Reentry Checklist

The 2004 passing rate for the FE and PE exams was, perhaps surprisingly, 68 percent. A typographic error in one afternoon question on my PE exam probably gave me a few vital points, because, as they explained, “an arrowhead was inadvertently omitted…[so]…all examinees were given full credit for all optional questions.” Sometimes you just get lucky.

Get the straight dope on PE exams from the National Council of Examiners for Engineering and Surveying at http://www

.ncees.org/. The National Society of Professional Engineers is at http://www.nspe

.org/. The NYS Education Department’s Office of the Professions is at http://www

.op.nysed.gov/home.html, and the Texas Board of Professional Engineers is at http:// www.tbpe.state.tx.us/.

Steve McConnell has written extensively on the subject of licensing for software folks, with a relevant chapter online at http://www.stevemcconnell.com/ gr-badges.htm and participated in the SWEBOK effort at http://www.swebok

.org/. Compare that with the 2001 ACM position paper at http://www.cs.trinity

.edu/~jhowland/cs3194/licensing-software- engineers.pdf. An article by Robert Glass is about 1/4 of the way down the page at http://www.cs.ttu.edu/fase/v10n07.txt. That ME article is at http://www

.memagazine.org/backissues/may99/

features/tolicense/tolicense.html. Microsoft, among others, still offers “en-

gineer” certifications: http://www.microsoft

.com/learning/mcp/certifications.asp. A somewhat jaundiced view of what “engineer” really means is at http://www

.gardfoods.com/coffee/coffee.engineer.htm and a more worldly view is at http://www

.phaedsys.org/papersese0303.html.

DDJ

http://www.ddj.com

Dr. Dobb’s Journal, March 2006

51

P R O G R A M M E R ’ S B O O K S H E L F

Performance Really

Does Count

Gregory V. Wilson

Analyzing Computer

Practical Development

System Performance

Environments

With Perl::PDQ

Matthew B. Doar

Neil J. Gunther

O’Reilly & Associates, 2005

Springer, 2005

297 pp., $39.95

536 pp., $69.95

ISBN 0596007965

ISBN 3540208658

 

Performance by Design:

Pro PHP Security

Chris Snyder

Computer Capacity

and Michael Southwell

Planning by Example

Apress, 2005

Daniel A. Menasci,

500 pp., $44.99

Virgilio A.F. Almeida,

ISBN 1590595084

and Lawrence W. Dowdy

 

Prentice Hall PTR, 2004

 

462 pp., $54.99

 

ISBN 0130906735

 

We’ve all cursed slow software and unresponsive web sites, and most of us have probably built a few, but making them zippy is often

as big a challenge as building them in the first place. One reason is that modern computer systems are among the most complex artifacts ever created; another is that their components often interact in counter-intuitive ways, so that optimizing a loop or adding another server can actually slow the whole system down.

Analyzing Computer System Performance with Perl::PDQ, by Neil Gunther, and Performance by Design, by Daniel Menasci, Virgilio Almeida, and Lawrence Dowdy, both aim to introduce you to the mathematics used to analyze and predict system performance. Both start with the kinds of simple models used to figure out how many customers a grocery store checkout clerk can handle in an hour. From there, they move on to more complex setups with preemptive interrupts or feedback loops.

Both books compare theory’s predictions with measurements of actual systems, and both are clearly written and well or-

ganized. The big difference between them is their pace: The book by Menasci et al., is a gentle stroll, while the book by Gunther varies between a fast jog and a gallop. As a result, I often found myself flipping ahead in Menasci, but flipping back to reread something crucial in Gunther. The extra effort Gunther requires is paid back by the Perl toolkit his book is built around, but on the other hand, I sometimes found myself tripping over minor layout problems, such as the word “Perl” followed immediately by another word without a break.

Which book you read depends on how much calculus and probability you remember, and how complex the systems you’re trying to tune are. If you’re building something whose performance matters, though, you should definitely read one. Otherwise, you may find that a week reconfiguring a server farm has saved you 20 minutes of thought.

Of course, performance doesn’t just mean real-time speed. In 2002, scientists at Lawrence Livermore National Laboratory found that on average, 12 percent of the effort in a large project went into main-

1. The Pragmatic Programmer:

From Journeyman to Master

Andrew Hunt and David Thomas

2.Excel 2003 Power Programming with VBA (Excel Power Programming with VBA)

John Walkenbach

3.Agile Software Development with SCRUM

Ken Schwaber

4.Effective Java Programming Language Guide

Joshua Bloch

5.Refactoring: Improving the Design of Existing Code

Martin Fowler

Amazon.com

Recent Top 5

Programming Books

taining the build environment, and that on some projects, the figure was in the 20–30 percent range. If you include the time needed to cull stale entries from the bugbase, figure out which parts of the documentation are out of date, and manage tests, it’s surprising that any actual development ever gets done.

Luckily for all of us, Matt Doar has produced a practical guide to what should be in every team’s toolbox, how competing entries stack up, and how they ought to be used. His book, Practical Development Environments, covers everything from configuration management tools such as CVS and Subversion, to build tools (make, GNU’s Autotools, Ant, Jam, and SCons), various testing aids, bug tracking systems, documentation generators, and we’re still only at the halfway mark. He names names, provides links, and treats free and commercial offerings on equal terms. My copy currently has 28 foldeddown corners, which is 28 more than most books get.

Finally, Pro PHP Security, by Chris Snyder and Michael Southwell, on the other hand, is very much a how-to book— and a very useful one. PHP has a bad reputation when it comes to security— by making web programming easy, it also made it easy for people to do things the wrong way. This book takes you step-by-step through common attacks, such as session hijacking and cross-site scripting, and explains how to foil each. While the examples are all in PHP, the discussion is thorough enough that many of the ideas can be applied directly to Ruby, Python, and other nimble languages. If you’re using PHP, this book’s definitely worth buying.

DDJ

Greg is a DDJ contributing editor, and can be reached at gvwilson@ddj.com. His most recent book is Data Crunching: Solve Everyday Problems Using Java, Python, and More.

http://www.ddj.com

Dr. Dobb’s Journal, March 2006

53

O F I N T E R E S T

VIA Technologies has released the VIA Java Cryptography Service Provider (VIA JCP), an add-on package that enables the Java Runtime Environment offload AES encryption and random-number generation to the VIA PadLock Security Engine integrated into VIA C7-M and VIA C7 processors. The VIA JCP enables Java-based applications that utilize the Java Cryptography Architecture to benefit from the military-grade protection offered by the VIA PadLock Security Engine with no program modification. Running in the background of Windows and Linux, the VIA JCP requires no user interaction or maintenance. The VIA JCP can accelerate these AES cipher functions by up to 90 times, enabling real-time encryption of data with low processor utilization, and strengthens the process of private/public key creation through utilizing the unprecedented speed and quality of VIA PadLock’s quantum-based random-number generators to build an unshakable foundation for security. The VIA JCP is available for free download at http://www.viaarena.com/.

VIA Technologies

940 Mission Court

Fremont, CA 94539 510-683-3300 http://www.via.com.tw/

AccuRev has introduced Health Checker for CVS, an open-source tool for organizations using the CVS version control system to identify CVS repository inconsistencies. Instead of writing custom scripts and processes to maintain a healthy and consistent repository, you can use Health Checker for CVS to identify inconsistencies and correct them. AccuRev’s Health Checker for CVS is available immediately at no charge.

AccuRev

10 Maguire Road Lexington, MA 02421 781-861-8700 ext. 10

http://www.accurev.com/hc6/

Wolfram Research has released Mathematica Personal Grid Edition, a toolkit designed specifically for quad-core computers. Mathematica Personal Grid Edition offers performance improvements of up to 300 percent over standard Mathematica, with only minimal code modifications. For more-intensive parallel applications, programs can run unchanged on grids or clusters of any size using gridMathematica. The tool is available for Windows (32bit, 64-bit), Mac OS X (32-bit, 64-bit), Linux (32-bit, 64-bit), Solaris (SPARC, x8664), Linux Itanium, HP-UX, IRIX, AIX, HP Tru64 UNIX, and compatible systems.

Wolfram Research

100 Trade Center Drive Champaign, IL 61820-7237 217-398-0700 ext. 3189

http://www.wolfram.com/personalgrid/

IBM Rational has announced support for Visual Studio .NET 2005. The IBM Rational Functional Tester is an automated functional and regression-testing tool for Java and Web-based applications that supports shell integration for VS .NET 2005 for automated test development. IBM Rational Functional Tester leverages VB .NET as the scripting language and is hosted in the Visual Studio .NET 2005 shell. Testers choose between Eclipse and .NET for their test script development environment. IBM Rational Performance Tester, a load and performance-testing solution that helps teams pinpoint scalability concerns, now integrates with Tivoli’s composite application management and monitoring products.

IBM

1133 Westchester Avenue

White Plains, NY 10604 http://www-306.ibm.com/software/

Pentek has released a development platform containing all the hardware and tools required for software-defined radio development compliant with the Software Communication Architecture (SCA) mandated for all future U.S. military radios. The Pentek SCA 2510 hardware platform consists of a Pentek 7640 software radio transceiver PCI card installed in a PC workstation. The computer is loaded with Linux, development tools, and the SCARI++ SCA core framework from Communications Research Centre (CRC) Canada. The hardware and software are fully integrated to ease development. The PCI card comes preconfigured with drivers and libraries so you can immediately begin soft- ware-defined radio projects.

Pentek

One Park Way

Upper Saddle River, NJ 07458-2311 201-818-5900, ext. 766 http://www.pentek.com/

Sublime Solutions has announced the release of FireDaemon, which lets you install and run any 32-bit/64-bit application or script as a service under Windows NT, 2000, XP, 2003, and Vista. The application enables complete configuration of the installed services. Configuration options can be set up via the GUI or command line using XML configuration files.

Sublime Solutions

22 Chittick Lane Cobbitty NSW 2570 Australia +61-28-205-7622

http://www.firedaemon.com/

Electric Cloud has released ElectricInsight, which provides a graphical window into the build so that error detection and performance tuning can be done in seconds. ElectricInsight is an add-on to the company’s ElectricAccelerator 3.0 product, which provides diagnostic and acceleration tools for builds.

Electric Cloud

2307 Leghorn Street Mountain View, CA 94043 650-968-2950

http://www.electric-cloud.com/

TechSmith has announced TechSmith Screen Recorder SDK Version 3 for integrating lossless screen recording functionality into Windows-based applications. Features of Screen Recorder SDK include the ability to pan the capture area, cursor and click highlighting for added impact, support for disabling hardware acceleration to provide smoother captures, audio callback, and sample apps. The TechSmith Screen Recorder SDK includes the TechSmith Screen Capture Codec (TSCC), a 100percent lossless video codec optimized for compressing high-performance content in AVI format. The TSCC video codec is freely redistributable. The SDK includes both a low-level Windows DLL API as well as a self-contained, ATL-based, ActiveX control.

TechSmith

2405 Woodlake Drive Okemos, MI 48864-5910 517-381-2300 http://www.techsmith.com/

DDJ

Dr. Dobb’s Software Tools Newsletter

What’s the fastest way of keeping up with new developer products and version updates? Dr. Dobb’s Software Tools e-mail newsletter, delivered once a month to your mailbox. This unique newsletter keeps you up-to-date on the latest in SDKs, libraries, components, compilers, and the like. To sign up now for this free service, go to http://www.ddj.com/maillists/.

http://www.ddj.com

Dr. Dobb’s Journal, March 2006

55

S W A I N E ’ S F L A M E S

Busted Memes and Fractured Frames

Don’t you just hate Orchids and Onions?

By “Orchids and Onions,” I refer to the most common title used on that genre of newspaper or magazine columns in which the writer doles out paragraphs of praise and censure. There

are many variations on the title, all more or less nauseating. Like “Kudos and Klunkers,” which really makes my skin crawl, because the botched parallelism convinces me that the writer thinks “kudos” is plural. (It isn’t.)

But even this cliché genre can be effective if it’s sufficiently ruthless. What typically makes the Orchid/Onioning smell so foul are weak items, usually trivial praise and generic censure; for example, “Orchids to Vernon and Gladys Snuff of Lurping Gulch on their 40th wedding anniversary/Onions to people who are rude.”

But it’s the lack of balance that irks me. Sure, it’s safer to praise than to blame, at least in print, and with all the Orchid/Onion columns in so many newspapers and magazines trying not to offend anyone, there is a surplus of cloying Orchids and a shortage of stinky Onions.

Somebody has to drape a restorative thumb on the scale. Here, in an attempt to bring fairness and balance to the Orchid/Onion field and with no attempt at all to avoid offense, is a bouquet of ripe Onions for technical terms that should be subject to term limits.

Onions to “Web 2.0.” Uhh, does Tim Berners-Lee get a say in when the Web gets revved? Or is it the rule that anybody named Tim gets to start his own Web? Internet2, IPv6, those terms actually refer to something. But Web 2.0: What’s that exactly? Nobody seems to know. Last September Tim O’Reilly, who, along with his coconspirators at O’Reilly & Associates, coined the term, tried to explain what Web 2.0 was and/or wasn’t. That essay convincingly demonstrated that Tim doesn’t know either. If Tim (either of them) can’t define it, I certainly shouldn’t try, but I will anyway: Web 2.0 is a commemorative coin minted in celebration of the end of the dot-com crash. Like all commemorative coins, it has no actual value.

Onions to “podcast.” Or specifically to the New Oxford American Dictionary for making “podcast” its Word of the Year. (They only do one?) Whatever you think of podcasting as a phenomenon, it’s clear that the term “podcasting” is an unfortunate one, because it misleadingly gives Apple Computer credit for more than it deserves. And that’s a task that we can confidently leave in the more than capable hands of Steven P. Jobs.

Onions to “best practices.” Best? Says who?

Onions to “illegal immigrant.” Let’s replace the term “illegal immigrant” with “illegal employer.” Apart from any question of fairness, the term “illegal immigrant” focuses on the aspect of the situation that is least subject to control. If we were to target, prosecute, and imprison illegal employers, I’m betting that illegal immigration would drop like the Ts in The Colbert Report. Okay, “illegal immigrant” is not a technology term, but I am applying a principle familiar to any software developer: Optimize the inner loops and don’t worry about the code that runs just once. (Is this a Best Practice?)

Onions to “intellectual property.” I’ll admit that “intellectual property” is a useful term if you believe in the thing it describes. But I still propose banning it from our technical lexicon, because its use is inherently question-begging. If you use the term, you have already tacitly admitted that a property right exists in the matter under discussion. Better to focus on the claim in a neutral and unbiased way, like “Sony’s nefarious attempt to subvert my inalienable right to manage my own media.”

Onions to “foo is the new bar.” Or anything is the new anything else. “Wikipedia is the new Google,” one blogger proclaimed. No it isn’t. The first dozen or so variations on the fashion industry pronouncement that “pink is the new black” were clever, but the thousands of imitations that followed are not. And nothing is the new anything else anyway. But especially, Wikipedia is not the new Google. Nor the new New Oxford American Dictionary. It’s just being itself, and it’s doing a heck of a job of it. I’m thinking of adopting Wikipedia’s traffic-generating strategy for this column: “Read ‘Swaine’s Flames’ every month to make sure that I haven’t accused you of assassinating President Kennedy.”

And you never accepted that pink was the new black anyway, did you?

Michael Swaine editor-at-large mike@swaine.com

56

Dr. Dobb’s Journal, March 2006

http://www.ddj.com