HNHacker News
TopNewBestAskShowJobs

dmethvin

2,736 karma · joined February 19, 2010

[ my public key: https://keybase.io/dmethvin; my proof: https://keybase.io/dmethvin/sigs/pw6fnhJ4hnh71_6xDqUydXLPbPVOD8MoH-V4VZqGJaY ]
submissionscomments
dmethvin··on Why I moved to Miami
Looks pretty good in the immediate area: http://www.walkscore.com/score/253-ne-2nd-st-miami-fl-33132
dmethvin··on A "Hacker's" Guide to the Bay Area
> One of the biggest shocks I faced when I arrived to the Valley was finding out that it was a very suburban environment. Mountain View, Palo Alto, Sunnyvale are completely suburban.

I suppose it depends on your definition of "suburban". Each one of those cities has a bona-fide city center and nearby residential development dense enough to allow a very walkable environment. It's a lot worse in many places back east including my area.

http://www.walkscore.com/CA/Mountain_View

http://www.walkscore.com/MD/Columbia/21045

dmethvin··on This 4×6 index card has all the financial advice you’ll ever need
Their expense ratios are pretty decent: https://personal.vanguard.com/us/funds/vanguard/all?sort=nam...

And, the idea of the target funds is that they become more conservative as you reach the target. The pure index funds do not. So they are basically index funds with portfolio rebalancing.

https://institutional.vanguard.com/VGApp/iip/site/institutio...

dmethvin··on Google Analytics to Drop IE8 Support at the End of 2013
Unfortunately, Android 2.3 is not fully ES5 compatible either. Since that's about one-third of all Android I doubt that ES5 compat was the driving force for this move. More likely it was the non-W3C event model and general non-use of IE8 for the reporting interface.
dmethvin··on Microsoft CEO Steve Ballmer to retire within 12 months
Ad popups - Separate windows with ads based on your browsing history or even whatever they find installed on your system.

Ad injection - Putting ads on web pages they didn't write, such as Google search results.

Ad substitution - Replacing ads on web sites with their own ads.

Cookie stuffing - Injecting or clobbering referral cookies for sites like Amazon so that they get an undeserved commission on things you buy.

dmethvin··on Javascript Frameworks Are Amazing and Nobody Is Happy
> Congrats Javascript--on almost being as good at data-binding and layout as VB6!

That's total garbage. The browser does awesome presentation and layout with the markup you give it and you can control what happens via declarative CSS. VB6 couldn't even make a dialog look nice when you changed the system to Large Fonts.

Silent failure? You must have forgotten `on error goto 0`.

dmethvin··on Tesla Model S achieves best safety rating of any car ever tested
These are very high voltages. The Tesla is 375 volts and the Prius is 275 volts.
dmethvin··on Sheryl Sandberg earns $100M, but won't pay interns
In the US, labor laws are pretty clear about when an internship can be unpaid. The position needs to be an experience similar to an academic class for the intern and can't displace a paid position for example. That Facebook post is asking for several specific skills as if it's a job posting, which is a red flag in itself.
dmethvin··on HTML.js – Befriend the DOM
If you just need the selection/traversal/manipulation of jQuery then just make a custom jQuery build with that. If that is still "too big" then use the alternate (qSA minimally wrapped) selector engine instead of Sizzle. Instructions are in the README in the jQuery repo.

The advantage of this approach is that if you decide you need more of jQuery (for example to support a plugin) you can pull in what you need rather than reinvent and debug your own.

dmethvin··on Android Fragmentation Visualized
Popular in what sense? Because developers like it, or because developers have to use it in order to reach their audience? By the latter measure, Ticketmaster is the most popular ticket vendor.
dmethvin··on The Humble Programmer (1972)
These are just engineering tradeoffs. Sure you need to weigh them carefully, but the fact that we spend more on software than hardware does not indicate a horrible failure in the industry.

For example, processing power, communication speed, and storage has improved by orders of magnitude, but battery capacity is perhaps better by one factor of ten. Much of the advance in battery life comes from reduced power consumption by other components. Much of the advance in software development has come by creating inefficient abstractions that let us create things faster but squander CPU, network, and battery life.

Most companies today are willing to burn up some hardware performance in order to reduce software development time. If they're burning too much, they'll fix it or they'll go out of business. Premature optimization is still not a good idea.

dmethvin··on Free email address validation API for web forms
Have you ever worked on e-commerce sites? Bad email validation or the requirement for a confirmation email can kill business. If a user buys a product but types `sally@yahhhoo.com` and then doesn't get their purchase or shipping confirmation, you can bet there will be long labor-intensive interactions with customer service. Getting a high confidence value in an email address without a confirmation email has great value.
dmethvin··on Avoid JS callback hell with 'yield' (example of a new WebDriver library)
Where's the error handling?

The `yield` calls are definitely simplifying the no-errors case, but it looks like any of those yields can throw an error back to the enclosing function. All the errors from all the yields end up in the same function? If you care about some or all of them and want to tell where the problem occurred, you'd need to wrap each `yield` in a try/catch?

dmethvin··on Windows 8.1 DPI Scaling Enhancements
Apple was able to do it the way they did because there are so few choices in Apple hardware. Sure the "double-or-nothing" approach simplifies things but it's not a practical approach for large ecosystems like Windows or Android where the resolutions vary a lot more.
dmethvin··on Why is the mobile web slow?
I'd agree that some of the causes are unsolvable if you want a design completely unconstrained by the performance limits of HTML rendering environments. This is why some people build HTML apps that look like some native app they had and say, "this is too slow!" However, there are some very bad anti-patterns that cause unnecessary reflows, and those can be avoided if you understand them.

For example, many infinite-scroll pages add a small amount of content to the DOM and then ask, "Did I fill the page enough?" by asking for the new height of the page. Each time they do that it requires a reflow where the browser recalculates the height of the page. When the added content is small it may take four or five trips through this loop to feed enough content into the page. A better alternative performance-wise would be to make each chunk of added content a fixed height. That way it's easy to do the math inside your own code, add four or five chunks, and the browser will do a single reflow at the end.

If you look at the "flat" designs that are becoming common in operating systems and apps, they perform well in these situations because they are very regular and easy to compute. Things like rounded corners, transparency, and drop shadows all make pages slower to render.

dmethvin··on Show HN: Minified.js – a fully-featured, 4K alternative to jQuery and MooTools
> There's only one way to make a tiny page that loads super fast - and that's to make every single decision with an eye towards efficiency.

That sounds dangerously like premature optimization. For example, why spend the time creating optimized image sprites if it turns out they don't contribute significantly to load time? It's better to spend development time doing something else.

> And that's why the internet is full of massive, bloated, slow web pages. Single decisions don't cause bloat. Bloat comes from a slack attitude towards efficiency.

By using the word "bloat" it sounds like you're talking about bytes. Again, byte counts often aren't always the main culprit in slow loading of web pages. Synchronous scripts and/or 302 redirects can be much worse, for example. Don't start with the premise that the bytes are the problem and do a lot of work to reduce them, only to find out it isn't the problem. Profile the page load and see what is really the problem. Then fix that.

dmethvin··on Show HN: Minified.js – a fully-featured, 4K alternative to jQuery and MooTools
> Is there anyone on HN who actually doesn't already know that?

I see a lot of discussion here based on the premise that this smaller script will make a big difference in overall page load time. It's why the audience in that video was leaning towards the site with the most JavaScript being the slowest. The first benefit listed on the minified.js page is "Minified is smaller!" so exactly what benefits does "smaller" imply?

> The only people who would possibly be interested in this project are people who are attempting to optimize the experience their app provides, presumably in a holistic fashion.

I agree, and creating your own homebrew framework for a large project in a holistic fashion has its own pitfalls. Especially if you've never done it before.

dmethvin··on Show HN: Minified.js – a fully-featured, 4K alternative to jQuery and MooTools
Delegated events let you handle events for child elements that aren't even in the DOM at the time you attach the handler. The jQuery docs explain it:

api.jquery.com/on/#direct-and-delegated-events

> Delegated events have the advantage that they can process events from descendant elements that are added to the document at a later time. By picking an element that is guaranteed to be present at the time the delegated event handler is attached, you can use delegated events to avoid the need to frequently attach and remove event handlers. This element could be the container element of a view in a Model-View-Controller design, for example, or document if the event handler wants to monitor all bubbling events in the document. The document element is available in the head of the document before loading any other HTML, so it is safe to attach events there without waiting for the document to be ready. ... In addition to their ability to handle events on descendant elements not yet created, another advantage of delegated events is their potential for much lower overhead when many elements must be monitored.

dmethvin··on Show HN: Minified.js – a fully-featured, 4K alternative to jQuery and MooTools
> Now that jQuery 2.x drops IE 8- support, a credible question is whether such libraries (which are more in the 95KB range, minified) are even necessary at all.

Well my answer to the credible question is that jQuery has to normalize and fix bugs for just about all the browsers it supports, it's not just an oldIE problem. Plus, jQuery provides abstractions above the basic DOM operations which are pretty low level. So if you don't want to use jQuery you'd probably want some other library to provide equal or greater abstraction.

> Quite outside of the time to download, there is a measurable cost to parse all of that boilerplate code as well. This has more of an impact on mobile, obviously.

Measurable of course. Significant as a portion of the page load time for most pages? Well that's a different thing. And of course if you want it, jQuery 1.8+ provides the ability to create custom builds if you know you don't need parts of it.

dmethvin··on Show HN: Minified.js – a fully-featured, 4K alternative to jQuery and MooTools
I know it's awfully tempting to obsess on something that is easy to measure, like file size. I also know it's tempting to imply things like "twice the file size means twice the page load time". But it's not true. It's NOT true.

Look at this video at 6m30s: http://channel9.msdn.com/Events/Build/2012/3-132

Productively optimizing a web page is no different than optimizing any other code. If you want to know why a web site is slow, profile it or run it through a tool like webpagetest.org. Don't just set off to rewrite all your loops to run backwards, or eliminate function calls, or reduce the amount of this or that without any understanding of the result.

dmethvin··on Show HN: Minified.js – a fully-featured, 4K alternative to jQuery and MooTools
That's not exactly the same at all.
dmethvin··on 1987: Kid submits 7 Robotron bugfixes using only the machine code from the ROMs
Agreed. A symbolic assembler was just a convenient way of managing names and jump targets. To reverse engineer it wasn't too hard to write down the bytes and translate to symbols because the instruction sets were relatively simple and regular (unlike current x86).
dmethvin··on Google flights
> no Southwest = no deal for me

Agreed, although I always thought the sticking point for SWA was paying commissions and not data access. For a sample search from BWI-SFO their price was only about $20 more expensive than the lowest fare ($520).

dmethvin··on Why I’m Going to India
As if elected officials have the best interests of the poor in mind? I suppose they do, but only to the extent that they need those votes. Whether the goal of the Gates Foundation is simply to redeem the image of Microsoft's founder or not, it's doing great things for the downtrodden of the world. Perhaps that's what people like Nobel and Carnegie had in mind as well, cleaning up their PR image. But that's the cynic's view.

If you listen to Bill Gates speak, he honestly sounds like someone who believes what he is saying and backs it up with money. As a rich man he certainly has other options. He can give a hearty "fuck you" or even a dismissive "I don't care" to the world and take his money to do whatever he wants. You know, like Larry Ellison or dozens of other people who've made their fortunes off the public.

dmethvin··on Probability of acceptance of pull requests
I can't speak for the other projects, but the data is completely wrong and misleading for jQuery. It looks like this code only counts a pull request as merged if it's landed with a merge commit. It's much more common for us to touch up the pull request (for example, fixing small style or commit message issues), then rebase, possibly squash some commits, and land via a fast-forward commit.

So this is "accepted": https://github.com/scalatra/scalatra/pull/267

But this is not: https://github.com/jquery/jquery/pull/1255

dmethvin··on Should String Be An Abstract Class?
> This is like an argument against integers because integers can express so many things: age, number of arms, days of the year, and so forth.

Yes, and just like the strings case it shows how useless most primitive types are from a program correctness and documentation standpoint. Languages like C++ and Java encourage programmers to treat them as mystical bags-of-holding and forget about their limitations or relation to the data being processed.

dmethvin··on Content Security Policy
Its great to see a large site like GitHub start work on deploying CSP. I don't know how many times I've had to argue with people about bad practices like inline event handlers. With CSP there's a way for a site to prevent them from being used.
dmethvin··on Content Security Policy
Thanks for your work! I'm a fan of CSP's goals.
dmethvin··on JQuery 2.0 Released
Not dumb at all. Keep using 1.x for everything until IE 6/7/8 drop off your radar.
dmethvin··on JQuery 2.0 Released
That last one. Given our past record on supporting things you shouldn't be too worried. But if you are, go to our GitHub project and click the Fork button.
← PreviousPage 6 of 16Next →