HNHacker News
TopNewBestAskShowJobs

snprbob86

7,460 karma · joined March 13, 2008

New account: https://news.ycombinator.com/user?id=brandonbloom
submissionscomments
snprbob86··on Everything you need to understand to start with AngularJS
See: https://github.com/angular/angular.js/blob/9480136d9f062ec4b...

Looks like they are never interpreted, but there are (at least) two different compilation strategies: 1) Anonymous function with a loop 2) Fully compiled Function constructed via JavaScript source with the loop unrolled In general, this bit of code seems to be optimized to a crazy degree.

It's also worth noting that the "filters" part of the expression is maintained as a pipeline in an array, since filters may inform bidiectional binding behavior.

snprbob86··on Why Maybe Is Better Than Null
At least in Clojure, it's considered bad form to extend your own protocols (aka instance type classes) to types you don't own. Isn't that also true of Haskell?

Haskell's type classes, unlike ML functors (I think), are "coherent", which means that you can't have scoped or multiple instances for the same type, lest you risk breaking the type system. With that in mind, extending Maybe to Num would mean a reduction the number of type errors caught in other code that uses Maybe and Num near each other.

snprbob86··on Tests Are Overhyped
I've worked on quite a few different large code bases. I agree with the author 100%. Tests are a tool. They are a particularly useful one, but they are just a tool. Unit tests are significantly less useful than TDD folks would have you believe when compared to things like integration tests. And integration tests are vastly more costly than what TDD folks would have you believe. Personally, I much prefer gold file tests with manual inspection when it comes to test automation. I've seen large compiler projects that get by pretty far with just that. Never mind things that make no sense to test: Like "Is this game fun?"
snprbob86··on Gitmo Is Killing Me
Not necessarily more, but it would require a different distribution. Money would need to be spent to relocate the prisoners. Congress has blocked that reappropriation.

Quoting Wikipedia:

On May 20, 2009, the United States Senate passed an amendment to the Supplemental Appropriations Act of 2009 (H.R. 2346) by a 90-6 vote to block funds needed for the transfer or release of prisoners held at the Guantanamo Bay detention camp.[14] President Obama issued a Presidential memorandum dated December 15, 2009, ordering Thomson Correctional Center, Thomson, Illinois to be prepared to accept transferred Guantanamo prisoners.

On January 7, 2011, President Obama signed the 2011 Defense Authorization Bill, which, in part, placed restrictions on the transfer of Guantanamo prisoners to the mainland or to foreign countries, thus impeding the closure of the facility.[17] U.S. Secretary of Defense Gates said during testimony before the US Senate Armed Services Committee on February 17, 2011: "The prospects for closing Guantanamo as best I can tell are very, very low given very broad opposition to doing that here in the Congress."[18] Congress particularly opposed moving prisoners to facilities in the United States for detention or trial.

/quote

In short, congress passes bills to prevent Obama from closing Gitmo. Obama signed one or more of those in order to balance other political agendas. The annual Defense Authorization Act is a particularly politicized bill that congress is known to use as an offensive weapon.

snprbob86··on Ask HN: What's the best technical talk you've heard?
This is something I've been experimenting with. My intuition is that the scene graph will look a lot more like an AST made from algebraic data structures than an OOP actors network. Down that road, the system looks like an optimizing compiler with the really tricky added bit of iterating in response to user input.
snprbob86··on Rework git core for native submodules
> just keep on hacking on his fork. I know I would use it.

Correct me if I'm wrong, but isn't the problem that Linus brought up this: If you introduce a new object type, you need to get it right. A new object type would create non-backwards-compatible repositories, so you'd have a new minimum Git version. If you were to use this fork, then everyone who checks out your code would have to use it. Also, it would preclude tooling support (eg GitHub). Once such important repository versioning decisions are made, they can't be unmade. Git, at it's core, is basically just a well designed repository model.

snprbob86··on Why Concatenative Programming Matters (2012)
Warning: Shameless self promotion

I implemented a concatenative DSL for Clojure called Factjor [1] inspired by Factor [2]. Clojure is to Lisp what Factor is to Forth. I used Factjor to implement DomScript [3], which is sorta like jQuery re-imagined as a concatenative language like PostScript. I also gave a talk on both Factjor and DomScript at Clojure/West. Slides are available now [4] and a video will be available on InfoQ soon.

[1] https://github.com/brandonbloom/factjor

[2] http://factorcode.org/

[3] https://github.com/brandonbloom/domscript

[4] https://github.com/strangeloop/clojurewest2013/raw/master/sl...

snprbob86··on IRS considers taxing perks at Google, other tech firms
I'd be curious to see how much revenue this would generate for the government. I can't help but wonder if this is only a target because of its visibility. Even if this brought in an extra $1,000 per each of 10M IT workers in the US, that's only $10B. However, it's likely to not even be close to that. Meanwhile, the 0.0034% transaction tax only brings in less than $2B in revenue from financial trades. The proposal to increase that tax to 0.5% would bring in as much as $200B. I might be bias, but it seems like Wall Street should pay more taxes before silicon valley.

http://en.wikipedia.org/wiki/Financial_transaction_tax#Unite...

snprbob86··on Everything I know about design I learned playing Starcraft
I'm a gamer. I genuinely believe that there's a lot to be learned from games via playing, studying, or building them. I know what it's like to have non-gamers look down at your time gaming and view it as worse than unproductive. However, even when I worked in the game industry, if you tried to tell me that Starcraft mastery adequately demonstrates your performance under pressure in a professional context, I'd laugh in your face.
snprbob86··on Explicit vs. Clever
Clojure maps generally have keywords as keys and keywords are callable as getters:

    (map :title orders)
Is analogous to:

    (map #(get % :title) orders)
Which is shorthand for:

    (map (fn [order] (get order :title)) orders)
snprbob86··on Google Maps One-Hand Zoom on iPhone
Same here.

If it's a nice day in NYC, I'll often opt for a very long walk between meetings. If I stop for a coffee, as I tend to do, I usually try to memorize the directions to where I'm going. Failing that, I have to either put my coffee down for a moment or attempt the dreaded thumb and index finger zoom maneuver.

Now that I've written that, I'm hesitant to post it. This is probably the most "first world problem"-ish thing I have ever said. I don't even really rely that heavily on Google maps since I know the major streets in the city pretty well. However, this mini-dilema has really struck me several times. I guess that means life is good!

Anyway: Thanks to the guy who discovered this. And extra thanks to the dev who implemented this. I don't know if it's an accessibility feature (limited use of second hand) or a debugging feature (second hand on the keyboard). Either way: awesome!

snprbob86··on Rust 0.6 RC is out
Disclaimer: I know practically nothing about Rust outside of observing from the HN side lines.

Looking at the change log, it seems that they also removed the "static" keyword, so that class vs member methods are distinguished by the presence of a first argument named self. A little further down, they mention ~self, &self, and @self. Those prefixes differentiate types of special purpose pointers.

So it seems the goal was not explicit self, so much as it was explicit pointer type annotations for self.

snprbob86··on Problems with the TSA
My girlfriend is a flight attendant. She, and many of her co-workers, are very upset about the new pocketknife policies. Mainly, the issue is this: She's still not allowed to carry one. Company policy: She could lose her job upon uniform inspection. Total craziness if you ask me. Honestly, I wouldn't care if they sold knives for $2 like headphones. I just wish that they would provide her with some training in martial arts with a focus on weapon disarming.
snprbob86··on Don’t Get Bored at Demo Day
Our pitch deck had a timeline slide where there was a horizontal line annotated with months. I jokingly suggested to our CEO/Designer that it should go up and to the right. He chuckled and asked "What should be on the Y axis?" We decided on "Awesomeness" with a scale from High to Higher. Got some good good laughs out of investors.
snprbob86··on 80 chars per line is great
Three files side by side is extremely common for those of us who have to regularly resolve merge conflicts. You put the common ancestor in the middle and the diverging changes on either side, then you edit both sets of changes in to that middle buffer.
snprbob86··on 80 chars per line is great
Luckily, most code is indented 1 to 4 levels at 2 or 4 spaces per indent. This means that typical code width is limited to be anywhere from 78 to 64 characters wide. That's 77 to 63 if you're actually going with 79 characters, which is what PEP8 et al suggest. Much closer to the 55 to 65 characters of the two or three books I just checked.
snprbob86··on Anders Hejlsberg and Lars Bak: TypeScript, JavaScript, and Dart
This has been covered over, and over, and over again. CoffeeScript has some explicit goals with respect to the generated JavaScript output, and that includes not mucking with your identifiers. In order to implement correct lexical scoping, you'd need to rewrite identifiers to avoid shadowing and collision. CoffeeScript's design is a very reasonable trade off given the inadequacies of JavaScript.
snprbob86··on Finger Trees: A Simple General-purpose Data Structure
Tries are basically just sorted prefix trees, and you're right, they form the basis of sorted maps and sets in Clojure. However, Clojure also has https://github.com/clojure/data.finger-tree for cases where tries don't make sense: namely, double-ended queues (amortized constant time push and pop from both ends) and sorted sets with log-n index access.
snprbob86··on Uber driver charged with raping woman in D.C.
First: I'm always skeptical. I fear how easily it would be to be marked with a scarlet letter. I rather 10 guilty men go free, for any crime of any magnitude, than have 1 innocent man be punished.

Second:

Murder yields a body.

Theft creates a void.

Vandalism leaves a mark.

The body left by rape cannot distinguish between regret and terror. The void cannot be measured by the outside. The mark may be an act of theater.

However, the public demands justice and often we lose sight of our principles. The court of public opinion cares not about a shadow of a doubt.

snprbob86··on Not Lisp again (2009)
Of course you can, but almost no one does. If people started to do it a lot, it would be just as interesting as it is with Clojure.
snprbob86··on Uber driver charged with raping woman in D.C.
I don't really appreciate the fact that the suspect is named publicly, but the victim is not. It should be either neither, or both, preferably the former. Every time I see an article about rape, there are hints of bias to full on convictions in the court of public opinion. Innocent until proven guilty!

Uber probably has GPS data for the Driver's phone. Did he linger at the destination long enough for a rape to occur? Or did he immediately begin traveling towards his next fare?

There's a character witness for the driver, but what about for the woman? After all, she was just kicked out of a bar...

What is the status of her injury?

There's just not enough information here for this to justify as news quite yet.

snprbob86··on Not Lisp again (2009)
Never mind the fact that tail cails are just fundamentally loops, which don't generate any stack frames anyway!

If you're application is complex enough that inspection won't reveal the source of the bug, then stack traces are almost strictly less useful than logging.

snprbob86··on Not Lisp again (2009)
Through the lens of this example, Lisp does not offer any advantage. In fact, I'd argue, that Python, Ruby, JavaScript, C#, and even Haskell are simply explorations of this example, and others like it, with intentional ignorance of some of the other advantages Lisp offers.

The one thing that all those languages drop from Lisp is Homoiconicy [1]. There are entire other categories of "Eureka Moments" that you can experience with Lisp through the lens of homoiconicy. This is at the heart of the utility of Macros, but macros can exist without homoiconicy and there are other benefits besides easier macros.

What makes Clojure, in particular, interesting is that it's Homoiconic in terms of more than just sequences: There's also maps, sets, etc. Common Lisp & Scheme encode maps, sets, etc in terms of lists.

If you're having a hard time seeing past the syntax (or a lack thereof), I suggest exploring Mathematica. Download the demo [2]. The Homoiconic parts of Mathematica are hidden behind more traditional syntax. Use the FullForm[...] function to see the Lispiness leak through. I suggest exploring the Rules & Patterns documentation [3] to get a feel for a non-macro approach to homoiconic transformations. Rules & Patterns makeup a rewrite system, which are strictly more complex than macro systems, but often easier to grasp during initial exposure.

[1] http://c2.com/cgi/wiki?HomoiconicLanguages

[2] http://www.wolfram.com/mathematica/trial/

[3] http://reference.wolfram.com/mathematica/guide/RulesAndPatte...

snprbob86··on The Pull Request Hack
Yes, but also remember that you'll get loud warnings about non-fast-forwards thanks to the cryptographically secure SHA1 hashes. This means that the repo admins and downstream clones can trivially detect history rewrites for branches they have fetched. Unfortunately, there isn't a good way for code-consumers to tell if and when a non-rewrite commit or branch has been "blessed" by an admin rather than some random committer. I guess this means that the README should make some mention of the collaboration policy and the admins should preserve release power to whatever the relevant package manager is.
snprbob86··on On F# code readability
If they are co-dependent, then that, by definition, means that they are not independent. What value do you get by having co-dependent modules that you can't get by having a single module? If you want two public APIs with one common implementation that is co-dependent, you can have three modules where two depend on the co-dependent part. Without seeing a motivating use-case, I'm just going to assume that F# is succeeding in preventing you from making a bad design decision.
snprbob86··on Monads explained by Eric Lippert
Likewise, Scala's "for" loop compiles to calls to map and flatMap, which are the same as Select and SelectMany, which represent the list monad. You can use map, flatMap, and for notation in lieu of a more generally named do syntax.
snprbob86··on How Facebook Gets Away With Being Broken On Purpose
> That is not what users expect. It is called a timeline for a reason.

Is that reason because things are roughly sorted by time?

It's a timeline of interesting events in the recent history of your friends and interests. Being a "timeline" doesn't mean that it has to include everything. Should a timeline of the history of the USA include every event in the history of China? Not if you actually want to succeed in communicating any subset of the information on the timeline effectively...

People expect to sign in and see stuff about their friends. They don't expect to have to hand manage every single connection they ever make to decide who is or isn't worth paying attention to.

> Twitter works that way and nobody thinks it's broken.

1) Twitter has extremely different use cases.

2) I think Twitter is horribly broken. I rely on non-broken external clients to sort and filter tweets; most high volume users do.

> If someone spams your timeline it's really easy to unfollow and solve the problem.

Again, Twitter is a totally different use case. I might not want to unfriend my Aunt, who loves me very much, but I sure as hell don't want to see her every little post. I don't interact with her messages, so Facebook stops showing them to me. That problem seems solved to me...

snprbob86··on How Facebook Gets Away With Being Broken On Purpose
"Sort By: Most Recent" ?
snprbob86··on How Facebook Gets Away With Being Broken On Purpose
Personally, I think Facebook would be broken if every message every person or group I'm connected to made it directly into my feed. The feed has been algorithmic for a very long time and paid placement is neither a surprising nor nefarious input to that algorithm. Paid posts are clearly labeled and, even if paid, don't guarantee distribution volume, but do provide analytics. If you don't like the results you're getting, then don't pay for them.

If you think that you can complain "But they are my fans! They belong to me! I deserve the right to be in their feeds" then be happy that Facebook is smarter than you: All those lovely fans would be gone in a heartbeat if Facebook didn't protect the advertisers from themselves. If you and all your advertising friends had it your way, you'd spam users until there were no users left to spam.

snprbob86··on On F# code readability
Many languages require declare-before-use and co-declared recursive structures. Sometimes, they provide an escape-hatch like a forward-declaration. It also makes the compiler substantially faster and makes it far harder to accidentally introduce a layering violation in your design.

If you're a Java or C# programmer, or even a C++ programmer, you're used to cyclic relationships all over the place. Your Person class has a .Adresses property and your Address class has a .Residents property so that you can conveniently person.Addresses.Filter(address => address.Residents.Count > 1) and suddenly your Address class is tightly coupled to your Person class. Do this a few dozen times and before you know it, your software is a maintenance and refactoring nightmare.

Object-oriented programming encourages this design. Functional programming discourages it. Modern OOP compilers conveniently resolve circular dependencies (Java does, C++ doesn't without header games). Modern FP compilers force you to declare and contain your circular dependencies.

Lastly, declare-before-use makes a lot of dynamic and live programming scenarios viable. Lisps, for example, generally have a compilation unit of a top-level form. This way the REPL and a normal source file behave more similarly, if not precisely the same.

← PreviousPage 3 of 34Next →