HNHacker News
TopNewBestAskShowJobs

nwhitehead

436 karma · joined April 6, 2011

Amber Whitehead shimmermathlabs.com
submissionscomments
nwhitehead··on Why is YAGNI a good rule?
There are three reasons why YAGNI works so well.

First, people systematically underestimate uncertainty. The human brain is good at recognizing patterns and making plans but not so good at dealing with randomness and uncertainty. When talking about software development and maintenance we're talking timescales of years. Companies go out of business, projects get cancelled, code gets thrown out and rewritten. It's easy to paint a pretty picture about how the Cat class will get added to the Pet hierarchy but there is tons of uncertainty involved in even the simplest project. Because the scenario is specific the brain overvalues its likelihood compared to the nebulous unknown alternatives.

Second, keeping code as simple as possible is almost always for the best. YAGNI forces smaller simpler code. More complexity and more code means more room for bugs. All the studies I know of consistently show that more code means more bugs.

Finally YAGNI is a principle that forces priorities to be in the right place. The question is never between spending time making something that might be useful in the future or doing nothing, it's between doing one particular useful thing or another. I can't think of a single case where the right priority is to do something that MIGHT help in the future. You start by doing things that DO help now, then things that WILL help in the future.

nwhitehead··on The Man Who Invented Modern Probability
> But then, is any mathematical abstraction real? I guess it's all beside the point.

I actually think the reality of mathematical abstractions is hugely important because of... computer programs! In a real way, programs are the embodiment of mathematics. I want my programs to work so I need the underlying math to work as well.

That's why I'm a constructivist. I reject the law of the excluded middle because proofs that use it don't translate into real programs; they translate into programs that ask an omnipotent oracle to decide which branch to take. Constructive proofs translate into working programs.

It also ties into philosophy. I am a skeptic, so when someone tells me either A or not A must be true even if we can never know which one, I ask for proof or justification of that fact. The justifications that I get are remarkably similar to logical "proofs" that god exists, and just as fallacious. This isn't to say that there couldn't be an ultimate truth about A or a god, just that it is not logically necessary.

nwhitehead··on The Man Who Invented Modern Probability
For each fixed length there are a finite number of programs of that length. If we use 8-bit bytes for the alphabet, there are 256^N programs of length N. The set of ALL programs is infinite (we don't limit the length of programs), but it is countable.

The "countable" part means we can put the set into one-to-one correspondence with the natural numbers. The correspondence starts with 0 mapping to the empty program, then 1-256 mapping to programs of a single byte, then 257-65793 mapping to the programs of two bytes, and so on. This mapping will hit each program exactly once, and it will hit every program because every individual program has a finite length.

Different types of infinities are not intuitive so don't feel bad if the concepts are confusing. These issues troubled lots of very smart mathematicians for decades. The existence of irrational numbers was hugely troubling to Pythagoreans. The existence of uncountable infinities discovered by Cantor was shocking [1].

[1]: http://en.wikipedia.org/wiki/Controversy_over_Cantor%27s_the...

nwhitehead··on The Man Who Invented Modern Probability
Consider the set P of programs that take no input and generate an infinite stream of digits. Each program in P has a finite length and is written out of a finite set of symbols, so there must only be a finite number of programs of any given length. That makes P countable. Let Q be the set of numbers described by programs in P. Each program from P describes exactly one number, so Q must also be countable. The set of irrational numbers is uncountable, so there must be an uncountable set of "complex" irrational numbers remaining after you take away all the "non complex" ones in Q.
nwhitehead··on Papers, Please - A Dystopian Document Thriller
My wife is addicted to this game already. Just hearing about the decisions she's making makes my skin crawl. She's a total graphical adventure game snob, so if you're one too it's worth checking out this game. The multiple endings are well done, which is often a tricky part to get right.
nwhitehead··on Is Employer-Based Health Insurance A Barrier To Entrepreneurship? (2010)
You're right to look at the marginal tax rate but you're not considering all the options available. For goods like a hamburger it's easy to see why a tax on hamburgers makes people buy less hamburgers. Hamburgers cost more with the tax, so you can save money by buying chicken nuggets instead. This doesn't mean everyone will switch to chicken nuggets, just that many people who slightly preferred hamburgers to chicken nuggets before the tax will now switch over and slightly prefer the chicken nuggets after the tax.

For business and entrepreneurship the argument is the same. Increased taxes and other types of costs decrease the rewards so you'll end up with less of it. It's not that business owners don't want more money. It's that they are continually deciding between many options.

For example, years ago I had to decide between going to graduate school, getting a job in industry, and starting a business. The tax and subsidy breakdown is drastically different between all three. Of course tax implications wasn't the biggest factor in my decision, but it mattered.

nwhitehead··on Ten Signs a Claimed Mathematical Breakthrough is Wrong
Using logic to "prove" God exists isn't totally crazy, just mostly crazy. Gödel himself tried his hand at it [1].

[1]: http://en.wikipedia.org/wiki/G%C3%B6del's_ontological_proof

nwhitehead··on Tuples in JavaScript
Actually thinking about it more you might want to have "Tuple" and "MutableTuple" objects. In languages that use parentheses notation for tuples you need to decide which one you want, but since you have names you can have both just with different names.
nwhitehead··on Tuples in JavaScript
I like the "unpack" idea of using a function to name the parts of the tuple, it's elegant and fits well into JavaScript. I'm a bit less sure about exposing the "pack" method outside the constructor. That makes tuples mutable, which isn't what I normally want. Normally I want immutable collections of possibly mutable objects for my tuples. If I wanted a mutable collection I would use an array.

I absolutely hate the idea of "valueOf". Why would you ever in your life want to add together tuple values by default? It's a misfeature that is begging to cause bugs. A better feature would be some way of applying functions across tuples of the same size (map and fold type operations) to make it easy to build up correct comparison functions.

nwhitehead··on Why Is Netflix Secretly Cropping Movies?
My guess is that this cropping is being done by video editing service companies at the request of the studios.

Netflix and a studio come to a distribution agreement. Netflix tells the studio the technical requirements for the digital files to send over. The studio realizes they don't have exactly the right format on hand, so they contract out to some firm to encode their content. The studio may not realize that there is an aspect difference, and the service company might automatically adjust the cropping to make it fill the screen to fulfill their contract and meet the technical specifications.

nwhitehead··on Monads Made Difficult
Try the free online textbook Category Theory for Computing Science by Michael Barr and Charles Wells [1]. It's a true textbook with exercises and lots of content.

[1]: http://www.math.mcgill.ca/triples/Barr-Wells-ctcs.pdf

nwhitehead··on Let's Play Ancient Greek Geometry
This is awesome!

Thoughts: after clicking, sometimes I decide I want to cancel drawing from that point. I can click on the original point to cancel, it would be nice to be able to press ESC or SPACE to cancel drawing (just noticed that Z for undo cancels).

For the "game" side, it is very important to have simple tasks that almost all players can complete to get started. I would add an even simpler first challenge, such as make two overlapping circles.

I would love to be able to share constructions. I'm thinking a button I press that pops up a URL that I can share. When visited it shows an animation drawing the construction, then when done lets you do more drawing. That would be cool.

nwhitehead··on How to “Pick the Brains" of Busy People Without Them Even Knowing It
This reminds me of the strategy for getting Linux help. Just wander around near the cubicles with penguins on them and say, "It's too bad Linux doesn't support foo." You'll have energetic Linux hackers proving you wrong instantly.
nwhitehead··on Ohio Police Department Using Fake Drug Checkpoints
The current best practice is that when police ask you to give up your fundamental rights you politely say no. Calmly say, "I don't consent to searches."

There is literally nothing good that can come from giving up your rights if you are innocent (for you personally, for the police, for society).

nwhitehead··on The TV Apps Economy Will Be A $14 Billion Business
If you have a good idea for a television app you can build it and publish it now on Roku. No need to wait for some revolution or anything.

To get started in Roku development just takes a Roku device for testing (cheap) and free registration as a developer [1]. You build applications using a custom language (BrightScript) that is similar to Lua or VB. Once you're done you can publish your app for free or charge for it. Publishing channels that show up in the main channel store requires Roku testing and certification, which can take a few weeks sometimes.

My experience developing apps on Roku has been pretty positive. The biggest negative is the non-standard language and environment (they should have gone with an existing language IMO). Another issue is that you can't show foreign language content, they now have a DISH Network exclusive agreement for foreign channels.

[1]: http://www.roku.com/developer

nwhitehead··on The Obesity Era
This is an interesting hypothesis. It wouldn't even have to be changing percentages of ingredients, it could simply be the result of increased agricultural efficiency and yields. 100 calories worth of corn feed is quite likely to be subtly different in composition today than decades ago.
nwhitehead··on 'I've Got Nothing to Hide' and Other Misunderstandings of Privacy [pdf]
You're wrong. The constitutions of New Hampshire, Kentucky, Pennsylvania, Tennessee, North Carolina, and Texas allow for the people to abolish the government.
nwhitehead··on How FPGAs work, and why you'll buy one
This article reminds me how much fun it is to program an FPGA. It's one of those mind-expanding exercises like learning logic programming or writing a purely functional persistent data structure. "Describing hardware" is quite a different way of looking at computation.

In case you want to try, I had good success playing around with the Altera DE2. It's got lots of "goodies" on the dev board and there are lots of existing class projects, class notes, etc. that use it. It's fun to get your own tiny CPU working and have it flash HELLO WORLD on the LCD display. You have to worry about bugs in your CPU as well as bugs in the program running on your CPU.

nwhitehead··on Facebook is Getting Old
I think there is something to the idea of generational mixing on Facebook causing a loss of value. A friend today posted a picture of a cat with its tail in the air where the "view" looked like Jesus. His mother then promptly commented how not funny it was. Facebook with your parents on it is a different world than it used to be.
nwhitehead··on There Was a Time before Mathematica
Another fun read is the listing of original developers of Mathematica in the Addison-Wesley "Mathematica" book and what they worked on.

http://omohundro.files.wordpress.com/2009/03/wolfram88_mathe...

nwhitehead··on Heap for iOS: the capture-everything approach to mobile analytics
Do you have any case studies showing what the actual overhead is? I love the idea but would worry about negatively impacting the customer experience.
nwhitehead··on 'The chair is out to kill us'. Studies point to the health risks of sitting
All the studies so far indicate sitting (or other forms of inactivity) are bad no matter how much you exercise at other times.

The best natural experiment was the London bus driver study which showed huge differences in heart problems between drivers (sitting all day) and conductors (standing all day). Both were drawn from the same pool of employees and randomly assigned roles, so the experiment was naturally controlled for everything except the difference in behavior.

There were some other differences such as drivers having a more stressful job and conductors having more social interactions which might explain some of the differences in outcomes apart from the sitting/moving difference. But in any case, sitting for hours a day at a stressful job with minimal social interaction is incredibly bad for your health. Programmers take note!

nwhitehead··on This is why you're getting paid late
It's almost a tautology, but by paying late you keep your cash available for other uses until you pay. Cash flow can be the limiting factor for many (most?) businesses.

Another way of looking at it is that by paying late you pass some risk from yourself to the recipient. Interest rates quantify both the time value of money and the risks associated with payment in the future. Paying late without penalty is an interest free loan.

nwhitehead··on Reddit’s Pitch deck to Advertisers
Think of it this way, the advertisers that can't deal with kittens with lightning out of their eyes in the pitch deck are also likely the ones that would have a bad experience advertising on reddit and interacting with the community. By being authentic in the pitch deck, they deter clients that should be deterred, and attract clients they want to attract. Being authentic is a better, more efficient strategy.
nwhitehead··on How often do iOS users update? - The Pareto Distribution
Wow, that graph is very surprising to me. I only update apps when I update iOS (very rarely). I find it supremely annoying to update things manually. I would worry that the population being captured is not representative of the general app using population.
nwhitehead··on Bitcoin Network Speed 8 Times Faster than Top 500 Supercomputers Combined
Computing SHA hashes is embarrassingly parallel, but LINPACK is NOT embarrassingly parallel. LINPACK, like many scientific applications, requires a fair amount of communication. Comparing hashes per second to LINPACK scores is really apples to oranges. A better comparison is to simply add up numbers of similar GPUs and CPUs and ignore all the benchmarks.

Bitcoin enthusiasts should also consider that the Top500 is not an exhaustive list; governments have much more computational power than is on the list.

nwhitehead··on Tailgating YC
The theoretical payoff of sticky bonuses is one minus twice the house edge [1]. The house edge of slot machines varies between 5-15%, so with optimal play you should be able to get out $.70 to $.90 per sticky bonus $1. By cashing out earlier than optimal, you get less return at a steadier rate (a reasonable tradeoff).

[1] http://wizardofodds.com/gambling/glossary/#sticky_bonus

nwhitehead··on Tesla Model S Suspension Walkaround
Reading about suspensions reminds me of the inerter (J-damper) [1] used in F1 racing. It was discovered by analogy with electrical circuits; it was the missing mechanical part corresponding to a capacitor.

[1] http://en.wikipedia.org/wiki/Inerter_(mechanical_networks)

nwhitehead··on Don’t Launch Your Product
Maybe don't drink any kool aid at all and focus on delivering value to customers.
nwhitehead··on Postgres on the GPU
The fun part of parallel programming is getting things running on your GPU, parallelizing the algorithm, then tuning and optimizing the code. This is easier, faster, and more pleasant in CUDA with it's mature tools and ecosystem. That's why open source projects often use CUDA.

The advantage of OpenCL is that it runs on more platforms (not just NVIDIA). The problem is that it's more complicated and more of a headache.

My advice to programmers is to start with CUDA and play around with your problem for a while. Time spent learning how GPUs work, what kinds of operations are efficient, and how to parallelize algorithms is not wasted if you switch to OpenCL later. Once you've made some progress then make an informed decision about whether you want to go to production with CUDA or OpenCL.

← PreviousPage 3 of 5Next →