Follow Slashdot stories on Twitter


Forgot your password?
Check out the new SourceForge HTML5 internet speed test! No Flash necessary and runs on all devices. ×

Comment Re:View from on high (Score 1) 239

Most of these guideline above do not enhance reliability. The object is not to make your code look like it came from an obfuscated C contest.

I put the open curly brace on its own line. Not that it needs to be, but because it enhances the readability of the block of code contained.
Readability == Less bugs

One exit from subroutines/functions/methods makes it easier to debug. Definition at the top, makes it easy to find variable type and initialization, instead if hunting through all the code trying to find the definition. Though a good IDE will handle most of that for you.
All this saves programmer time and makes for easier maintenance.

The OP says "unnecessary code -- e.g., variable declarations..." who doesn't declare their variables. I would hate to debug that code.
Also, who considers error handling, unnecessary code. Critical or not, the programmer should catch and handle every type of error he can. It's called robustness.

All this "unnecessary code" has a purpose, enhanced readability, less bugs, faster debugging, easier maintenance, stability. All these young bucks could stand to take a lessen or two from the grey beards.

Comment Re:Easy Hack (Score 1) 81

I totally agree with you. The agencies of the government need to be transparent but the day to day working of each individual government employee does not need to be public. If you work in Dept of Homeland Security, I want you protecting the homeland. If you work in the FBI, I want you arresting criminals. I don't need to know the details if you were on a stake out last night or investigating leads or testifying in court, those are details your supervisor needs to know. I need to know that you are doing your job and that the department is transparent in its function and mission. That's all.

Comment Easy Hack (Score 4, Interesting) 81

It is not like these lists are ultra top secret. When I worked for a government agency that shall remain nameless, I had access to everyone's email address, name, phone number and work location address. We treated that information with respect for privacy just as we did more sensitive information like SS #, home address, date of birth. Email addresses certainly was not top secret.

Comment Re:Team Reviews are far superior (Score 1) 186

Finding 1.25 bugs per man hour is impressive. If we did that, we could ship a bug-free application every week (just kidding), the code fixes usually take longer the 1.25 hours. But seriously, we have find around 30-40 bugs per release so if we could spend 24-32 man hours to find all the bugs, I would be thrilled.

Now if Microsoft would lock all their developers in a room for a year, we could get a stable release of Windows.

Comment Stupid (Score 1) 197

4 out of 5 of his suggestions were so simple the you could have gotten them out of any of the 10,000 blogs on 'improve' your programming, Refactor, use OOP, Unit Test and use Version Control. Any programmer that has more than an ounce of experience is already doing this.

The fifth suggestion was the one that was just plain stupid. Using auto/var for declaring variables is the intellectual equivalent to Visual Basic's, Option Explicit Off. Sure you could do it but why?

Comment Re:A tough one (Score 1) 285

You mention "Window NT and bugs" and that brings back some bad memories.

I was writing a program in MS Visual C++ on Window NT, and encountered a place in my code where the program would always crash. No compiler errors. The syntax was all correct. I then started walking through the assembly code with a debugger. In the middle of my function some system call was erroneously throwing an exception and crashing my program. Thank you Microsoft. So in the middle of my code, I added this try/catch block, empty brackets and all....


That caught the Windows NT system error and allowed my program to continue. Whoa to the future programmer that removes it because is "obviously" does nothing.

Comment ** Spoiler ** (Score 2) 285

It is the anonymous CORBAConnection variable that is create in the function call. Programmers create this anonymous variables all the time and never thing that it will bite them is the ass. Well, this one did and nearly took down the company too. Here is the explanation behind it.

CORBA communication is asynchronous, and thus COBRA connect object lives past the function that created it. When the communication thread that was using the connection is finished the original calling function that created it, has passed out of scope so there is no destructor called implicitly. And since there is no explicit variable, we cannot call the destructor explicitly either. With no way to call a destructor, there is no way to reclaim the memory, used thus the memory leak.

The solution was to explicitly declare a variable for the CORBA connection object and then call the destructor when it finished.

Slashdot Top Deals

Any program which runs right is obsolete.