HNHacker News
TopNewBestAskShowJobs

sah

1,374 karma · joined March 4, 2008

My company: http://saucelabs.com/

YouTube videos: https://www.youtube.com/user/hackerdashery

My twitter feed: http://twitter.com/sahazel

My website: http://awesame.org/

Side projects: http://codepad.org/ http://omgaudio.com/incoherence/

submissionscomments
sah··on Ruby-style Blocks in Python
I see your point about the bad interaction between indentation-based block delimitation and parens for function parameter delimitation.

But I think something like Ruby's block syntax should be doable, and probably you can even pass multiple blocks, with some limitations on which parameters can receive them. Here's another shot at it, just for fun: http://codepad.org/mVigj978

sah··on Ruby-style Blocks in Python
Yeah, Python has named local functions:

  def f(x):
    def g(x): return 2 * x
    def h(x): return 1 + x
    return g(h(x))
More interesting was your point that Haskell has anonymous functions and is whitespace delimited. I don't think significant whitespace and anonymous functions have any connection at all.
sah··on Ruby-style Blocks in Python
Would you find it problematic to write if and for statements like this?

  def _forbody(x):
    def _ifbody(x):
      print x
    if x % 2: _ifbody(x)
  for x in xrange(10): _forbody(x)
sah··on Ruby-style Blocks in Python
Obviously no reasonable person wants Python to be identical to Ruby, since those who like Ruby better can go use it. But Python has over its lifetime incorporated new ideas from other languages. Giving substantive reasons why you don't like this particular idea would be a lot more interesting than just registering your distaste for it.
sah··on Ruby-style Blocks in Python
You wouldn't want to have to declare named functions for the bodies of built-in control flow constructs like if/else statements and for loops, right? All of the reasons why also apply to why you might not want to declare named functions in order to pass them to other functions.

Read some Ruby code that uses blocks for an example of how passing anonymous functions can become a very clear and natural idiom. In Ruby, you can write your own simple control flow constructs in the form of functions that take a block -- in fact the idiomatic way to iterate through a collection in Ruby is with a function rather than a built-in control flow construct.

In languages like Lisp and Smalltalk, where functions can naturally take more than one in-line block, you can write any control flow construct yourself.

sah··on Ruby-style Blocks in Python
You might say by the same argument that single-line lambda expressions take care of 90 or 99% of cases, and you should revert to using named functions for the rest.

I don't think either is true -- if you have more flexibility in the syntax, you'll do more with it.

sah··on Ruby-style Blocks in Python
A similar feature was already proposed and rejected: http://www.python.org/dev/peps/pep-0340/

Anyway, I'm kind of sad that people seem to want a straight copy of Ruby's blocks. I'd prefer syntax that allowed passing more than one block to a function, like the C-like syntax I proposed here: http://www.hackerdashery.com/2006/10/code-blocks-and-c-like-...

sah··on Heyzap (YC W09) launches: The forming of Heyzap and some lessons learnt
A great team can sometimes recognize a bad idea early enough and replace it with a better one. I've seen that happen. Good ideas have a lot less ability to replace bad teams. (Or rather, they can do that just fine, by letting the bad team fail while their competitors win.)
sah··on The Untold Millions
When I first realized that various small businesses and websites I was familiar with were quietly making millions, it changed the direction of my ambitions and got me interested in starting a business. So, I found that pretty interesting.
sah··on The Untold Millions
"if some business really wants to remain private about their success, then why blame the media or anyone else for not talking about them"

Because it's the news media's job to tell us about interesting and important things that are happening in the world, regardless of whether the people directly involved want us to know. If you get your facts from the news, you get a distorted picture of how money is being made, and that means that the news has failed you.

sah··on SenCSs - CSS framework that doesn’t provide a layout system (just everything else)
Can someone explain what a CSS framework is, and why I might want to use one?
sah··on The nicest math book I own
Well, they certainly don't when the ensuing argument buries the valuable thread in question!

Lots of good book recommendations below, folks. Keep scrolling.

sah··on 11th grade
Wow, your school was a lot better than mine.
sah··on "Holy Fucking Shit I Was Just In A Plane Crash"
I assume that if cell phones were even a little likely to cause plane crashes, passengers wouldn't be allowed to carry them on planes at all.
sah··on [dead]
The real gain is that I can find interesting things without wading through the crap on Reddit, and read comments from the news.YC community.

I think this article was fine.

sah··on [dead]
If the number of slaves is growing more slowly than the population, slavery is on the decline as a cultural institution, even if the absolute number of slaves is increasing. I would feel good about that.
sah··on Java is Dead; Long Live Python
Some languages have more strengths (or more weaknesses) than others.

If you want to claim that every language is useful and good in its own special way, you may have to accept that COBOL is primarily good at being compatible with old systems based on COBOL, and Pascal is useful mainly for failing to teach computer programming in the 1980s.

sah··on The other half of "Artists Ship"
I think the costs of safety checks can be more pronounced in software than in other areas of business. It's not just that good hackers are particularly irritated by them -- they're irritated for a reason.

A two-week release-process lag is so much worse than it might sound. If you can ship instantly, you can get feedback and make improvements rapidly, over and over. Sure, without a careful release process you might occasionally break things, but when you do you can fix them in minutes rather than weeks. When you insert release-process lag into that cycle, improvements that might have been made in a rapid series of releases over a day or two can take months. Sometimes those improvements just never get made, because no one is motivated to keep working on them for so long.

In software, "stable" often means "unchanging", but only rarely means "high-quality".

sah··on µTorrent for Mac released
Newer versions of uTorrent have features designed to maximize its bandwidth usage while getting out of the way of other network traffic, so that it doesn't monopolize your connection. Not much has been written about that stuff so far, but some of it is pretty interesting technology. There's a little bit of info in this forum thread:

http://forum.utorrent.com/viewtopic.php?id=49813

sah··on Co-Founder(s)
Isn't that a separate issue? You can be part of a company from day one and not have any input into its direction, and maybe sometimes you can join late and have significant influence on future decisions.
sah··on Co-Founder(s)
So what do you call someone who joins a company before any salaried employees and has equity comparable to that of the founders?
sah··on A Web OS? Are You Dense?
Come on, it's not as simple as "WRONG".

Chrome acts more like an OS, in part by delegating many tasks to the OS itself. Firefox does more of what an OS needs to do, because it does all the work of handling those tasks in a simplified way itself, rather than delegating.

sah··on A Web OS? Are You Dense?
Does Linux boot, or is that GRUB/LILO? Remember loadlin? Does that count? What about Windows XP under VirtualBox?
sah··on Stack Overflow: the Blind Leading the Blind
Iterate through the list bitwise-XORing the numbers together into an accumulator. Because x ^ x = 0, and x ^ 0 = x, and ^ is commutative (x ^ y = y ^ x), the final value in the accumulator for a list like [x, y, y, x, z] is:

    x ^ y ^ y ^ x ^ z 
  = x ^ x ^ y ^ y ^ z
  = 0 ^ 0 ^ z
  = z
sah··on F# to get units types
More languages should have a facility for keeping track of units and doing conversions, regardless of whether it's done in the type system or at runtime.

Making this a part of the type system seems a little strange to me. Obviously it's nice to get warnings at compile-time or in the IDE. But I keep trying to imagine how you might make a feature like this useful as a parameter to strings, or a user-defined type, and with functions other than the arithmetic operators.

sah··on 10 Things Millionaires Won't Tell You
Sure, whether you need to work to earn a living depends on the standard of living and risk level you're comfortable with. But I think it's possible to set a reasonable upper bound. Say, around the point where your interest income at a typical risk-free rate, after reinvestment to keep pace with inflation, would put you among the highest earners in the world if it were ordinary income. Defining "highest earners" as those in the top two US tax brackets, that amount is currently around $8-10M, or on the order of 2^23 present-day dollars.

Personally I think on the order of 2^22 dollars reasonably qualifies as well. Maybe that's because of the standard of living I'm used to. Certainly if you have 2^24 dollars and you don't think you're rich, you have a definition of wealth that ignores a major qualitative difference in what a person can afford to do. Above 2^23 dollars, I think additional wealth begins to put you more in the realm of the low-level aristocracy and rulers than the merely rich.

sah··on StupidFilter Project
You're spelling "you're" wrong.
sah··on 10 Things Millionaires Won't Tell You
I think the clearest line between rich and not is whether you have to work to earn a living. In my book, if you're an "earner" at all, you're not rich yet.
sah··on Cloud computing customer bill of rights.
What's wrong with making known physical location a service that you buy, rather than a right? A right is really just a service that you can't not buy.
sah··on XML Backlash?
I would argue that there's very little value in standardizing that syntactic stuff. Whatever tiny amount of value there might be is probably destroyed by picking a convention as almost universally inappropriate as XML.
← PreviousPage 2 of 8Next →