Become a fan of Slashdot on Facebook


Forgot your password?

Comment Re:C strings strike again! (Score 1) 156

A link/name for the idiom I can pass to our Java people?

I think I would just point them to the Java API documentation and point out these constructors for java.lang.Exception:

Exception(String message, Throwable cause)
Constructs a new exception with the specified detail message and cause.

Exception(Throwable cause)
Constructs a new exception with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause).

These two additional constructors were added to Java 1.4 (so, a good long time ago) precisely because of the issue of catching and re-throwing exceptions and losing the underlying stack trace. These constructors solve that issue. (It does, however, make the stack trace that much longer, so it's pretty noisy!)

All that being said, I'm not really a fan of exceptions. I like old fashioned return codes myself.

Comment Re:C strings strike again! (Score 1) 156

But I have seen already enough of spaghetti Java code to stop believing entirely the fairy tail of "better language will solve all problems."

Easier/safer languages are a double edged sword. In the hands of a master, it makes the master that much more productive, because they're not wasting wetware cycles on details like "will concatenating this string overflow my destination buffer?". But, at the same time, it makes programming more accessible to people who really shouldn't be doing software development.

I like to think I'm a good software developer and that using Java makes me more productive, but I readily admit that your average C developer is probably more talented than your average Java developer, possibly by a wide margin.

Simple response: interface layer of libraries. It's pretty much given to find there some exception-munging code: after all we do not want to expose with exceptions the innards of the library.

This used to be a more serious problem, but fortunately, these days you can wrap an exception in a new exception and not lose the underlying stack trace. It's the common idiom now. For example: catch (IOException e) { throw new MyLibraryException(e); }

Overall, I think the issue of crashes/etc of C programs is overblown. I have checked my historical TODO lists and lion share of stuff are complains that stuff doesn't work as expected. For the whole year 2012 I had only 2 core dump issues out of around 100 tickets which I had to process. Largest feature I did this year had problems with dead-locks in multi-threaded mode, but not a single crash.

I believe it. I wonder if it's because all the less talented programmers have moved onto easier/safer languages, as I suggested above. In fact, that's one of my pet theories why your average iOS application is better than your average Android application. It takes a certain determination and skill to master Objective-C, while Java is a lot more "accessible" to less talented developers.

In many ways, I very much miss doing regular C development, though I do wish they would have added a few language features that I consider "must have" for modern development these days, such as "real strings" -- but that opens a whole other can of worms. :-)

Comment Re:First Time (Score 1) 639

Did you not read the entire sentence? I clearly stated that we need a safety net for those unable to work until the raised retirement age. I live in the rust belt, so I have plenty of friends that work in factories and on farms that are unlikely to be able to work to 67.

Are you proposing different retirement ages for different careers, and/or allowing people to retire early based on doctor's recommendations, or what exactly?

I think retiring at 69 with full benefits (what many in congress propose) is going too far, even for white collar workers. What we have currently (retire at 67 with full benefits -- at least for my generation) is already pushing the boundaries, in my opinion.

Sorry, I just have to disagree with your proposal to on average delay retirement, even if we have a safety net for those unable to continue working. Who decides who is and isn't able to continue working?

Smells too subjective and lottery-like. What if you get the bureaucrat or doctor that's ornery and not willing to let people retire early? Or if some people get the bureaucrat or doctor that's allowing healthy people to retire early? That approach seems too ripe for abuse.

Comment Re:C strings strike again! (Score 1) 156

Experience we made with HA software, null pointer problems are (often but only) nasty in C/C++ and are horrible in Java. Some stats. As new release went into tests/production, we found in total about 200 *crashes* due to null pointers in C/C++ apps. In Java part (about half the size of the C/C++) there were about 20 null pointer exceptions - with one which was occurring only in the production. This sole exception cost about 6 month of work to localize - because unlike core dump, Java's stack trace (due to your "which is often the case") was already unwound and couldn't point to the location of the show-stopper problem. This particular case (and it's not a sole Java debacle) became famous, because CTO of the customer, during a meeting, exclaimed that he wished the software was written in C instead, so that developers can see from core dump where the problem is.

That's interesting. My experience has actually been the opposite. I spent a few decades programming in C, and about a decade ago switched to Java.

In my experience -- which is, of course, just anecdotal -- C presented more difficulties. Core dumps are useful, of course, but it meant the entire process -- including all the threads -- went down. For high reliability requirements, we typically used a watcher daemon to restart processes that crashed unexpectedly.

In Java, unless you go out of your way to catch NullPointerExceptions and then purposefully eat the attached stack trace, you should know precisely where and why it happened. In addition, it should just kill the one thread. Though typically, we'd wrap threads with catch-all-log-all-and-restart-thread logic, which is just a few lines of code.

However, I'm not recommending Java over C, or vice-versa, though. I consider the application domains where C and Java compete to be pretty small these days, so typically I consider the correct choice to be dictated by the application domain.

Comment Re:First Time (Score 1) 639

Finally we as a society need to realize that as we increase our average lifespan we need to on average delay retirement while still allowing a safetynet for those unable to continue working.

I agree with most of what you're saying, but I get the impression you don't have any "blue collar friends". I do, and ideas like raising the retirement age to 69 is obnoxious and laughable. Some of my "blue collar friends" will be lucky to make it to 65 before their bodies completely give out. My retirement age is 67, and as a "white collar guy", that already scares me enough, especially with the rampant ageism in software development. If the answer to our economic challenges is to place most of the burden on the ailing backs of the elderly, perhaps we should just consider mandatory euthanasia at 65 years old. It would probably be less cruel.

Comment Re:For me, the iPad killed the netbook (Score 1) 336

Now answer me the unexplainable riddle of why you didn't immediately install Linux on it?

It's not like you could play 3D games or use things like Maya/Photoshop/Cubase on it anyway.

Various Linux distros did, of course, find their way onto my netbook (thanks UNetbootin!), but I wasn't impressed with the performance of the leading "turn key" distros such as Ubuntu.

There were also various driver related issues...

Comment Re:For me, the iPad killed the netbook (Score 1) 336

I suppose if I wanted to, I could throw Ubuntu or Debian on it, and probably get even a few additional horsepower, but I do have a need to run MS-Office, and it's a member of my AD network, so it's just easier to go XP.

Skip Ubuntu.

It was my distro of choice for extending the life of hardware, but it doesn't seem to offer any performance advantages over Windows 7 or 8 these days.

Debian with a lighter weight DE would work, I'm sure.

Comment Re:For me, the iPad killed the netbook (Score 1) 336

Well, um, can't you change the OS on the netbook?

I did run Linux on it for a while, and was disappointed with the performance of Unity, KDE, and GNOME 3. In many cases, they seemed slower than Windows 7.

Using a lighter weight DE was an option, of course, but I got tired of dinking around with it. I have a family and a mortgage and a full time job and just wanted something turn key. That was the iPad.

Comment Re:C strings strike again! (Score 1) 156

An uncaugh NullPointerException on a call to aString.length() in java would have the same effect and kill the running Thread, the program if it is the main Thread.

The JVM would continue running as long as there are running non-daemon threads. Whether or not it is the main thread is irrelevant.

You are correct, however, that calling .length() on an object of type String that is null will throw a NullPointerException; however, it may or may not kill the current thread. It depends on whether or not the exception is caught, which is often the case, especially in servers where robustness is important.

Comment For me, the iPad killed the netbook (Score 5, Interesting) 336

I bought a netbook because I figured it could do everything a tablet could do, and more.

It turned out to be frustratingly slow, largely due to Windows 7 needing too many resources, Microsoft putting ridiculous limitations on what kind of specs a netbook could have while still qualifying for Windows Starter 7, and the agonizingly slow hard drive (which was accessed far too often due to Windows 7 needing lots of RAM -- while at the same time, Microsoft demanding it not be allowed to have much RAM).

Later, I bought an iPad, with a slower CPU and less RAM ... and I love it. Even though it's just a lowly iPad 2, the user experience is wonderful. I can't help but think Microsoft is partially responsible for making the iPad a success, because Microsoft were the ones responsible for ensuring a poor netbook experience. If my netbook experience hadn't sucked, I'd never have purchased an iPad.

Wish I hadn't wasted my money on a POS netbook.

Comment Re:Good (Score 1) 151

Unless google recognizes that their content is going across ATT in that area and starts delaying the release of those packets.

That would mean that Google Search would be fast for their own network...but slower (in that area) for ATT.

Don't you love NetNeutrality?

It seems very unlikely Google would intentionally make their main product perform poorly on purpose, as it would just encourage people to use competitor's products instead (e.g., Bing).

Comment Re:Interface? Give me cleaner code (Score 1) 252

My issue with iTunes was never the interface. It was usually pretty intuitive.

I wish it was intuitive to me. :-( I purchase, download, and install an app from the app store to my iPad, then start iTunes to sync the iPad, and before I get a chance to start the sync, iTunes downloads the app again, but this time, just to the Mac. Err, or something like that. Why? Why does it do that?!

Or, I delete a program from my iPad, go into iTunes sometime later to sync, and even then, it downloads the app that I just deleted and never, ever want to see again. I hated that app and deleted it for a reason! Why are you downloading it, iTunes?!

I find the whole thing !@#$ing confusing.

Slashdot Top Deals

A freelance is one who gets paid by the word -- per piece or perhaps. -- Robert Benchley