HNHacker News
TopNewBestAskShowJobs

wting

2,962 karma · joined June 20, 2012

io at williamting.com

https://github.com/wting

[ my public key: https://keybase.io/wting; my proof: https://keybase.io/wting/sigs/yTnPQ0DZR5vV9WRhYq8SP7V56pyKc3Z8fMQQE9cADBQ ]

submissionscomments
wting··on Introducing ASP.NET vNext
It may also be a product of age / experience. If you were involved in the 90's tech industry, it's very hard to forget MS's era of "embrace, extend, and exterminate".

I view Apple's closed ecosystems with a similar sense of apprehension.

wting··on Syntax highlighters are wrong
In other words, comments should explain why something was done and now how.
wting··on Poll: What database does your company/you use?
I worked on Domino--it's a mail server that uses DB2.
wting··on #golang: The next great teaching language
From what point of view?

Is it useful for learning about memory? No.

Is it useful for learning about OOP or generics? No.

Is it useful for learning algorithms (compared to Python / Java)? No.

Is it useful for learning about concurrency? Yes.

Is it useful for learning about parallelism? No.

Is it useful for learning about type systems or programming language design? No.

Is it useful for learning about developer tools? Yes.

Is it useful for finding a job? No.

In the end, Go is a pragmatic language growing in popularity. However it's a jack of all trades, master of none and thus fails as a teaching tool.

wting··on Disqus: It's Still About Realtime, But Go Demolishes Python
In the past Go has had trouble with garbage collection lag due to a global mark and sweep implementation[0]. Was this not an issue with Disqus's new implementation?

[0] https://groups.google.com/forum/m/#!msg/golang-nuts/S9goEGuo...

For the record Python uses a generational garbage collector.

wting··on Disqus: It's Still About Realtime, But Go Demolishes Python
This is nitpicky, but Python threads are kernel threads. It's the GIL that restricts CPython to a single core.

OTOH goroutines are green threads multiplexed onto kernel threads (aka N:M thread model).

wting··on Programming and thinking the functional way
A large reason why the naive, imperative quick sort performs well in practice is that it takes advantage of memory locality but the Haskell one doesn't.
wting··on Thinking in Types
Haskell is used in the NYTimes special features group that deploys 60+/yr web apps.

http://www.infoq.com/presentations/haskell-newsroom-nyt

tldw:

- RoR shop, too slow and can't afford to scale simply by spinning up more AWS instances.

- Haskell type system results in fewer bugs, less downtime than RoR.

- Haskell's Conduit library is great for information flow (e.g. scanning Twitter firehose for breaking stories).

- Static binaries for easy deployment.

- Declarative style and expressiveness helps coworkers understand code quickly.

wting··on How slow is Python really? Or how fast is your language?
Static typing is a boon when refactoring large codebases, even with >90% test coverage.

I'm migrating an in house ORM to SQLAlchemy. Lack of compiler support and/or static code analysis makes the transition more difficult than it needs to be.

Dynamic typing allows one to defer error handling to the future, essentially creating technical debt for the sake of developer speed and convenience. For many use cases this is an acceptable trade off.

However as a codebase grows in complexity, it's better to handle errors as early as possible since the cost of fixing an error grows exponentially the farther it is from the developer (costs in ascending order: editor < compiler < testing < code review < production).

wting··on How slow is Python really? Or how fast is your language?
Python is fast enough, until it isn't and then there are no simple alternatives.

If your problem is numerical in nature, you can call popular C modules (numpy, etc) or write your own.

If your functions and data are pickleable, you can use multiprocessing but run into Amdahl's Law.

Maybe you try Celery / Gearman introducing IO bottlenecks transferring data to workers.

Otherwise you might end up with PyPy (poor CPython extension module support) and still restricted by the GIL. Or you'll try Cython, a bastard of C and Python.

Python has been my primary language the past few years and it's great for exploratory coding, prototypes, or smaller projects. However it's starting to lose some of the charm. Julia is filling in as a great substitute for scientific coding in a single language stack, and Go / Rust / Haskell for the other stuff. I've switched back to the static language camp after working in a multi-MLOC Python codebase.

wting··on A LaTeX Resume Template that fits everything AND looks good
My own resume is a forked from this:

https://github.com/afriggeri/cv

PDF:

https://github.com/afriggeri/cv/blob/master/cv.pdf?raw=true

wting··on GNU Screen v.4.2.1
I've tried switching to tmux a few times but it never stuck because my workflow involves multiple terminals attached to different windows of the same session.

However this isn't allowed in tmux without some hackery / wrapper scripts.

wting··on Symptoms of Dysfunction in Software Teams
You find another job ASAP. Organizational and culture problems will not be fixed by one new employee.

What happens is the competent people bail, leaving behind the less talented and/or less motivated which creates a positive feedback cycle.

wting··on Space Monkey dumps Python for Go
I think people are rediscovering the benefits of static typing for performance and correctness reasons. The latest generation of statically typed languages[0] all have some level of type inferencing which helps.

If Python is fast enough for you, it’s a fantastic language. The problem is once performance or codebase demands scale, dynamic typing rears its ugly head and there are no simple solutions. At work we sidestep this issue by writing a plethora of tests, but now dynamic typing productivity gains are offset and we spin up a lot of AWS instances for performance.

[0] Go, Rust, Scala. Haskell and OCaml have had it for a while.

wting··on Ask HN: Idea Sunday
Disclaimer: I work at Yelp.

Yelp started out as finding a referral for doctors, and recently Yelp has added public data to their respective hospital pages:

http://officialblog.yelp.com/2013/03/study-yelp-ratings-work...

wting··on Ask HN: Idea Sunday
There's a lot of parallel conversations on Reddit / HN / etc. for various articles.

Would about pulling high rated, top-level conversations from multiple sources for a quick digest? Sort of like Google News for commentary.

wting··on Cabal 1.20 Released
This is a pretty big release that solves a lot of problems associated with cabal hell:

  - new sandbox implementation!
  - temporarily ignore upper bound requirements
  - dependency freezing
  - parallel builds
  - no re-linking unless a file has changed
wting··on Those Who Say Code Does Not Matter
Now you have the bug occur if someone forgets an equal since this is always true:

    if (llama = false)
So use Yoda conditionals instead:

    if (false == llama)
Is that really an improvement over the original? As I've stated in my sibling reply, you are decreasing human readability for machine readability.
wting··on Those Who Say Code Does Not Matter
> I think the most readable code has no shortcuts and no tricks. I'll take unambiguous over concise or 'beautiful' any day.

Ambiguity and conciseness are orthogonal concepts. Mathematics and formal proofs are very unambiguous, yet they are concise. On the other hand assembly code is unambiguous yet very verbose. Code has to convey two things:

1. "what should be done" to humans

2. "how to do it" to machines

Striking a balance between these two is difficult since it depends on each individual coder and the programming language. That's why there are so many syntax bike shedding wars because what's readable to one isn't necessarily readable to another.

wting··on Amazon Will Pay You $5,000 to Quit Your Job
Amazon pays $95k for new grads. SDE3 is around $120k.
wting··on Why Go is elegant and makes my code elegant
Many languages besides Haskell have option types (Rust, Scala, OCaml, Java 8):

http://www.oracle.com/technetwork/articles/java/java8-option...

Using option types produces more robust code and prevents null pointer exceptions / segfaults. Go's idiom of multiple return values and error is a poor man's Either, which is an improvement on C's return code idiom[0].

[0] C's return code idiom led to the latest GnuTLS bug:

http://blog.existentialize.com/the-story-of-the-gnutls-bug.h...

wting··on Why Go is elegant and makes my code elegant
To expand, Go's type system is relatively rudimentary. The lack of option types[0] leads to this fairly common, verbose Go pattern:

    func DoFoo(Foo foo) Cat {
        bar, err := GetBar(foo)
        if (err != nil) { return nil }

        baz, err := GetBaz(bar)
        if (err != nil) { return nil }

        cat, err := GetCat(baz)
        if (err != nil) { return nil }

        return cat
    }
Option types add metadata to a type, essentially combining `bar` and `err` into a single variable. Let `Maybe x` mean a function will return `Something x` or `Nothing`. For example (in hypothetical Go):

    func DoFoo(Foo foo) Maybe Cat {
        bar := GetBar(foo)
        if (bar.(type) == Nothing) { return Nothing }

        baz := GetBaz(bar)
        if (baz.(type) == Nothing) { return Nothing }

        cat := GetCat(baz)
        if (cat.(type) == Nothing) { return Nothing }

        return cat
    }
Since this is such a common pattern, Haskell has a bind operator (`>>=`) to take advantage of option types by passing the output as the input of the next function if it's a `Something`, or return `Nothing`.

    func DoFoo(Foo foo) Maybe Cat {
        return GetBar foo >>= GetBaz >>= GetCat
    }
If you care about why something failed, use an `Either` instead of a `Maybe`. In a language that supports algebraic data types, you could create your own sum type instead.

[0] https://en.wikipedia.org/wiki/Option_type

wting··on Unpythonic Python
Use `list()` to force eager evaluation with Python 3 map / filter.
wting··on Speed memory access by arranging data to take advantage of CPU caching
I had a similar project in a programming for performance class at UT Austin. We had access to TACC supercomputers and were tasked with finding the CPU's L1 cache size via trial and error. We were testing it by using matrix multiplication and measuring performance output, and changing the chunk sizes accordingly.
wting··on Japanese Toilets: The Future Called 30 Years Ago
Another thing that gets overlooked is the built-in faucet at the top to rinse off hands such that every tank of water gets used twice:

http://demenglog.com/wp-content/uploads/2014/01/toilet-seat-...

wting··on Japanese Toilets: The Future Called 30 Years Ago
> Does the tank on the B100 always have enough hot water for you?

Yup, it was enough for my pregnant wife when she was staying at home.

wting··on Japanese Toilets: The Future Called 30 Years Ago
There are also cheaper compromises that only replace the toilet lid instead of the entire toilet and without requiring a hot water line. I bought this version last year for $250 but it's $350 now:

http://www.amazon.com/gp/product/B005XNW1Q0/ref=as_li_ss_tl?...

wting··on Pkgr.io: Easy way to get a Debian package out of any app
I use Dokku (self hosted Heroku) for this purpose:

https://github.com/progrium/dokku

wting··on Why San Francisco Is Not New York
I think the situation is reversed when considering Asian food. SF easily ranks behind other west coast cities I know extensively (Honolulu, LA, Seattle) when it comes to Chinese and Japanese food.

The Asian food situation is much better in south bay, but that's an hour from the city and thus limited to weekend excursions.

wting··on iGo: a new Syntax for GoLang
It's hilarious to see someone add semantic whitespace to Go, which seems to be the opposite of Python With Braces[0].

I'm in the whitespace > braces camp, but mandatory braces help with the dangling else problem and makes it easier for the parser.

[0] http://www.pythonb.org/

← PreviousPage 4 of 10Next →