HNHacker News
TopNewBestAskShowJobs

jiaweihli

433 karma · joined November 15, 2012

submissionscomments
jiaweihli··on Senior Engineers Reduce Risk
Another way to look at this is that interviews are like tests where you already know what the topics are. So a company with a 'standard interview process' is testing your ability to study for and do well on a test. That's a crude measure of how well you can pick up new things and apply them, within certain bounds.

A large majority of these interviews are also testing for non-technical skills too - like communication, patience, humility, and thought process.

Don't stress out too much about interviews, they're something like 30% technical, 30% non-technical, and 40% luck.

jiaweihli··on AWS Lambda Is Not Ready for Prime Time
If you're in the JVM ecosystem, you may want to check out http://akka.io, which is self hosted lambda with more features and better documentation.
jiaweihli··on A Farewell to FRP
Scala is more forgiving than Haskell and the parent poster asked for something with Erlang-style actors, which are always going to be complex.

I really think this is the best option out there.

jiaweihli··on A Farewell to FRP
Akka[1] is exactly the library you're looking for. It's available for Scala[2], which lets you use both OOP and FP as needed. (It also runs in Java if you have experience with that.)

[1] http://akka.io/ [2] http://www.scala-lang.org/

jiaweihli··on The Startup Zeitgeist
Hence, 'fallen giant'.
jiaweihli··on Tech workers are increasingly looking to leave Silicon Valley
I don't think this is a millenial problem, this is true of the young adult population in every generation. One trend I've noticed is that those who grow up in suburbs tend to prefer cities in their 20s, and those who grew up in cities tend to prefer urbanized suburbs.
jiaweihli··on Tech workers are increasingly looking to leave Silicon Valley
Agree, an apartment I used to rent in LA has appreciated by 50% in 4 years. The housing crisis isn't as full-blown as in SF, but it's quickly getting there.
jiaweihli··on Show HN: Convert scanned documents into searchable PDFs
Have you looked into ocropy[0]?

Here's a nice intro[1] that later talks about how it achieves higher accuracy using an LSTM model[2].

[0] https://github.com/tmbdev/ocropy

[1] http://www.danvk.org/2015/01/09/extracting-text-from-an-imag...

[2] http://www.danvk.org/2015/01/11/training-an-ocropus-ocr-mode...

jiaweihli··on Python 3.5 type hinting in PyCharm 5
For dynamically typed languages, using a popular type annotation syntax (e.g. rdoc for ruby, closure compiler for javascript) and an IDE (like Intellij) can give you 80% of the benefits of type safety by doing code inspection on-the-fly and warning you when it finds incorrect types. The main downside is no compiler safety net when you try to refactor code.
jiaweihli··on Scala.js has a new website
While I love scala, I have 2 concerns that have stopped me from using scala.js: 1) can I use typescript definitions to avoid writing everything myself? 2) how much bloat does this add to my app? (from overhead of standard libs and core)
jiaweihli··on Vue.js 1.0.0
Rivets[1] is an even lighter light-weight champion.

[1] http://rivetsjs.com/

jiaweihli··on Goodbye CoffeeScript, Hello TypeScript
TypeScript supports disjoint unions: http://blogs.msdn.com/b/typescript/archive/2015/09/16/announ...

The two real pain points (among those you mentioned) of TypeScript are bivariant function parameters and structural classes, since they lead to potentially unsound code that compiles.

jiaweihli··on Goodbye CoffeeScript, Hello TypeScript
Personally I'm not a huge fan of mixing language with UI architecture - it seems like it would slow down development on both fronts. Replacement costs are also much higher.

That aside, we'll talk about how we built our architecture in our next blog post! I promise you that I thoroughly pored over the Elm architecture tutorial[1] before designing any building blocks.

[1] https://github.com/evancz/elm-architecture-tutorial/

jiaweihli··on Goodbye CoffeeScript, Hello TypeScript
There is also this gem of a quote by him[1]:

> I can honestly say if someone had shown me the Programming in Scala book by by Martin Odersky, Lex Spoon & Bill Venners back in 2003 I'd probably have never created Groovy.

[1] http://macstrac.blogspot.com/2009/04/scala-as-long-term-repl...

jiaweihli··on Goodbye CoffeeScript, Hello TypeScript
This is slightly different from the original code. The reason for all the flatmapping is to avoid continuation if any of the subparsers fail, and notify the caller that something has failed because of {some exception}.

You can avoid excessive nesting/flatmapping with some syntax sugar, but it needs to be sufficiently different from normal declarative code.

jiaweihli··on Goodbye CoffeeScript, Hello TypeScript
let, const, decorators, string interpolation, other ES6/7 goodies. Also a few other compelling things like abstract classes and community type definitions.
jiaweihli··on Goodbye CoffeeScript, Hello TypeScript
Ah! I think I saw this awhile back. I didn't refer to it too much when working on Monapt since it seems to serve a more abstract purpose, and since Monapt's original purpose was to emulate Scala syntax.
jiaweihli··on Goodbye CoffeeScript, Hello TypeScript
You're absolutely right! I was hoping someone would point this out, since this is a much cleaner way of writing this code. This is pretty close to how it's done in Scala.

For the purposes of this article, we tried to avoid too much syntax sugar to make it more accessible. That aside, I'd love to add something like this to monapt![1].

[1] https://github.com/jiaweihli/monapt

jiaweihli··on Goodbye CoffeeScript, Hello TypeScript
We considered Flow initially as well - but aside from its built-in maybe types (we use Monapt for this!), it's a subset of TypeScript feature-wise that doesn't iterate as quickly.
jiaweihli··on Embarrassing code I wrote under stress at a job interview
Are there any good IDEs for Clojure? If so, most of the stumbling could have been avoided. Coding without one tends to fall into the "ball-of-mud" problem where wrong code is built on top of other wrong code. Or alternatively, is there any way to continuously compile Clojure?
jiaweihli··on “Discuss latest changes to master before releasing”
If you care about filesize, you'll probably optimize as much as possible. You can do this with Lodash using modular imports.

There's little upside in hosting a light version, and fragmenting the docs. Min/max'ing on filesize lets you save 15 kB, or 0 kB. Creating a light build that saves 5 kB is a maintenance cost with a poor ratio relative to reward.

jiaweihli··on Show HN: I'm renting a truck to make buying and selling furniture easier
You'll have quite a bit of competition!: https://www.moveloot.com/
jiaweihli··on Tower 2
I don't see $60 of value over a few customized git aliases. The 'easy visualizations' in a GUI can be just as easily teased out with .gitconfig snippets:

> lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative

jiaweihli··on Why composition is often better than inheritance
I think this is a tooling issue. People initially tend to favor inheritance because it looks cleaner than composition. Mixing a lot of unrelated code in the same class makes things hard to find. (which method applies to which composed object?)

In languages that build in a concept of traits/mixins however, this isn't an issue.

jiaweihli··on Chris Lattner on Swift
Can you explain what you mean by `checks for safety first (variable declaration)`?

This issue only seems to affect arrays. Strings, numbers, and dictionaries are fine.

jiaweihli··on Chris Lattner on Swift
I'm not sure if it's XCode / playground acting up, but array equality is broken for me: `[1, 2, 3] == [1, 2, 3]` returns false. This seems to contradict the core declarations though:

/// Returns true if these arrays contain the same elements.

func ==<T : Equatable>(lhs: T[], rhs: T[]) -> Bool

Works alright for dictionaries. Is there a bug tracker for Swift anywhere to report this?

Edit:

Whoops, copied wrong declaration. ContiguousArrays actually work fine, but require an extra cast. e.g.

ContiguousArray([1, 2, 3]) == ContiguousArray([1, 2, 3])

jiaweihli··on [dead]
This is going to come off as abrasive (out of context it sounds pretty bad), but:

I've never understood why progress should be sacrificed because 'someone loses a job.'

Idealistically, this indicates a problem with society - that people have to keep toiling away at automatable jobs for the sake of earning enough to live on.

Practically, this is going to happen at some point sooner or later once it becomes commercially profitable to do so and enough players are in the market.

Some of the greatest inventions have come out of the most meaningless original intentions. To play devil's advocate, maybe using drones for food delivery could eventually lead to finer-grained drone control - surgeries might very well be drone-assisted in the future!

jiaweihli··on Scala – The Simple Parts
I'm not sure what you mean by word, but + vs. add() definitely have different levels of cognitive burden:

Compare: (a + (b + c)) + d vs. add(add(a, add(b, c)), d)

One is arithmetic, the other is polish notation.

jiaweihli··on Scala – The Simple Parts
A few years ago, this was very much true. The Dispatch lib for doing HTTP requests was particularly guilty of this - you had to learn a whole new mapping of symbols to methods!

I feel Scala is beginning to stabilize now. The recent release of 2.11 fixed several annoying issues, notably thread-safe reflection. The community is beginning to build some substantial and usable libraries. There's a still a long road ahead, though.

That being said, I doubt (and fervently hope against!) Scala will ever become Java++. Scala seems to constantly push the boundaries of language design. This is great, as it results in exposure for some lesser-known concepts into the mainstream developer community (e.g. Scala implicits ~= Ruby refinements).

With regards to language stability - the docs will specifically warn you against highly experimental features (e.g. macros), and for many you even need to explicitly import something to enable them.

The type system is very much rock-solid. Scala doesn't force you to use co/contra-variance or higher-kinded types, but they're there should you need to write very theoretically sound or extensible code.

jiaweihli··on Scala – The Simple Parts
Yes, you're always paying the character: each character increases mental load on the developer - either through code complexity (https://github.com/scalaz/scalaz) or just the sheer amount of code (would you want to code everything in assembly?).

Leaky abstractions, as you mentioned, result in unclear code. On the other hand, well-designed and easily understood abstractions reduce complexity.

Take for example, the atrocious lambda 'hacks' needed before Java 8 - create an anonymous class, then override a method. Compare that with something like words.map { _.size }

← PreviousPage 4 of 5Next →