Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
Get HideMyAss! VPN, PC Mag's Top 10 VPNs of 2016 for 55% off for a Limited Time ×

Comment Re:GOTO still considered harmful (Score 3, Informative) 85

Guess what! it has nothing to do with OOP emulation. All cleanup in a C program has to be done explicitly by the developer, be it coded in object-oriented, functional, imperative or whatever the paradigm-of-the-week is.

Furthermore, the way kernel devs use goto for cleanup is one of the ways that actually keeps the code simpler and less prone to errors. There are a few alternatives to do cleanup in complex code:

  1. Don't do error checks. In your average C101 homework it's often assumed that many syscalls cannot fail. Obviously, the absolute minimum required in a real world program is a simple assert that stops the program before it can misbehave. Any real-world program that cannot lose data or crash the whole system such as office programs, databases and kernels obviously cannot do this.
  2. Do an early return and clean up all data so far. Very error prone as the cleanup code has to be replicated in multiple places.
  3. if/do-while(0)-break wrapping of code. Easy as long as there is one tier of resources to allocate. Any more and the function becomes arrow code.
  4. Wrap the constructors and destructors in a macro to emulate RAII. The result is still arrowish, although the cleanup is harder to fail. Not allowed in many projects due to an undeserved loathing of macros.
  5. Split the code into multiple functions. Now you have to pass around the state in function parameters. Having the code split into multiple functions makes the it more prone to logic errors.
  6. Use goto to jump to the cleanup section. All relevant code is kept in the same function and the code between alllocations and frees stays flat and concise.

Comment Re:Very relevent for small target embedded stuff. (Score 2) 641

Depends mostly on compiler and toolchain availability on those platforms. You still have Python-capable processors for embedded systems if you can't afford to learn C.

FWIW, I've been struggling with LPC4300 series processors. The open source toolchain is just so bad that your CPU hard faults on first attempted function call (most likely due to incorrect memory maps).

Comment Everything is in the cloud. (Score 1) 154

Had a head crash on my work laptop on Thursday. There was no need for restoring backups in the traditional sense since all company data was on SparkleShare (company internal git repo) and the few personal documents were in Dropbox. I pulled out a new laptop, installed SparkleShare and Dropbox and was good to go.

Google

Google Releases Street View Images From Fukushima Ghost Town 63

mdsolar writes in with news that Goolge has released Street View pictures from inside the zone that was evacuated after the Fukushima disaster. "Google Inc. (GOOG) today released images taken by its Street View service from the town of Namie, Japan, inside the zone that was evacuated after the Fukushima nuclear disaster in March 2011. Google, operator of the world's biggest Web search engine, entered Namie this month at the invitation of the town's mayor, Tamotsu Baba, and produced the 360-degree imagery for the Google Maps and Google Earth services, it said in an e-mailed statement. All of Namie's 21,000 residents were forced to flee after the March 2011 earthquake and tsunami crippled the Fukushima Dai-Ichi nuclear plant, about 8 kilometers (5 miles) from the town, causing the world's worst nuclear accident after Chernobyl. Baba asked Mountain View, California-based Google to map the town to create a permanent record of its state two years after the evacuation, he said in a Google blog post."
Technology

Gartner Says 3D Printers Will Cost Less Than $2,000 By 2016 170

colinneagle writes "Widespread adoption of 3D printing technology may not be that far away, according to a Gartner report predicting that enterprise-class 3D printers will be available for less than $2,000 by 2016. 3D printers are already in use among many businesses, from manufacturing to pharmaceuticals to consumers goods, and have generated a diverse set of use cases. As a result, the capabilities of the technology have evolved to meet customer needs, and will continue to develop to target those in additional markets, Gartner says."

Comment Re:Dashcams (Score 1) 253

there are a lot of Russian tourists this time of year. Most of them do drive responsibly. And I urge you to do so here abroad (we have a pretty decent police who can write accurate reports if there is an accident and are not for sale) as well as home.

They drive responsibly abroad because breaking the law will get their visa revoked.

Comment Re:Contacting Server... (Score 1) 238

Now that you mentioned it, I just noticed that Chrome gave an error message I hadn't noticed before:
Other users are also experiencing difficulties connecting to this site, so you may have to wait a few minutes.

The real news, however, might be that someone on Slashdot uses a browser that actively spies its users' browsing habits.

Comment No big news. (Score 1) 137

Somehow this doesn't come as a surprise, as Samsung announced just a week ago that they'll open a new R&D site at the Aalto University campus in Otaniemi. Samsung would've been bankrupt by the end of the year had they offered the MSc (Tech) undergrads all the spirits they can handle.

Slashdot Top Deals

"355/113 -- Not the famous irrational number PI, but an incredible simulation!"

Working...