HNHacker News
TopNewBestAskShowJobs

jiaweihli

433 karma · joined November 15, 2012

submissionscomments
jiaweihli··on Making the move from Scala to Go
Yes, first thing that crossed my mind. Scala is a very deep language, it was by far the language that took me the longest to learn.
jiaweihli··on Making the move from Scala to Go
If you ever find yourself working in JS and want Options, I've got you covered: https://github.com/jiaweihli/monapt
jiaweihli··on Making the move from Scala to Go
Unfortunately sole code ownership increases the bus factor.
jiaweihli··on Making the move from Scala to Go
Unfortunately, ternary operators eventually end up like this due to refactoring blindness:

  usefulMetric = wantComplexCalc ? 
                   (complexity > 40 ?
                     superComplexCalc(foo) :
                     regularComplexCalc(foo)) :
                   simpleCalc(foo);
jiaweihli··on Some Thoughts on Hiring at a New Startup
Yeah, I get that. There's not a good way to interview for many companies within only PTO.

Something that's worked well for me in the past is to secure at least 1 good offer - compensation you feel comfortable with, recognizable brand, but still an offer you're willing to walk away from - and then give notice.

Then, after leaving, spend additional time (up to 4 weeks) interviewing with all the other companies you want to. Keep in mind that many companies offer a sign-on bonus, and using it to cover this in-between time is high-return, likely more so than buying a new car/vacation/entertainment system.

You can be upfront about this break in your interview loops - "I'm no longer working at company X, but I have a very competitive offer from company Y and considering several other ones." There's no guarantee you'll be able to keep all the offers you receive (many of them will explode), but you should have a steady pipeline.

Whenever you feel comfortable, you can exit the pipeline, and begin negotiation with the outstanding offers you have. Last I did this, I went onsite ~15 times among even more interview loops.

jiaweihli··on Some Thoughts on Hiring at a New Startup
I strongly disagree with this. I've been on the other side of the fence, trying to hire people for an early-mid startup (5-40 people) as an early employee.

There are more people than you'd expect who can talk the talk but can't code at the same level. In the majority of companies, I'd bet there aren't too many openings for engineers in such a narrow role. If you don't want to work with an 'idea person', would you want to work with an 'idea engineer'?

Multi-day interviews are likely overkill, but a full day interview is completely fair. There's no need to do 4 back-to-back algorithm whiteboarding sessions, but testing other aspects such as data modelling, general architecture, and coding style/ability are all high-signal.

jiaweihli··on Percentage of Young Americans Living with Parents Rises to 75-Year High
Then many of the doctors/lawyers burdened with extreme student debt and unable to find work will put pressure on the insurance companies and ultimately charge lower prices. That's likely decades out though.
jiaweihli··on Why I Studied Full-Time for 8 Months for a Google Interview
I would bet that a lot of companies consider certifications to be a negative signal when evaluating candidates.

Likely because the certifications aren't meaningfully standardized, so there's not much point in seeking external validation unless you're not confident in your skills.

jiaweihli··on Why I Studied Full-Time for 8 Months for a Google Interview
IANAL, but I've heard in California at least, companies can't claim ownership over work you do on your own time on your own resources, that don't directly compete with the company.

Of course, things get muddier since Google does almost everything. But I doubt they'd want to engender ill will by suing an ex-employee for ownership.

jiaweihli··on What Makes a Senior Software Developer?
It's some correlation, and it's more useful than the full spectrum.
jiaweihli··on An Introduction to Polymer - A Web Component Library
spankalee@

Likely needs an A or a CNAME record.

jiaweihli··on What Makes a Senior Software Developer?
In an ideal world, this is probably the case. Unfortunately, there are a lot of non-ideal codebases in the world.

Even the worst developer can eventually develop fluency in a poorly-designed codebase and seem much more competent than they actually are, compared to a new hire.

jiaweihli··on What Makes a Senior Software Developer?
I can believe that there's _some_ correlation.

From what I've seen, a high frequency of commits means either:

  - Has very little understanding and churns out code one day and removes it the next.
  - Thinks a lot about their code, and divides them into digestible, independent chunks.
jiaweihli··on Google Makes So Much Money, It Never Had to Worry About Financial Discipline
You might find this an interesting read: http://www.recode.net/2016/12/5/13842608/former-google-ventu...
jiaweihli··on Announcing TypeScript 2.1
As long as you're not doing type casting or any funny reflection, you can write that code and it'll be caught at compile-time.

I wrote a library [1] that does this in a readable pattern-matching way, hope you find it useful!

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

jiaweihli··on Announcing TypeScript 2.1
You're right, this has been added recently and there's also now a community effort around 3rd party modules. [1]

Though it looks like it didn't become active until after at least 03/2016 [2].

I mention this only because TypeScript has been active in this area since 10/2012 [3], which is in-line with the original intent of my comment - that Flow is over 2 years (closer to 3.5 years) behind in building this out.

[1] https://github.com/flowtype/flow-typed

[2] https://github.com/flowtype/flow-typed/graphs/contributors

[3] https://github.com/DefinitelyTyped/DefinitelyTyped/graphs/co...

jiaweihli··on Announcing TypeScript 2.1
Very early on, Typescript cleverly built up an ecosystem around community-supported type definitions for popular js libraries. This makes type-checking and integration for those libraries dead simple.

2 years later, Flow is _still_ lagging behind in this area. [1] I'm not certain, but I think this may be due to Typescript allowing for a external header-like file while Flow requires inline types.

For this reason I believe, as many other commenters have noted, Typescript has nearly always been ahead of Flow in popularity.

[1] https://github.com/facebook/flow/issues/7

jiaweihli··on Announcing TypeScript 2.1
Try webpack, it's fast and the configuration is nearly declarative.

You can also create a separate build task to run a smoke test by directly calling the ts compiler to compile your code (skipping pre- and post- build steps). This was a lot faster than I expected.

jiaweihli··on Announcing TypeScript 2.1
I haven't worked too much with Haskell, but I've spent some time with Scala - they have pretty advanced type systems.

Typescript can't match them 100%, but it's getting there. e.g. It doesn't have type variance, but it does have f-bounded polymorphism (which is unheard of in most mainstream languages). The language is powerful enough to build your own constructs. I maintain a Typescript library[1] that emulates Scala options/trys/futures.

For day-to-day work, Typescript is a joy to work with. I describe it to others as the child of Scala and Ruby - pretty powerful type system but with a large community.

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

jiaweihli··on Do the math: too much calculus? (2012)
I grew up 3 years ahead of my classmates in math. I found everything up until calculus to be easy but elegant - algebra, geometry, probability, trigonometry. Much like programming, there were often multiple ways of the solving the same problem, and deriving a formula was feasible and logical.

In contrast, I found calculus to be mind-numbingly boring. It required memorizing and reciting formulas upon formulas. It was the first time I felt that math was tedious, and pushed me away from majoring in math in college.

jiaweihli··on “If you get a C or lower, I’ll buy you a present”
You're describing a fixed vs. growth mindset. This applies both to your current perception of people (notably children), and also your perception of yourself when you're a child.

I believe in the growth mindset - to explain your example of sibling dominance, I believe that a child's mindset heavily influences their ability to learn. If it has a positive effect, the preparation they do is both more effective and more bountiful (this is usually classified as stubbornness / determination). But preparation _is_ necessary to perform a task at a high level. When you hear of 'prodigies', they often started whatever it was - math, music, sports, programming - at a very early age, and reaped the interest.

jiaweihli··on Daydream – Google VR
Considering Daydream is effectively the next iteration of Cardboard, I'm also happy to take that bet.
jiaweihli··on Daydream – Google VR
Other manufacturers are likely all scrambling to catch the VR train so they aren't left behind. I expect all top-end phones to support VR within the next 2 years, if not 1 year. So within that time the cost will fall down to $80.
jiaweihli··on How it feels to learn JavaScript in 2016
There's no need to jump straight into the deep end of tooling.

An iterative approach works really well here - do a brief survey of what tools there are and what problems they solve. Then, when that problem starts soaking up a lot of time, you can read up on the available tooling in greater detail.

There _are_ a vast amount of libraries in the js ecosystem, and it'll take time to fully understand all the different pieces. It took me nearly 2 years to achieve an understanding of most of the buzzwords in that article (and even then, there are some I still haven't worked with directly).

In my personal experience, learning JS is very much a BFS process.

jiaweihli··on Announcing TypeScript 2.0
For explicit Maybe/Option try Monapt[1]. Disclaimer: I might know the author =)

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

jiaweihli··on React Fiber Architecture
I think I understand what you're getting at - correct me if I'm wrong.

React's templating allows you to execute arbitrary JS logic when rendering, which is more versatile than simple one-way data binding.

My thoughts there are that I'd probably extract the logic first into the view model before passing the buck to the templater. For example, instead of filtering/sorting a collection in the template, I'd create a `normalizedCollection` computed property in the view model first (which helps with testing as well). In practice I've found that Rivets' binders are enough - showing/hiding/looping over data covers nearly every UI.

In the case of bigger chunks getting un/re-rendered (such as adding tabs/tiles/panels), you can take advantage of a framework that does sub-view management (such as Marionette[1]).

Computed properties can solve the hidden fields and multi-data series chart problem you mentioned.

[1] http://marionettejs.com/docs/v2.4.7/marionette.layoutview.ht...

jiaweihli··on React Fiber Architecture
Can you give an example of a more general problem that you see React solving better? The example you gave earlier doesn't fully answer this.
jiaweihli··on React Fiber Architecture
Are you thinking of computed properties? If so, there are many libraries that have solved this, e.g.:

https://vuejs.org/guide/computed.html

https://guides.emberjs.com/v2.3.0/object-model/computed-prop...

When implemented using one-way data binding (as both of the examples do), this is more performant than DOM diffing.

jiaweihli··on React Fiber Architecture
Can someone explain the benefits of React's DOM diffing model?

Rather than try to diff two DOM trees and optimize reconciliation, why not use one-way data binding and update exactly what has changed, with 0 reconciliation cost? Either way, the upfront work - linking DOM elements with model attributes - is the same. In JSX this is done by interpolating variables into the template, and in one-way data binding this is done via data attributes.

Anecdotally, I've found one-way data binding (using Rivets[1]) to be very fast in practice for a view hierarchy ~10 layers deep.

[1] http://rivetsjs.com/

jiaweihli··on Why Angular 2 Switched to TypeScript
You aren't required to use import, use require if you don't care for typings:

`var aLibrary: any = require('aLibrary');`

← PreviousPage 3 of 5Next →