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

 



Forgot your password?
typodupeerror
×

Comment Re: + operator for string concat? (Score 0) 729

There IS a "way to say with certainty what the interpreter will do". You just haven't taken the few minutes required to find out how!

And I figured, dumb guy. But the fact that I have determined how to overcome this defect of the language does not make this anomalous behavior becomes "acceptable" as you seem to think. Fixable or not is still a behavior that the Javascript should not have.

Comment Re: + operator for string concat? (Score 0) 729

You're dumber than I thought. If you were better at interpreting text and had dealt more with the case described, you would have understood what I mean by random is that there is no way to say with certainty what the interpreter will do since there's no telling for sure if he will treat the "+" operator as a sum of integers or a concatenation of strings. It's happened to me more than once, I thought I made it clear to the interpreter that a variable would be a string (for example: var some_variable = "1") and later I found out he decided to treat the variable as a integer anyway, and the only solution was to force the variable as string immediately before the desired operation using a ugly hack. while in Java if you use the "+" operator between a string and an integer you will always have a string as a result, regardless of the variables positions or operations that have been made with them previously.
ISS

Space Station's 'Cubesat Cannon' Has Gone Rogue 143

astroengine writes: Last night (Thursday), two more of Planet Lab's shoebox-sized Earth imaging satellites launched themselves from aboard the International Space Station, the latest in a series of technical mysteries involving a commercially owned CubeSat deployer located outside Japan's Kibo laboratory module. Station commander Steve Swanson was storing some blood samples in one of the station's freezers Friday morning when he noticed that the doors on NanoRack's cubesat deployer were open, said NASA mission commentator Pat Ryan. Flight controllers at the Johnson Space Center in Houston determined that two CubeSats had been inadvertently released. "No crew members or ground controllers saw the deployment. They reviewed all the camera footage and there was no views of it there either," Ryan said.

Comment Re:+ operator for string concat? (Score 0) 729

Is because JavaScript seems to randomly decide whether it will return a "11" or "2", while in a strong-typed language the result is deterministic. On Java you knows that "A" is a string and "B" is a integer, so A + B will always returns a string "11". Whereas Javascript are not sure about the types used in A and B, so therefore is no way to be sure about what he is going to return.

Comment Re:+ operator for string concat? (Score 0) 729

I usually have a worse problem, which is when Javascript arbitrarily decides that my string variable is an integer or vice-versa. You create a string, but then you discovers - when trying to use a string function like split() - that Javascript decided to treat your string as a integer, making the split() fails without error messages.

Comment Re:The idea of variant (var) (Score 1) 729

Because variants are useful when you want to (or most common, you need to) make a generic function to handle some information where you have no way of knowing if the input parameter will be a string, integer, long, etc. Of course it is slower than dealing with a defined type, but is usually more convenient than trying to create a separate function for each possible entry type.
Patents

Intellectual Ventures Sheds At Least Part of Its "Patent Troll" Reputation 75

pacopico writes Intellectual Ventures, the world's most infamous patent troll, has changed its tune — maybe. According to a story in Businessweek, the company has started turning a number of its ideas into products, ranging from hydration sensors to waterless washing machines and self-healing concrete. The story reveals some new tidbits about IV, including that it pays inventors $17,000 per idea, has a new start-up fund and that one of its cofounders got tossed out of school for hacking. IV is obvisouly trying to improve its reputation, but plenty of skeptics remain who think this is just a ruse meant to draw attention away from its patent lawsuits.

Slashdot Top Deals

The flow chart is a most thoroughly oversold piece of program documentation. -- Frederick Brooks, "The Mythical Man Month"

Working...