Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!


Forgot your password?

Comment GC and the desctructor (Score 1) 171

A destructor is useless with a GC.

The finalize method was only introduced in some situation where you need to make memory cleaning easier & faster.

If you are developing a regular program, you will never need to ever think on finalize. Using WeakReferences, Handles (look NIO for instance), you don't even need to know what is finalize() and what is the subilities it has. In the same way as the .wait() or .notify() !

This is the problem with developper comming from C/C++, they have been so focussed on memory management problems that they can not understand it has been solved (with a CPU & memory cost) thru GC usage.

Having automatic memory handling, does not mean you are freed from error. One famous problem is the loitering references, a reference you did not take notice to kept a bit longer than required in your code, but unfortunatly this reference has reference to lots of objects that have also reference...etc. The problem is getting worse if the place you are keeping tis reference is under a static zone or in a daemon thread.

The known solution to this is :
  1- never keep a cache of objects that are external to your domain unless you know what you are doing or unless you are using a weak reference to point each object and performing the appropriate presence test on them.
  2- never store a reference to your domain in a foreign domain (worst example of this is swing client properties) unlessyou know what you are doing or unless you are using a weak reference to point each object and performing the appropriate presence test on them
  3- never use string interning (cf. .intern()) unless you truly understand it and can control the memory usage impact you will have on the VM on the long run.

If you follow those simple advices, you will never have to think about .finalize() anymore :)

Allright, here is my question : we know that GC are now well known techniques and have reached to a suitable level of maturity. Why is there no GC directly written in the microprocessor ? I mean, these are basic feature that a processor could control and perform better than anybody else. All languages could benefit this by replacing memory allocation techniques !

This would be a huge step forward IMHO.

Comment Hugs and Arms (Score 1) 15

What is the more dangerous : a person with a weapon in a college ? a person giving a hug to another in a college ? a person shooting with a weapon in a college ? a person kissing another in a college ? a person killing other for "fun" with a weapon ? a person discovering sex for "fun" with other youg people of its age ?

Name it like you want, but at the end the question is violence against sexuality so to be straight : War vs Sex !

And the very core of the issue : War = cool, Sex = bad.

I am not one of those hippies, but sometime I wonder how we have arrived at this point. Hey people, you know we are not yet in gattaca, and the vast majority of you have been made thru sex, and yes there is a high probability that this includes hugs ;-)

In hugs, you can trust.

Comment "Oh my G ..." ? (Score 1, Interesting) 503

You are perfectly right.

Europe is freedom of speech, but restricted by law.
US is freedom of speech, but restricted by religion.

Just a matter of choice : religion vs law ;-)

Anybody tried a "good old" blasphemy lately ?

Anybody as "hot" subject ... Europe is denying crime against humanity (for instance Holocaust). US is about chalenging the religion : "in god we trust".

Both are historical artefacts, you know ;-)


Comment Will they loosen restriction on Java as well ? (Score 2, Interesting) 178

I mean, here you got hardware with Java native support (processor chosen by Apple got the Jazelle option), with a license that prevent JVM to be installed on it !!!

All right, we all know that "Java is too slow" was touted by Steve simply because he need exclusive application to ensure the success of his pay-per-download platform.

Allowing Java would have simply killed the exclusivity, because Java is né multiplatform and some order of magnitude easier to develop with. Having let people the choice would have make Java the default choice. Thus allowing for instance application to run easilly on Android or other mobile OS with strong Java implementation level (think nokia for instance).

Apple with a great product and well-thinked limitation/contracts have manage to build again a milking-cow : cash on each mobile fee, cash on each application downloaded, cash on very battery renewed ...

This looks pretty cool as a business model ;-)

But how long will it last ? It would be interresting if anybody fill a class action again Apple for not allowing Java :P

Where is the RMS/FSF here fighting for Libre ? Because, this might be a Unix band band, but this looks a prety proprietary one ;-)

Comment This is not a problem since 1.2 plus ... (Score 1) 519

Bluetooth is already Wifi friendly since version 1.2 ( See http://en.wikipedia.org/wiki/Bluetooth#Bluetooth_1.2 ) = no interference.

But as it is still using the same spectrum (ISM band = about 2.4GHZ), this means that if using the same chanel, they can be situation where it suck some of the bandwidth. But be sure Bluetooth is not as sprectrum greedy as 802.11n ey ;-)

Actually, you are right there is interference with wifi ... but with the proprietary wireless mouse using 2.4GHz (today's high end wireless mouse use this band). And there you have no standard that ensure your mouse is not fully jamming the spectrum & killing your wifi bandwith.

So between Bluetooth and proprietary ... choose Bluetooth but at least 2.0 (1.2 is fine, but 2.0 has added more speed).

The only problem I see is that manucaturer prefers to build proprietary stuffs, because it is usually less costy to produce : compatibility test, interference, etc. So, at this time, you will get less choice out for a bluetooth mouse.

FYI, My graal Bluetooth mouse shoud get :
  - minimum 2.0 EDR
  - cool wheel
  - nice design
  - AAA batery/accu friendly
  - miniUSB plug to charge
  - full functional thu cable using a miniUSB cable
  - instant on
  - laser motion detection
  - cool look & rock solid

Any suggestion ?

Comment What will happen to WAS ;-) (Score 1) 526

About Java SE (OpenJDK), Java EE (Glassfish), Java ME (PhoneME) and the IDE (Netbeans). All of them are available as GPLv2, so the old-rule "run fast or get forked" will apply :)
Glassfish is the Java EE RI, I got doubt WAs can become the RI, so the risk is more on WAS side. Obviously IBM would tint this in DeepBlue and benefit from all the mainframe integration components they got ;-)
PhoneMe and Netbeans are more of a problem, because IBM could decide to stop de dev there. But thanks to libre world nothing is stoping the communities to go on.
Two major problems with the merger :
1 - The patents
Sun has clearly stated they will protect anybody (any implementer) under their umbrela. What will be IBM thought on this ? Would they still protect any JCR implementer as well (apache, jboss, etc) ?
IBM shall keep the protection and add their own pattent to the umbrela
2 - JCP place
What will happen to the IBM+Sun seats ? This need to be solved not to endanger independence of the process. With Sun holding a veto vote, and IBM another vote ... practically this could become a banana-process.
IBM shall leave their own seats and grap the Sun's lead seat.

If this mergerhappens, this is a huge news for the enterprise IT world.
Let's see how IBM manage this, or "get forked" : Java est libre !

Comment I make no confusion ... (Score 1) 299

just wanting to avoid a religion debate ... because to me this is a religion problem (and in some religious country there is no difference with the ambient culture). Actually, the odd difference of treatment between nudity and violence is coming from the "religion books" themselves, just read them. Nudity is Sin, but violence can be right. People trust those books for some odd reason . Who wrote this, in which context ? Those things have a so complex history, various versions, addendum, doctrines, interpretations, that nobody knows at the end what is coming from where ! Just look at Odyssey book (another very old book), is there anybody here thinking that those things have happened ? I mean, really ? So why, are there people 100% trusting other 100% some of the other books of almost the same period ? If you trust in a god, lord, whatever... please read the book from A to Z then give you a break and think of it. Are you 100% okay with it ? Are you okay with stoning for instance as written in old testament (hence ok for the 3 monoteic religion) ? Example: Your wife had intercourse with another guy, according to those books you have the right to stone her. No, this is not violence, it is granted by your religion ! If those books have to be 100% trusted then, you should not have problem with stoning here. But if you hae problem with stoning (and simply think you should look for a good lawyer), then this is maybe that this book should not be 100% trusted. Maybe that this books hold mixed things. Good things, things that used to be good at some ancient time, things that used to better than the practices at those times ... namely, maybe that those books are just a "human digest's" book (human version of "reader's digest" book for post-prehistorical people). Do we need religion ? Let's quote a famous sond : "All we need is love" :o)

Slashdot Top Deals

6.023 x 10 to the 23rd power alligator pears = Avocado's number