7,912 karma · joined Sep 11, 2009 (17y ago) · 3,625 submissions
https://twitter.com/dustingetz
comment 14y ago · link · parent
> “Kids are not stupid. They are among the sharpest,
> cleverest, most eagle-eyed creatures on God’s Earth, and
> very little escapes their notice.”
i wonder if this is because their lizard brain hasn't yet been trained to filter what's important vs what isn't.i find myself constantly questioning little details in my codebase like, "why do we thread a request all the way through the business logic" and i think the reason i catch these things, is because my brain hasn't become complacent with this style through 15 years of solving low level problems in C. all sorts of things jump out at me as accidental complexity that the most senior guys don't even notice. i think it's because it didn't used to be important, or maybe its not important to them because they wrote it over years and are already familiar, but it sure is important when you're trying to scale your team and they're facing a brick wall of code needing to be understood for every single little defect.
this complacency is why big codebases get so noisy that you can't see the nuances of requirements in a code review. it's not possible to ask high level questions like < http://www.dustingetz.com/how-to-read-code > without aggressively abstracting away all non-essential complexity. breaking experienced people out of this complacent tolerance for accidental complexity, as we tackle higher and higher complexity, is a really hard problem.
comment 14y ago · link · parent
overtone comes with a stock emacs config that will get you livecoding in no time.
after that, Joy of Clojure by Fogus. (edit: fwiw i have had no trouble with this book even as my first lisp, but i've been coding in a functional style for about 6 months before clojure)
comment 14y ago · link · parent
there's certainly a need for articles like this, targetting an audience of java devs, if only they were correct. I haven't found much.
comment 14y ago · link · parent
Simon Peyton-Jones (haskell creator) often says in videos that haskell is a sandbox for playing with CS ideas that haven't yet mainstreamed. Monads are a great example - haskell's purity helped distill the idea into something less opaque and now these ideas are starting to pop up in mainstream languages - "jquery is a monad"[1].
its not haskell that is dumb, dumb is when people try to use haskell for things it wasn't designed for. Scala and Clojure are both chock full of functional opinions yet designed to be practical.
[1] http://importantshock.wordpress.com/2009/01/18/jquery-is-a-m...
comment 14y ago · link · parent
currying is really really easy and everyday python programmers probably do it on accident.
def divisible(n, x): return n % x == 0
def divisors(n):
possible_divisors = range(2, int(sqrt(n))+1)
return filter(lambda x: divisible(n, x), possible_divisors) # OMG curry !
assert divisors(24) == [2, 3, 4]comment 14y ago · link · parent
page-rank's design is open to being gamed which has led to an arms race of algorithm tweaks. A social graph has much more powerful signals for figuring out relevant search results.
this isn't a hypothesis. the first iteration is called "search plus your world" and everybody already knows about it.
comment 14y ago · link · parent
so it depends how he structures his taxes. if he can get his taxes calculated yearly instead of per session, taxes make him a bit less of a winner. if his taxes are calculated per session, he is -EV. this is the same problem that poker players face, IIRC the precedent there is that if you file as a small business you can sum your wins and deduct your losses annually.
(/me used to be a small-time poker player)
[1] expectation in blackjack is computable because perfect play is deterministic, expectation in poker is harder because it depends on human factors like your mood and your opponent's skill level and his mood. you can only measure past expectation. A lot of players think they are winners but are really breakeven or losers, but blame it on bad luck.
comment 14y ago · link · parent
he negotiated a .25% houe edge (roughly half of normal perfect play) and if he loses 500k he gets 20% back, each session independent.
check this analysis. he is +EV by martingaling his wins - 7/8 times he loses 400k with a 20% discount (400k x 7 x .80 = 2 240 000), 1/8 times he wins 400k x 8 with no reverse-discount = 3 200 000, so that's a mil in EV. if he pushes his martingale as far as he can his expectation grows superlinearly, which is why he martingales his wins until they cut him off.
is this math right? if he was -EV, the house would let him keep playing, hence telling him he can continue to play under normal rules. note he refused.
update: an easy way to see this (gross oversimplification) is if he plays only one hand/session he stands to win 100% of the money 49% of the time and loses 80% of the money 51% of the time.
comment 14y ago · link · parent
i dunno if this is valid python but it demonstrates the idea
doSomething(
identify_vertebrate(animal) if animal.is_vertebrate() \
else identify_invertebrate(animal))
doSomething( if( is_vertebrate(animal)
identify_vertebrate(animal)
identify_invertebrate(animal)))
(doSomething (if (is_vertebrate animal)
(identify_vertebrate animal)
(identify_invertebrate animal)))
this is part of "referential transparency", and once you get past "OMG parens" you realize its a Good Thing. parens are caused by a style preferring composition of expressions over executing statements, not lisp.comment 14y ago · link · parent
many of your essays have an air of someone who already gets it circle jerking[1] with the other people who already get it. You do it when you talk about Lisp, and when you talk about big companies, and you're now doing it by comparing copyright infringement to "stealing smells". Its unfortunate because it builds a cult or clique of people who "get it" rather than helps to spread an idea to the masses. It's also unfortunate because you outright dismisses other people's opinions, which is arrogant, and dangerous.
The "in crowd" understands your metaphor, but to the people who matter, those who don't already understand the issue, your metaphor is worse than useless - its actually harming our credibility. Quite easy to imagine a RIAA lawyer tearing your analogy to pieces, you know, by DH6: refuting your central point. You're arguing against an opponent without demonstrating that you even understand their argument. that's, like, what, DH3? I wish you would strive to use the incredible influence you've built up more effectively, and refocus away from the startup crowd, and towards the wider audience of people who could stand to learn something from you.
[*] DH3: http://www.paulgraham.com/disagree.html [1] "circle jerk" - i paused on this metaphor for a few moments, but i can't think of a better one!
comment 14y ago · link · parent
http://en.wikipedia.org/wiki/Nash_equilibrium#Prisoner.27s_d...
comment 14y ago · link · parent
The current counting that we do gives the wrong numbers, in the
edge cases. To my knowledge a deleted sysfs directory has never
returned nlink == 0.
Keeping compatibility is easy enough that it looks like it is worth
doing, but maintaining 30+ years of backwards compatibility is what
nlink >1 in unix filesystem directories is. I don't see any practical
sense in keeping . and .. directories on disk or upping the unix
nlink directory count because of them. To me it looks like just one
of those things you do. Like hash directory entries so you can
have a big directory and still be able to have a 32bit offset you
can pass to lseek that is stable across renames and deletes.
to use PG's terms, Linus is arguing against this at DH0 or maybe DH1 here[1]. Maybe the above argument sucks, but Linus didn't refute it at all.comment 14y ago · link · parent
i recognize a lot of old school lispers follow a philosophy of "lisp empowers me so much that i don't need a team", so they do whatever they want and their productivity so godly that nobody says anything, but this isn't particularly helpful to increased lisp adoption, which benefits us all. maybe it isn't harmful either, but we who are already using it aren't in a position to judge this.
comment 14y ago · link · parent
we can use these ideas to elegantly solve the second greplin challenge question: "find the smallest prime fibonacci, X, greater than 227,000; compute sum of prime divisors of X+1"
pred = lambda x: x > 227000 and is_prime(x)
X = take(lazy_filter(pred, fib_gen()), 1)[0]
print sum(filter(is_prime, divisors(X+1)))
https://github.com/dustingetz/sandbox/blob/master/etc/grepli...comment 14y ago · link · parent
what is your draft management workflow like? this is important to me too, more important in fact than optimizing for people to actually read the blog, because if draft management sucks then i don't blog enough to get readers.
comment 14y ago · link · parent
> Can you imagine your designers simply copying and pasting
> from iOS's default theme? It's very bland, it turns off
> users before they even use it
i recognize UX is really important in ios, especially since a lot of ios apps target the $1 casual user market. There are a lot of other markets and types of business, for example enterprise webapps, where a product which solves their business need matters, and using a stock theme does not matter, we don't even have a designer on staff.comment 14y ago · link · parent
edit: as opposed to just building it themselves, what's so hard about a chat app? maybe i underestimate the amount of iteration in the hipchat product and they're buying that product knowledge, not the tech.
comment 14y ago · link · parent
so i certainly agree with this, but in my experience, as the problems get harder, my happiness isn't determined by syntax.
the things that make me mad are "i have to fix this defect but this code is a fragile mess which i'm afraid to touch, so i bandaid on more hacks to have the minimum possible area of impact so i know for certain that i can give this to the client and it won't make things worse". that makes me fucking furious, man, the artist in me dies a little bit every time I do it. We have this issue in our large javascript codebase. CoffeeScript would probably help a little bit, but a speculative 2x improvement in "fucking furious" is still furious.
This opinion is probably along the lines of those who think CoffeeScript is a toy. List comprehensions don't fix our problem; we (my team) just don't care. investing in education, growing the teams ability to craft well factored code and stable code, that will have exponential payoff.
Now you can get meta here and say a language like ClojureScript which brings Clojure's strong opinions about managing complexity and crafting good abstractions - you get better just by using it, its sort of self-educating. ClojureScript has my attention.
comment 14y ago · link · parent
as your project gets big, does coffeescript help us write more maintainable code, better abstract our solutions so we can keep less things in our head at once, resulting in higher agility and fewer bugs? When you look at the deep reasons why a large codebase went sour, you're not blaming it on things like list comprehensions, you're blaming it on things like "Java strong-arms us towards building abstractions with only OOP, which over the course of a few years builds into indecipherable layers of implementation inheritance, causing high defect rates and much decreased agility".
The difference between CoffeeScript and Javascript, in terms of what a team can accomplish, hasn't been proven in production-scale projects. they may be, or maybe only for some teams, or maybe they aren't, but you can't debate something without being able to articulate the opponent's position.
update: interestingly, ClojureScript may be a language where the productivity delta from javascript is much larger, and is better worth it. clojurescript introduces new ideas and idioms to the js community, where coffeescript is an incremental update to javascript with no new ideas.
comment 14y ago · link · parent
Jane Street Capital (world-class FP shop) is famous for two things: a) having a ridiculously hard interview, and b) hiring the best of the best. their interviews are blogged all over google. they ask everything from "three bags - apples, oranges, mixed; all mislabeled; how many guesses do you need to label them properly" to "implement a perl-style regular expression parser. on the whiteboard. in 45 minutes."[1]
i'm not sayin' i dig the puzzles, but I've read a few of their whitepapers, they are definitely better engineers than I am. and if i ever decide to interview again (once upon a time i insta flunked a phone interview), you can bet i will be a godly puzzle master. no matter the outcome, i bet i learn something about why they ask the questions they do.
[1] https://www.quantnet.com/forum/threads/detailed-in-person-ja...
comment 14y ago · link · parent
lol. you're looking for SICP[1] and if you're interested in this stuff, and you haven't read it yet, you should a) buy it and burn all your other books so as not to distract you, b) google "sicp site:news.ycombinator.com" to convince yourself i'm not full of hot air, and c) email me so i can get you in on my online participate-as-you-have-time discussion group which is not yet organized but we will start in a week or two ;)
[1] http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-4.html#...