HNHacker News
TopNewBestAskShowJobs

pdubroy

1,074 karma · joined March 31, 2008

http://dubroy.com/blog - on programming, usability, and design
submissionscomments
pdubroy··on Generators Are Like Arrays
Well, "syntactic sugar" usually refers to things that can be translated in a syntactically local, structure-preserving way. I'm aware that generators can be compiled down to an ES5 representation, but it requires non-trivial analysis. Take a look at the example on their home page: https://facebook.github.io/regenerator/.

Do you also consider functions to be syntactic sugar? Because you can also implement them in terms of a switch statement.

pdubroy··on Generators Are Like Arrays
You also can't implement generators using an array. There's a reason why generators were added to ES6 -- they aren't just syntactic sugar.
pdubroy··on Generators Are Like Arrays
I believe it's pretty common in the programming language literature to refer to `yield` a delimited control operator. E.g., see http://parametricity.net/dropbox/yield.subc.pdf, which says "yield...turns out to be a delimited control operator of comparable expressive power to shift/reset". A good hint that you're dealing with a control statement/operator is if it's responsible for transferring execution to another place in the code: e.g., `if`, `for`, `while`, `throw`, etc.

Saying that "yield is not about control flow, it's about lazy sequences" seems like saying "functions are not about control flow, they are about producing values".

pdubroy··on Alan Kay on the Meaning of “Object-Oriented Programming” (2003)
Sounds more like you're describing Smalltalk 72 (http://worrydream.com/EarlyHistoryOfSmalltalk/#p12) than Smalltalk 80. I've written a fair bit of Smalltalk code, and I can't remember seeing something like what you're describing here. It would certainly be possible, but I don't think it's an accurate description of how most Smalltalk code works.
pdubroy··on Introducing Spider 0.1
Why isn't a list an expression?
pdubroy··on Literate CoffeeScript
You still need to declare variables before using them in an expression, though. I wish more languages would adopt the "where" syntax that Haskell and Miranda have. It lets you do things like:

  y = m*x + b
      where
      m = calculateSlope()
      b = getYIntercept()
I think this fits the literate programming style well.
pdubroy··on Modern Web Development
Not quite true -- Chrome Canary is just a daily build from the Chromium repository.
pdubroy··on Agile: 5 years later and you're still doing it wrong
Actually, the burden of proof should be on you. The null hypothesis is that adhering to agile principles has no positive affect on the outcome of software projects. In order to show that these principles have worth, you should disprove the null hypothesis.
pdubroy··on Oracle on why you shouldn't use NOSQL (PDF)
In other news, the barber thinks you need a haircut.
pdubroy··on Beginners Guide : pip and virtualenv
On my personal machines (effectively single-user), I find there's no need to install packages globally. I have a default virtual environment that I activate in my .profile, and anything that's not project-specific gets installed there.

Not saying everyone should do this, but it works well for me.

pdubroy··on Beginners Guide : pip and virtualenv
One of the nice things about virtualenv is that it installs a copy of pip into every virtual environment you create. If you always have one of the environments active, there's no need to even install pip globally.
pdubroy··on Google Chrome – Why I Hate It And Continue To Use It
The behaviour of the status bubble that he shows in the video is a known bug in the Mac version (http://crbug.com/76590) which should hopefully be fixed soon.
pdubroy··on Wield Python's super() like a Jedi
Yes.
pdubroy··on Why is America the 'no-vacation nation'?
Great, then it worked out for you. I'm not saying there are no advantages to owning a house, but it's not a magical investment vehicle. Many people seem to just compare the purchase price to the sale price and think, "Wow, what a gain!" without considering all the other costs, or as what they could have made with another investment over the same period.
pdubroy··on Why is America the 'no-vacation nation'?
I'm not sure that really proves your point. You've made about 2.8% annually over 13 years, not including your borrowing cost, agent fees, etc.

On the other hand, the S&P 500 returned 8.25% annually between 1993-2006. Say you put 10% down ($8500) and spend $800/year total on taxes, repairs, etc. (probably low). If you'd invested in an index fund, you'd have made $42,000.

pdubroy··on Netflix Is Killing BitTorrent in The US
The article doesn't actually offer any evidence, apart from the fact that Netflix has doubled its subscribers.
pdubroy··on Fact and folklore in software engineering
From the article: "Critical examination of ill-supported assertions takes a lot more time than making the assertions in the first place"

Anyways, it's really an unfalsifiable claim, isn't it? For any study that doesn't show a 10x difference, you could claim that it didn't have any truly "good" programmers.

The burden of proof should be on those who make the claim.

pdubroy··on Azul's Pauseless Garbage Collector
> Self healing is a unique capability that, as far as we know, the Azul collector is the only one to do, and it can only be done with a read barrier.

The Metronome GC from IBM Research (http://www.research.ibm.com/people/d/dfb/papers/Bacon05High....) also uses a read-barrier to fix up pointers to objects which have moved.

Although, I don't think it does marking in the read barrier.

pdubroy··on Azul's Pauseless Garbage Collector
You're probably right. Although he doesn't mention the write barrier, this is usually required for a generation GC.
pdubroy··on Azul's Pauseless Garbage Collector
I think the trick is that after you complete the next mark phase, you have visited every possible pointer to the unmapped page.
pdubroy··on New iPhone Agreement Bans Flash-to-iPhone Compiler & Others
It's only true that you can't overshoot them if your trajectory is perfectly vertical. With a diagonal trajectory (which is usually the case), you can still overshoot the item you were aiming for.

Also, Fitts' Law says that the time to select a target is proportional to the distance and the size of the target. Putting the menu on the edge of the screen makes the effective size of the targets bigger, but in some cases it also means that they are much further away.

As I type this, the menu bar is about 4x further away than the top of my browser window.

pdubroy··on An In-Depth Look at the User Experience of iPhone Safari
With the announcement of the iPad, and the claim that it's "the best browsing experience you've ever had", I thought it would be interesting to take a closer look at what makes the web browsing experience on the iPhone so great. Especially since the iPad version of Safari seems to resemble the iPhone version much more than the desktop one.
pdubroy··on Firefox 3.6 Released
Do you have a lot of plugins installed? I tested on a 6-month-old MacBook Pro 13", on both OS X and Win7, and Firefox starts up pretty much instantly (less than 500msecs). Agreed, Chrome and Safari seem marginally faster, but I don't close my browser very often, so it really doesn't matter.
pdubroy··on Firefox 3.6 Released
Startup time is MUCH improved in Firefox 3.6. Chrome still feels slightly quicker, but we're talking on the order of 100s of milliseconds. For something that I do once a day, at most, the difference is negligible.
pdubroy··on Apple Sends Cease and Desist Letter to Gawker
All you need to know about this can be found here:

http://isthetabletout.com

pdubroy··on I like Unicorn (Rack HTTP server) because it's Unix
I'm not familiar with the MRI source, but in most collectors, I'd think that switching from marking the object directly to using a separate mark map should be pretty trivial (like an afternoon's work). You'd still have to copy the pages for the mark map as soon as you GC in the child process, but that's only 3% of your total heap size.
pdubroy··on Reinventing the wheel: the fluent interface design pattern
You're right, it definitely comes from Smalltalk. For those who aren't familar with Smalltalk, you can use the ';' operator to send a sequence of messages to the same object. The example in the article would look something like this:

  mainFrame := JFrame new: 'Hello World';  
      add: label withAlignment: BorderLayout.CENTER;  
      addWindowListener: MainFrameListener new;  
      setDefaultCloseOperation: JFrame.DO_NOTHING_ON_CLOSE;  
      pack;  
      setLocationRelativeTo: nil;  
      setVisible: True;
      yourself.
(The result of a chained method expression is the result of the last method call, thus the 'yourself' message at the end so that the object itself is stored into mainFrame.)

Sigh...I miss Smalltalk.

pdubroy··on I'm Sick of This
Why not just define a function in your code, rather than redefining 'nil?'?
pdubroy··on BumpTop gives Windows desktop a much-needed makeover
If you don't see the filenames, then you're looking at an old demo version of BumpTop. You're right that it's pretty important to have ;-)

BumpTop is definitely not for everyone, but that's fine. Not all software has to be designed for your 50 corporate users, because they certainly have different needs than the rest of us. A designer, for example, might really appreciate the visual and spatial aspects of the system, because it's more meaningful than a bunch of PSDs named icon-concept1, icon-concept2, etc.

Also, although the 3D and physics is the most noticeable thing about BumpTop, it's actually got quite a few very useful features that are completely orthogonal to the 3D/physical aspect. For example: type to find on filenames, thumbnails of several different document formats, seamless photo browsing, and icons that grow or shrink based on your usage of a document.

pdubroy··on Are short methods actually worse?
No, I'm saying that putting common code in a separate method is not necessarily -- as in, "as a logical result or consequence" -- less error-prone.

I'm not advocating cutting and pasting huge blocks of code everywhere, but a 1-line calculation duplicated in 4 spots is probably okay.

← PreviousPage 3 of 5Next →