HNHacker News
TopNewBestAskShowJobs

coconut_crab

559 karma · joined January 25, 2017

[ my public key: https://keybase.io/coconut_crab; my proof: https://keybase.io/coconut_crab/sigs/AnGK3By-ffQcTB_DIOuHL50A_QADgkNYWMJazM6porA ]
submissionscomments
coconut_crab··on Write tests. Not too many. Mostly integration
I also practice TDD, but with a different 'T' - Type Driven Design. I find them much easier to reason about with types and safer (you can't compile your code if it doesn't pass the type check). Just model your data as ADT and pattern matching accordingly.

Of course, types alone can't represent every error cases out there (especially the one related to number or string), so I still write Unit Test for those cases. But the number of Unit Tests needed is much lower.

coconut_crab··on Ask HN: What maths are critical to pursuing ML/AI?
Maybe unrelated to OP's question but I have always felt that it is impossible to get a job in AI/ML without a PhD in that field (by getting a job I mean do something new/useful and not just coding algorithm devised by other people). I studied mechatronics in university and fairly comfortable with math (calculus, linear algebra and stats), I have even written a small neural network back then to optimise parameters for lathe machining. But that's no where near enough for a job in AI/ML. Unlike writing a web page, which someone can learn within a week to produce something usable, I feel like you need years and years of studying to barely get a start in ML/AI and there is no hope for us non computer scientist at all.

[Added] Of course writing webpages pays well enough, but I still can't shake off this feeling that I am missing something by not jumping on the AI/ML train though.

coconut_crab··on Eating Clean is Useless
I thought the article was talking about eating food contaminated with dirt reading its title. Which I happen to agree with, small doses of bacteria do wonder for my immune system. It turned out to be an article of counterargument against antiGMO and organic food though.
coconut_crab··on An introduction to Stoic philosophy and resilience-building [video]
I like the principle of Stoicism. But I don't see how can that help with the suffering of the people I care about. I am fine with losing my job, my home or my social position (or at least so I think), but what about my spouse? my children? How can I still feel calm when I fail to support them?
coconut_crab··on The First Time America Freaked Out Over Automation
The optimised process was only for weight and strength, not manufacturing. How would you craft the right one? by 3D printing? Good luck with the required strength, while the human designed one would cost a few dozens bucks here, hand welded. As a mechanical engineer, when you design something, think of the poor guy who will have to make manufacturing plan for it. Yes, maybe one day computer will be able to do both, but the problems still come from human, and human is notoriously known for undefined behaviour.
coconut_crab··on The Document Which Used to Be Called the MIT Lockpicking Guide (1992)
Ditto. Back then my parent often locked the room with the computer so that I could 'focus' on my study instead. And this guide helped my learning about pascal, C and then x86 assembly (when my father got so frustrated he took out the HDD and I have to run MenuetOS instead).

I think the section about Zen and Analytic thinking helps shaped my way of thinking. Before that I just charged blindly into problems, only to get stuck somewhere. But after reading the guide, I often stop for a while, thinking 'why doesn't this work?' and try to figure out how, back gathering all the evidences and make a mental model of it in my brain. Interestingly it is quite useful for programming too.

coconut_crab··on Anthony Bourdain on not having debt
Vietnam, ranks 110 or so in transparency index
coconut_crab··on Anthony Bourdain on not having debt
I live in one of the most corrupted countries in the world. Yet our newborn immunisation rate is nearly 100%, with free healthcare and education for the people in poorer rural area and ethnics minorities. And my tax money contributed to that.

I guess it's fine to hate your government, but a better solution is to change it than avoid paying tax. Because if people pay less tax then then the poor and vulnerable will be affected first, not the corrupted interest group.

coconut_crab··on PulseAudio requirement breaks Firefox on ALSA-only systems
Can you please elaborate further? I think PulseAudio's timer based scheduling is a big improvement over interrupt driven one. Bluetooth audio just works, per application volume control, audio streaming and switching audio sink is painless, you can even configure your resampling algorithm. Even if you use pure ALSA you still have to use a sound mixing server (dmix) since most sound cards these days lack hw mixing.

Okay, I understand that it breaks systems with badly written audio drivers, but can we really blame Pulseaudio for that?

coconut_crab··on How is news marked as disputed on Facebook?
I think people will just mark anything they don't like as disputed. IMO they can try suggesting posts with different view points than the one users click 'share' or 'like' (combining ML and user provided data to pick the articles). Maybe that will help people have a bit more balanced view on the matter.
coconut_crab··on Kim Jong-Nam Was Killed by VX Nerve Agent, Malaysians Say
I read somewhere that they wore gloves before applying the poison.

Wikipedia has something interesting about VX:

> VX can also be delivered in binary chemical weapons which mix in-flight to form the agent prior to release. Binary VX is referred to as VX2,[6] and is created by mixing O-(2-diisopropylaminoethyl) O′-ethyl methylphosphonite (Agent QL) with elemental sulfur (Agent NE) as is done in the Bigeye aerial chemical bomb.

So maybe two of them were holding different component and they only reacted after being sprayed on Kim's face. If this is true then this is a very intricate assassination plan.

coconut_crab··on 68 things the CLR does before executing a single line of your code
Matt Warren's blog is great to learn about the internal mechanism of .Net. I wonder if there is any similar blog for JVM world, so far I have only know Mechanical Sympathy[1] but it doesn't seem as comprehensive.

[1] https://mechanical-sympathy.blogspot.com/

coconut_crab··on Wanted: Factory Workers, Degree Required
For some of the CNC systems I have had experience with, repairing means figuring out which parts are broken and need to be replaced, sometimes it's just trial and error.
coconut_crab··on Wanted: Factory Workers, Degree Required
> Ditto at John Deere dealerships, which repair million-dollar farming machinery filled with several dozen computers. Fixing tractors and grain harvesters now requires advanced math and comprehension skills and the ability to solve problems on the fly. “The toolbox is now a computer,”

I don't know about America but here repairing expensive machinery is the job of engineers, not factory worker. The latter's work involve pushing button, soldering, assembling etc.. but not something that require critical thinking or problem solving. Automation is still either 1. more expensive than manual worker (in case of FMS) or 2. only applicable for large scale/high value added manufacturing.

FMS: Flexible Manufacturing System.

coconut_crab··on The Domain-Driven Design Paradox (2016)
> Even on the implementation side of a project, there is a lot from DDD that is always usefull. It’s not always about CRUD or CQRS and Event Sourcing. But it’s always about naming the methods, classes, interfaces and modules according to the domain language, the Ubiquitous Language. This is DDD.

> If I encourage collaboration between technical and domain experts and work iteratively to refine a conceptual model, I can claim I’m doing DDD.

This. I am tired of the so-called 'DDD-experts' trying to convince us that you must use X framework with Y techniques to 'properly' implement DDD. In the eyes of some managers I know DDD is something mysterious, something that requires expert consultants to do and if we copy paste their design we will be doing 'DDD'. That explains why in my company each team has their own understanding of 'DDD'. To me, the Ubiquitous Language is the essence of DDD. As long as I name my class/method/function/variable accordingly then I am doing DDD. And we try to make it so that the Domain Experts can read our code and say its business logic is correct or not, even if they don't know anything about programming at all. To do that we can use whatever tools/languages we want, OOP, FP, Free Applicative, DSL etc..

It's the Domain that matters in Domain Driven Design, not the framework or languages or even design patterns.

EDIT: Fixing formatting again..

coconut_crab··on Making the move from Scala to Go
My company also have a lot of problems with Scala, both technical and non technical ones, but so far we have managed to control it:

- As for slow compilation times, incremental building helps a lot.

- Intellij works most of the time, and if it doesn't a few type annotation will fix it.

- It's very hard to find people with Scala experience. We have given up on finding those and decide to train people from the beginning for 2 months. I myself studied mechanical engineering in university and I can code just fine after a few months.

- The language itself is very complex, so we let more experienced programmers write the backbone/framework/library/common parts and the less experienced one do the code glueing-job. That way we can have Scala type safety and expressiveness without scaring the juniors. IIRC one company used Haskell also do the same and they said it is very hard to introduce runtime bugs because almost everything were caught during compile time, "If it compiles, it works".

You may ask why going through so much trouble just to use Scala. There are many reasons (speed, type safety etc..), one of them is that we can be immensely productive when needed, the conciseness of the language combine with a powerful type system let us implement complicated features rapidly without very few bugs. IMHO Scala strives to combine both FP and OOP on top of JVM so a lot of tradeoffs had to be made. The developers have to learn a lot of concepts and have good self discipline, but in exchange we can write fast, robust systems and even enjoy it.

(Edited for better formatting, this is my first time posting here.)

← PreviousPage 4 of 4