I believe that the majority of programmers agrees that using early returns for guard clauses is an okay exception.
372 karma · joined April 28, 2011
I believe that the majority of programmers agrees that using early returns for guard clauses is an okay exception.
Also, for example, when you have lots of "if" clauses, those languages force us to use mutable state (and a variable initialized as null) just to avoid early exits. But we can avoid both by treating the "if" as an expression, as in Ruby, Lisp, etc, or with the ternary conditional operator...
Plus, IMO, there are some situations where early exits are a good idea even in languages derived from C, such as with guard clauses/preconditions.
There's a nice discussion about that here with some points I made: http://c2.com/cgi/wiki?SingleFunctionExitPoint
(EDIT: I edited a lot but still couldn't make it clear that I agree with you, but I still ended up making points about completely different things, sorry about that, my english skills are lacking sometimes)
They fixed that. On newer OS X versions you can download the Command Line Tools (just 110mb) from Apple's website. You just need a free account: https://developer.apple.com/downloads
https://developer.mozilla.org/en-US/docs/DOM/navigator.id
I believe this merges the old BrowserID Session Management parts with Persona, or am I wrong?
Plus, your keys are stored in the browser, according to callahad, so Mozilla doesn't have to know where you signed up: http://news.ycombinator.com/item?id=4232774
Also, in the future you probably won't even need to contact Mozilla anywhere in the process: your browser will store your certificates for you, natively.
Btw, in Ruby there are two keywords that are basically backward gotos: redo and retry.
It argues that forward gotos (that work like continue, break, returns mid-function) don't contribute to spaghetti code, while backward gotos are more problematic.
I have a Sony Bravia TV and with every update its "UI" got slower and slower, until I disabled updates. I know it's got a lot of cool features in it, but I just wanted a simple TV.
http://www.quora.com/Orkut/Why-was-Googles-Orkut-built-on-AS...
His updated version of Hacker News isn't really that complex or incompatible with older browsers.
[1] http://en.wikipedia.org/wiki/Static_single_assignment_form
http://infoq.com/interviews/johnson-armstrong-oop/ http://erlang.org/pipermail/erlang-questions/2010-August/052...
But even with the current implementation it is possible to validate the assertion in your server without contacting browserid.org, but AFAIK nobody did it yet.
(I tried to find a reference for that, but they took it down from their Wiki. It used to say "You may choose to validate assertions on your own server": https://github.com/mozilla/browserid/wiki/How-to-Use-Browser... - the verification code is still online, though)
http://people.mozilla.com/%7Efaaborg/files/projects/firefoxA...
There's also some work on integrating existing e-mail providers, so you can get instant identities:
http://identity.mozilla.com/post/17207734786/id-provider-sup...
This is probably the web-thing I'm most excited about today, even though the development is kinda slow. I really want to implement it as a sole identity provider on my websites some day.
EDIT: I also began writing a Safari extension that would work like the mockup above, but gave up halfway since it was too convoluted and totally insecure... maybe I should try writing a SIMBL plugin or something like that.
"I'm starting a new open source web project with the goal of making the code as freely and easily runnable to the world as possible. Despite the serious problems with PHP, I was forced to consider it."
Every time anyone suggests improving anything, or make another product in a crowded space, this comic is posted. The author of this article doesn't even suggest a new platform - he suggests improving a platform that exists to enable easier deployment. It was posted yesterday for Chocolat... do we really have to stop making editors?
In a site targetted to hackers and startups it is disturbing that people are so unwilling to learn something new, support a new product, improve the world, do anything new. Yes, redundant standards suck sometimes, but it's not always the case.
I wish that the comic author would consider deleting this from the server, or maybe pg could ban it.</rant>
Woah, that was a crazy idea...
Those features aren't available on every functional language, and they're not really used indiscriminately as shown here on most Haskell code bases, so yeah, I maintain that this page is a terrible example (albeit a very educational and fun one).
Here's a Python version, showing that even on an imperative language there's a lot of ways of doing the same things:
This page is a terrible example. Most of these are not not what a "reasonable programmer" would do.
An unreasonable programmer would be able to screw up on any paradigm. You'd probably have even more ways to screw up like this with an OO language, creating classes for recursive functions, trampolines, a pattern matching class, implement an language interpreter inside your factorial implementation, etc.
Also, the fact that he found D, E and A among the results is probably because of modulations. It's VERY common for pop songs to modulate a whole step during some chorus near the end [1]. As mentioned, G, F and C are V, IV and I. If we modulate a whole step, from C to D, the V, IV and I are A, G and D. It would be nice to consider those modulations into the research.
About the key choice, I believe it's irrelevant. It depends a lot on what's your instrument (Bb, Eb is easier on brass instruments), your style (lots of Metal songs in the key of E because E is the lowest note on guitar), your tuning (lots of rock bands downtune their guitars to Eb or D etc), your proficiency, and, most important, the vocalists range.
--
[1] Otis Reeding - My Girl, Celine Dion - Because You Loved Me (actually lots of songs by her), Monty Python/Eric Idle - Always Look On The Bride Side of Life, Talking Heads Nothing But Flowers (If you search "whole step key change" you'll get a bunch)
It happens a lot here where I work: our legacy ASP.NET WebForms use Sessions (because it used to be easier this way) and once in a while people complain that the app kicks them after some 20 minutes.
Rails itself is normally installed via Rubygems (where it's updated directly by the Rails team), but the problem in this case lies with Ruby: for an up-to-date development/production environment you have to compile it by yourself or use something like RVM.