Catch up on stories from the past week (and beyond) at the Slashdot story archive


Forgot your password?
DEAL: For $25 - Add A Second Phone Number To Your Smartphone for life! Use promo code SLASHDOT25. Also, Slashdot's Facebook page has a chat bot now. Message it for stories and more. Check out the new SourceForge HTML5 internet speed test! ×

Comment Re:welcome to python (Score 1) 148

Unicode support in Python 2 is basically the same as in Python 3. If you want to translate from binary strings to Unicode, you're going to need to specify a codec since the language doesn't just assume everything is UTF-8. The difference is that things like paths and command-line arguments are Unicode in Python 3 but plain binary strings in Python 2, so you wind up with this third "class" of strings that might be one or the other depending on which version of the language you're using.

But with a bit of care it's not hard to get a nontrivial amount of Python code to work unmodified in both versions by specifying import fallbacks and so on.

Comment Re:Haskell? (Score 2) 138

Haskell doesn't really have an "if" statement as such. It has an "if" expression (analogous to C's [expr] ? [expr] : [expr] conditional expression) but it's not widely used in my experience. Haskell folks would rather use guards and pattern matching to do the same job.

Comment mobile sites are a disease (Score 4, Insightful) 356

The whole point of HTML and CSS is that all this markup are suggestions to the client, who is free to rearrange elements, use different fonts or otherwise handle things differently for the benefit of the viewer. Making an entirely different, dumber, website for the benefit of some particular class of device defeats the purpose of a "world-wide web".

Make the devices better, not the websites worse.

Comment Re:Not all in the implementation (Score 1) 252

That's what I'm saying though, it's not all in the implementation, tail call recursion relies pretty heavily on the code being set up (and kept up) properly so that it is possible.

Writing code such that the last call in the function is always another call to itself isn't some deep mystery, though. The only question is whether the language is guaranteed to optimize that case.

Um, is that not sneaking in a normal iterative loop with a conditional check that's always true? What would be the difference from the code that generates and "while (1 == 1)"?

Since Haskell has no built-in "while" statement as such, you're going to need to either write an explicit recursive loop or just use one that's already been pre-built for running some action forever. It's just more obvious what's going on by using the latter.

Comment Re:I'm weary of recursion (Score 1) 252

Of course, in someplace like Haskell one can just use the "forever" function which loops some action forever rather than implementing an explicit tail-call loop and making sure to get it right. I'm just saying that recursion isn't guaranteed to blow up one's stack in all cases - it's all in the implementation.

Comment Re:Well, that's cool I guess (Score 1) 125

Browsers pushing stuff outside the standard may have given us the <marquee> and <blink> tags, but it also gave us the <table> tag. The good thing about having a standards body is that it can incorporate the useful stuff into the next standard while (hopefully) relegating the junk to permanent outcast status.

Comment Re:OS X (Score 1) 611

I go back and forth between OS X and Linux daily and a lot of OS X's window management is still sub-par. Its virtual desktop management still needs work, sloppy focus is never going to be an option, and hacks for tiling window management are about as terrible as one would expect.

It has its good points, but its double-buffered windows and nice aesthetics aren't enough to make me want to use OS X full-time while Linux environments do things better.

Slashdot Top Deals

Chemist who falls in acid will be tripping for weeks.