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

 



Forgot your password?
typodupeerror

Comment IndentationError (Score 5, Insightful) 997

If something like indentation is a show-stopper for your choice of language, then you are missing the point.

Computer languages are about data structures and idioms for manipulating them efficiently. In contrast, whitespace is a cosmetic, superficial thing.

Yes, I adore Python. (I wish I had paid attention to it ten years sooner than I did.)

Bug

e1000e Bug Squashed — Linux Kernel Patch Released 111

ruphus13 writes "As mentioned earlier, there was a kernel bug in the alpha/beta version of the Linux kernel (up to 2.6.27 rc7), which was corrupting (and rendering useless) the EEPROM/NVM of adapters. Thankfully, a patch is now out that prevents writing to the EEPROM once the driver is loaded, and this follows a patch released by Intel earlier in the week. From the article: 'The Intel team is currently working on narrowing down the details of how and why these chipsets were affected. They also plan on releasing patches shortly to restore the EEPROM on any adapters that have been affected, via saved images using ethtool -e or from identical systems.' This is good news as we move towards a production release!"

Comment It's all changing too fast (Score 2, Insightful) 638

I've only been programming professionally for 3 years now, but already I'm shaking in my boots over having to rethink and relearn the way I've done things to accomodate these massively parallel architectures. I can't imagine how scared must be the old timers of 20, 30, or more years. Or maybe the good ones who are still hacking decades later have already had to deal with paradigm shifts and aren't scared at all?

Media

Submission + - The New School of Videographers (osnews.com)

Provataki writes: This editorial discusses the impending explosion of hobbyist artistic videographers, in the same way that happened with digital photography just a few short years ago. The article claims that it's time camera manufacturers create camcorders equivalent in principle to the cheap DSLRs that we currently enjoy. Some beautiful HD footage, shot by amateurs, is shown too.

Comment Re:GTK is alright...but no raves (Score 1) 356

It may not be what the OP (Hosiah) wanted, but it's much better, cleaner, more maintainable code.

Hosiah's code:

No, I'm not kidding: a dialog box with three buttons should be:
D(H:50,W:200){M:"Quit without saving?",B1:"Save"(do_save()),B2:"Don't Save"(no_op&exit()),B3:"Cancel"(drop_quit())};


It's nice and all that he's managed to squeeze 7 or 8 lines of easily understandable code into 1 very long line that needs a fair amount of visual parsing to understand, but:

* Windows like this should not be specifying exact sizes - aside from all the time wasted determining what numbers fit, the end user is going to have a different font size, resolution, and screen size than you do. I hope your default window is resizable!

* It does not specify positioning - yes, it's assumed to be centered, but if you're all that interested in having so much control over the button text, it seems like an oversight to leave this up to the system.

* I hope you don't ever need to pass any params (or deal with any return values) from those functions.

* Yes, it's nitpicking, but his logic is wrong. The "Save" handler should save and exit, the "Don't Save" handler doesn't need a NOP for no reason, and the "Cancel" handler should do nothing (what on earth does drop_quit() do?

The art of programming does not consist in geting your program down to the least number of statements possible. It has much more to do with using the least amount *necessary to do the job and be clearly understandable*.

How is that code any better than this (other than being able to specify the button text)?
// Win SDK syntax off the top of my head from a long time ago...
// What is up with the <ecode> tag?
retval = MessageBox("Quit without saving?", NULL, MB_YESNOCANCEL);
if (retval != BM_CANCEL)
{
// Save first, then bail
// MB_NO == don't quit without saving
    if (retval == MB_NO)
        do_save();
 
    do_quit();
}
There. 10 lines, yes, but 2 are comments, 2 are just braces, and one is blank. Not a lot of stress on the old typing fingers, and a dramatic increase in readability and extensibility.
User Journal

Journal Journal: Snails as food

One important thing to know about puffer-fish is that their teeth grow quite rapidly and can get too big if not fed the right diet. If the teeth grow too big the puffer will not be able to eat and will starve. One of their favourite foods in the wild is the snail. The shell of a snail is enough to wear down the puffers teeth as he chomps through it.

User Journal

Journal Journal: New tank-mate - Cornelius

Gung-Ho has a new homey, a Sri-Lankan Red-Claw crab. Not my idea, but now that I've gotten rid of all of the guppies in the tank I listened to the gf when she asked if she could have him. Funny thing is that he's so afraid that the puffer will eat him that he doesn't come out at all.

Slashdot Top Deals

Why won't sharks eat lawyers? Professional courtesy.

Working...