HNHacker News
TopNewBestAskShowJobs

jiaweihli

433 karma · joined November 15, 2012

submissionscomments
jiaweihli··on Tech Giants Set to Face 3% Tax on Revenue Under New EU Plan
From that angle, the transition from Google to Alphabet was prescient.
jiaweihli··on The Makefile I use with JavaScript projects
I went through a Makefile phase but ultimately setting on Jakefile[1] for more approachable syntax and type-checkability via TypeScript.

[1] https://github.com/jakejs/jake

jiaweihli··on Slack is the opposite of organizational memory
Your interpretation of the quote is that middle managers don't provide value, but I think that may be too broad. I understood it as "highly formalized process often rewards middle managers", which I do think is true.

The best manager I was lucky enough to report to personalized his approach to his direct reports. He recognized that some people are more creative, others prefer more structure, etc. He still had his responsibilities, e.g. report progress on project X and estimate completion, but this was abstracted away from the team. For all we knew, we each had an area of the system we were responsible for, and we had longer-term collaborative projects that would take on the order of months. I didn't realize how great of a manager he was until I had other managers who firmly believed in the One True Way™ of managing projects, and also pretty much required everyone to be heavily involved in it. (Give estimations for things you haven't worked on, and move tasks as you get to each stage of development.)

Getting back to my original point - highly formalized process often rewards middle managers because it simplifies work for them. Everything is already tracked in the system, it's a matter of moving around and allocating resources. But why does everyone need to be involved in this? Why isn't heavily formalized process compartmentalized to just managers and the people they report to (and maybe their reports that enjoy that process)?

I recognize the value that managers bring - otherwise every individual contributor becomes a mini-PM - but I also believe that the best managers put in the work. They build good personalized relationships with each member of the team, and are able to compile estimates based on their interactions. It's not always a cold science in the vein of "since Alice has 13 points out of a maximum of 18 points per sprint, I should try to allocate 5 more points - the biggest task that fits into that is 4 points, so let's assign that to her."

jiaweihli··on Software Complexity Is Killing Us
This can really cut both ways, and moderation is key.

I've seen software that's extremely overengineered. Something like ~15 microservices with data (for the same model) split across both Mongo and Redis, spun up via Docker configs hosted on Google Kubernetes Engine. Run by 1 person for a product with low (<1k DAU) traffic.

On the other hand, I've also seen software that's extremely _underengineered_. And that might not be a disjoint set. The same stack I mentioned above implemented an in-house search, task/message queue, deploy system, URL shortener, and mobile notification service - all with a more restricted and buggier API compared to more popular commercial / open-source offerings.

It's highly important to choose your areas of competence. What systems need to be better in X vs. off-the-shelf alternatives? And can you afford to dedicate time and money (through development and maintenance) to support it?

===

I'm going to state a likely unpopular opinion now, and advocate that most typical SAAS / CRUD projects start with Rails, and build from there. I say that because there are many, many well-maintained and battle-tested libraries that have already been vetted in that ecosystem, and the community's mantra is to optimize for engineering productivity (GSD and communication with other engineers) and happiness. There are libraries to set up an ingest pipeline [1], or a pooled background task system [2], or whatever other complex systems you need to build. But when you're just getting started, you want to set up an API with some validations against business logic, and ActiveRecord and Rails(-api) gets you pretty far very quickly for just that.

Another related unpopular opinion I hold is to avoid Node, unless you have a specific reason to use it. Yes, it's new and flashy, but the cost of that is that the ecosystem hasn't matured and tooling you'd expect doesn't yet exist. That's not to say that every new technology should be avoided. I think of it as investing in a sense - you need to place your bets correctly based on research like community, maturity, functionality, and possibly most importantly: how it compares to existing tools (and their trajectories).

[1] http://shrinerb.com/rdoc/files/README_md.html#label-Direct+u...

[2] https://github.com/mperham/sidekiq

jiaweihli··on Dropbox Developer Terms and Conditions
But how much would you or others pay for such a service, on a monthly basis?
jiaweihli··on Slack is down
There's a coin for that: https://www.shiftnrg.org
jiaweihli··on Why Bottled Water Is So Expensive on Amazon Right Now
The price could depend on where you live.
jiaweihli··on How to spot a psychopath
M
jiaweihli··on StackOverflow for private teams in beta
I looked into this briefly in the past, but it didn't seem viable.

Reviews complain about bugginess and pricing: https://marketplace.atlassian.com/plugins/com.atlassian.conf...

And active development stopped in early 2016: https://marketplace.atlassian.com/plugins/com.atlassian.conf...

jiaweihli··on Ask HN: How do you manage your daily non-work related tasks?
This is neat, it looks similar to Fantastical. Have you used that before, and how does it compare if so?
jiaweihli··on How to Keep Your Best Programmers (2012)
The original post specifically calls out hoarding:

> On the other hand, the unskilled tend to have a slightly different curve: Value Convergence. They eventually settle into a position of mediocrity and stay there indefinitely. The only reason their value does not decrease is because the vast amount of institutional knowledge they hoard and create.

The quote you're addressing (from another article) is also qualified in the original source, under "Responses to comments" / "Not everyone ‘left behind’ is incompetent": http://brucefwebster.com/2008/04/11/the-wetware-crisis-the-d...

jiaweihli··on How to Keep Your Best Programmers (2012)
I don't believe the author is looking down on people who work on boring, critical systems.

Rather, his point is that people who go _out of their way_ to hoard knowledge on ancient systems and make themselves critical are people you want to avoid. As a single point of anecdata, the best engineers I know want to democratize information - they hate tribal knowledge because it creates a point of failure and bottleneck in the Keeper of the Tribal Knowledge.

jiaweihli··on Repetitiveness and compressibility analysis in song lyrics
Like @Asdfbla, I'm on 2560x1440 and have the same issue. The viewport is likely the issue =)
jiaweihli··on The 10x developer is not a myth (2013)
It can be both, the "From years of experience" is figurative. Try changing it mentally to "From experience" and re-read the second sentence.
jiaweihli··on Pattern Matching for Java
If you're interested in exploring pattern matching, I've created a Javascript/TypeScript library dedicated to it. [0]

You can see it live! [1]

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

[1] https://runkit.com/jiaweihli/57db70d841de7f1400d64f73

jiaweihli··on TypeScript at Slack
No, (Foo | undefined)[] means an array of elements that are either of type Foo or are undefined.

Foo[] | undefined[] means either 1) an array of Foo, or 2) an array of undefined.

jiaweihli··on TypeScript at Slack
Maintainable, but at what cost? A large chunk of unit tests for dynamically typed code is dedicated to checking types.
jiaweihli··on TypeScript at Slack
The new null-checking is great, but is notably missing first-class support for dealing with null. If you're familiar with Options (e.g. Java 8, Scala, Haskell), I've written a library [1] to fill that void until TypeScript does so.

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

jiaweihli··on Show HN: Codewich – A live-updating TypeScript/CSS/HTML playground
This is a bit meta, but both of you stated a position without providing a concrete rationale.

Something to consider is that people can gloss over an explanation for convenience. For example: in the previous sentence, I didn't provide any proof that it's accurate. You could make the argument that nobody glosses over explanations for convenience.

I don't think it's necessarily worth proving every statement, because that'd be extremely time-consuming. But if you provide an opposing viewpoint, back it up with clear reasons (this helps filter out positions that are undefendable), and I'm interested in defending my position or continuing the discussion, then we can have a meaningful discussion from that.

jiaweihli··on Buck – A build system developed and used by Facebook
Groovy rules side-by-side:

https://buckbuild.com/rule/groovy_library.html

https://github.com/bazelbuild/rules_groovy#basic-example

jiaweihli··on Data on the uselessness of LinkedIn endorsements
A bit late, but apology accepted! =)
jiaweihli··on Writing good code: how to reduce the cognitive load of your code
Why stop at 1 page a day? Code complete is an easy read that deserves to be enjoyed multiple times.
jiaweihli··on Writing good code: how to reduce the cognitive load of your code
DRY isn't something you should blanket apply. There are cases where you do want to repeat yourself, e.g. to improve readability (avoiding metaprogramming, which is hard to reason about and will break your IDE) or because two things aren't actually semantically related (trying to force an abstraction means you need to undo it later anyways when the implementations diverge).
jiaweihli··on Data on the uselessness of LinkedIn endorsements
I'm mildly offended that you trivialized my comment. I'm even more confused because I believe my questions are completely valid, and you're not taking them at face value.

To rephrase:

Have you ever encountered a flash of insight that seemed to approach a challenge from a completely different angle? It could be something like someone solving a deeply technical problem in a non-technical way, or the first time you were introduced to affordance [1].

This is similar. Instead of the obvious solution of injecting buzzwords into his LinkedIn profile, deftnerd did a social hack that nudged his own connections towards viewing his profile, equivalently boosting his visibility.

What I meant by my questions is that I'm interested in learning both the flash of insight and the thought process that led to that. Sometimes the reason is as bland as accumulated knowledge (but even then, what knowledge?). But if not, maybe I can learn a completely new perspective from which to approach a whole class of problems.

[1] https://www.quora.com/What-are-examples-of-affordances/answe...

jiaweihli··on Data on the uselessness of LinkedIn endorsements
Wow, that's an ingenious hack that makes a lot of sense in hindsight. What was your thought process and how did it lead to that? Was it solving a similar problem in another domain?
jiaweihli··on The State of Go
Also Akka for Java/Scala.
jiaweihli··on CSS Grid – Table layout is back. Be there and be square
It looks like this is getting released in the next major version of most browsers[1].

For Chrome, that means no sooner than 03/14/17. That version, Chrome 57, will also come with automatic background tab throttling[2].

[1] http://caniuse.com/#search=grid

[2] https://news.ycombinator.com/item?id=13471543

jiaweihli··on Making the move from Scala to Go
It's because it's too easy to lose some of these nuances during refactoring/development blindness. I'd go so far as to say it's inevitable.

If you come into a 3 year old codebase and during the first 2 weeks you need to add extra functionality to a 30-line function with an early return, are you going to refactor the early return? Or are you going to extend it into a 32-line function? What about the new hire after you?

Alternatively, your team has decided to embrace the "only use conditionals on boolean values" philosophy. You're working with a section of code that reads `if (myVar)`. It's been 3 hours, and you don't understand why the code's not working. Suddenly, you realize that at some point `myVar` was refactored from a non-nullable boolean to a nullable number, and someone missed changing this.

And the biggest offender yet - code that is grouped within a file into 'logical sections'. I've never seen this work out. What is a logical grouping for you is a confusing pairing for me. Or maybe it's that I can't immediately grok all 2000 lines of a file I've never seen before, and know where to place the method. This madness around code location is one of the quickest ways to code rot.

---

The perplexing thing to me is that these situations are completely preventable.

If you don't use early returns, scenario 1 won't happen.

Scenario 2 won't happen if you use real comparisons e.g. `if (person.age !== undefined)` (Similarly, `if (person.age != null)` breaks when null and undefined start meaning different things...)

And lastly, a canonical alphabetical/visibility ordering for methods in a file of any length is unambiguous. I don't care what the order is, as long as there is a canonical order.

---

I understand that other teams have their own rules. It's no trouble at all to adjust to things that are purely syntactic differences. But when the rules that are chosen hide lurking semantic pitfalls...I don't know why you'd risk shooting yourself in the foot.

A lot of my strong feelings on code style come from the book Code Complete. I highly recommend that to everyone who hasn't read it. It's filled with examples of confusing/broken code you might inherit, and teaches you how to avoid creating it yourself.

Edit: looks like we hit the HN thread depth limit. Happy to continue this over Twitter, check my profile.

jiaweihli··on Making the move from Scala to Go
Yes, the frustrating thing was that people previously praised the language _despite_ its obvious footguns. A language where 'dropping parentheses where you can' is idiomatic is a disaster waiting to happen.

I don't know about you, but I never want to be holding a footgun, ever.

jiaweihli··on Making the move from Scala to Go
In all honesty, I prefer having rules that have no special-case 'unless' issues. It's too much effort/trouble to remember all the cases where things don't work. I'm a good engineer but a terrible compiler.

I believe part of learning a new library/framework/language is to limit yourself to a certain subset of the API offered. After working with Ruby (the language) and Javascript (the ecosystem), I feel like that's the only way to preserve your sanity and productivity. I don't need to know 4 different ways of creating a lambda in Ruby, selecting 1 that can express the other 4 is good enough.

---

In this case, the rule would be no ternary operators, since they work well unless you nest them or unless you make them long/complicated.

Other examples -

You don't need to wrap if conditions unless you have a multi-line body:

  if (myCondition)
    x = 42;
    y = 23;
Early returns simplify short circuiting logic unless your function becomes too long:

  if (myVariableAtBeginningOfFunction) {
    return true;
  }
  ...
  // 2 screens later
  ...
  if (x == 42) {
    return false;  // why am I not getting false?!
  }
Using a variable as a conditional in javascript to test against undefined works well unless the value can be falsy:

  if (person.isStudent) {
    showSchool();
  }

  if (person.age) {
    showBirthCertificate(); // what if age is 0?
  }
← PreviousPage 2 of 5Next →