A different kind of Arc challenge: a quest for a true 100 year language - <AUTHOR> http://blog.offbytwo.com/2008/02/05/a-different-kind-of-arc-challenge-a-quest-for-a-true-100-year-language/ <comment><USER2> I am not certain what this new challenge is trying to achieve. The Arc challenge serves an immediate purpose: getting people to investigate Arc (and perhaps to ease the sniping put-up-or-shut-up style).

Thinking about a 100 year language seems very ivory tower like. I feel like that is something I should do after I create something useful and generate significant wealth.

<comment><USER3> > Thinking about a 100 year language seems very ivory tower like.

Agreed. I'd rather have something 'pretty good' right now, and worry about the future later. This industry changes too quickly to do something like worry about 100 years in the future.

> I feel like that is something I should do after I create something useful > and generate significant wealth.

Disagree, and I think a truly great version of Arc is the opportunity cost of Viaweb and YCombinator. I think to create a truly great language, you have to really _focus_ on your language, and probably start, if not in your 20ies, by around 30. I think that perhaps that ship has sailed for PG and Arc, although I'd be happy to be proven wrong. I think though, that YC is in some ways a bigger and better hack than Arc, and am glad he's done it - there are plenty of people to work on new languages (there are so many that the cost is essentially 0, for something that is not an easy project), but far fewer people in a position to do something like YC as successfully as PG has.

<comment><USER4> > This industry changes too quickly to do something like worry about 100 years > in the future.

Disagree. It may _seem_ ivory-tower-y, but it's a great aspiration, and I don't see anyone else doing it. PG is financially secure, and probably one of the smarter hackers out there - I think it would be hard for him to justify a less ambition goal - surely it's better than toiling away publishing academic papers for whatever academic fads are popular, the vast majority of which will lie discarded 100 years from now.

<comment><USER3> When I think about what technology was like 100 years ago, I'm dubious that aiming at 100 years from now is sensible. Creating and popularizing a good, hacker-friendly language that works well now is already a tough challenge and a worthy goal.

<comment><USER4> _When I think about what technology was like 100 years ago_

Touche... on the other hand, although I don't have artistic training, I'm sure there are techniques which have stayed around, even though photography has mostly "replaced" painting in most uses (or at least in some way...). By analogy, if some technology replaces explicit programming, people will still program.

</comment></comment></comment></comment></comment><comment><AUTHOR> I don't like submitting links to my own site. I was going to write this as a new post here but it soon became unwieldy so with a bit more editing I posted it on my blog. I'm curious to see what you think.

<comment><USER5> Implement Arc, eh. Maybe you'll go first?

<comment><AUTHOR> I don't know about implementing Arc but I might take a stab at writing a language that would make writing Arc easy.

<comment><USER6> _I don't know about implementing Arc but I might take a stab at writing a language that would make writing Arc easy._

Be careful. This sounds like it could be the first step down the Dark Path. You do realize that this is how Lisp ended up where it is today: approximately 73 forked versions, differing in arcane and subtle ways, none of which has definitive mindshare, all of which snipe at each other in terms that most programmers can't even understand. The result: market confusion, stagnation, and possible eventual extinction.

So, by all means have fun writing an Arc interpreter, but don't float off into space like an untethered astronaut. Please consider trying to make Arc better rather than handcrafting your own, individual, poorly documented meta-Arc clone thing. Please. Think of the children.

<comment><AUTHOR> Oh, I have no intent on writing a new version of Arc and floating it around. I simply used Arc as an example of something that should be easy to write in a new powerful language.

I would love to contribute to Arc if it was available for example via distributed source control (like Git).

<comment><USER6> Okay, please don't take this the wrong way, but I'm going to put my Vince Lombardi coaching hat on and pick on this statement:

 _I would love to contribute to Arc if it was available for example via distributed source control (like Git)._

What on Earth are you talking about? Arc is _4600_ lines of code! Steve Wozniak used to type in more than that _by hand_ every time the power went out on his Apple I! You could do the source control using _papyrus_ and it still wouldn't be a showstopper!

Okay, I'm taking the hat off now. Admittedly, the only reason I'm exhorting you to get started is that it's easier than finding the time to learn Arc myself. ;)

<comment><AUTHOR> The distributed nature of Git makes it easy to maintain my local patches that Git will attempt to use even against newer versions of Arc as they get released and other folks would be able for example to pull in changes from my repo (and I could from theirs) if it solved an urgent problem before PG could incorporate them into the codebase. It simply makes it easier and encourages collaboration. Certainly not necessary however.

Maybe I should create a repository and mirror PG's releases for a while.

</comment></comment></comment></comment></comment></comment></comment><comment><USER7> > What should a language do to be a true hundred-year language? > It should > make it easier for programmers to write DSLs.

Agreed. And there are already a couple of us working on such languages. Have a look at Converge <http://convergepl.org/> as an example. To be honest, I think we're barely even scratching the surface of what might be possible. But in the meantime one can have fun with odd examples like an abstract-ish assembler DSL that can implement things like a Fibonacci generator [http://convergepl.org/cgi- bin/gitweb.cgi?p=src;a=blob;f=exam...](http://convergepl.org/cgi- bin/gitweb.cgi?p=src;a=blob;f=examples/dsls/wsi_asm/fib.cv)

<comment><AUTHOR> I need to take a closer look at this.

</comment></comment><comment><USER8> "Steele and Sussman tried to start over when they first began working on Scheme, but they seem to have been practically the only ones. And they made, at least from the point of view of brevity/power, some serious mistakes early on."

So what mistakes did they make?

<comment><USER9> The name "call-with-current-continuation"?

(well, actually it didn't appear until RRRS ...)

<comment><USER10> But then for call-with-current-continuation there is also call/cc ... I've rarely seen the full name spelled out in code.

<comment><USER9> call/cc wasn't in the Scheme standard formally until R6RS.</comment></comment></comment></comment>


Google's 126.96.36.199 is now not responding to DNS - <AUTHOR> Google's public DNS server, 188.8.131.52 appears to now be down as well. <comment><USER2> It should be 220.127.116.11 and 188.8.131.52. I don't think 220.127.116.11 is one of their public DNS, at least I've never seen it listed anywhere.

</comment><comment><USER3> That's because it's actually 22.214.171.124.

</comment><comment><USER4> that's not the right number.</comment>


Ask HN: How to make fewer mistakes? - <AUTHOR> I'm a developer for almost three years, i (like) to think that i'm good, i have deep knowledge of my stack and i can design and implement almost any feature that the seniors at my team can implement, but i have i problem with the final quality of my code.
My code is clean and follow the guide-lines, but i feel that i make to much mistakes, there is always a corner case that i don't think about or some test that is trivial to the QA team but i didn't do, and my code end up being broke.
This 'behavior' also happen with maths, i know the theorems and the content that i need to know to solve questions but i always miss calculate something and end up with the wrong result, one clear example of this was my last "calculus 2" exam, all the steps were right, but all the results were wrong;
TL, DR: I know my stack and the tools but i make silly mistakes that end up breaking my code; how can one get better at this? <comment><USER2> When I was getting my pilot's license, multiple times I started up without unchaining the tail. I joked about it with another instructor, and he basically said that it had literally never happened to him and that I should be doing a final walk around. I'd done even more embarrassing things, sitting at the runway ready to go and the tower tells me my baggage door is open.

Since making that final walk around a habit, nothing. I started doing final everythings, one last check of the radios, one last check of the instruments, etc, etc. It's amazing how many times you pick up on something so obvious that is wrong.

The key is to change your mindset before doing the final check. Acknowledge you are done, go get a tea, and go through the motions.

Somethings I do related to code.

Use `git add -p` to go through changes one by one. Remove stuff that shouldn't be there.

Do a self code review before submitting the code for others to review.

Obvious one, but always run tests.

For what it's worth, I find the same things with maths. I've been working on SLAM systems, so lots of differential geometry and matrix calculus. I'll spend a morning with my notebook trying to figure something out, go to lunch, then come back and go over what I've done.

In university I was horrible at maths exams, because like you I knew everything but made so many stupid mistakes. I think the problem was that during an exam, I could never dial down my mindset from OMG I need to triple check everything right now!

<comment><USER3> I was hoping someone would mention being a pilot in this discussion.

If you learn to fly, you will learn to follow checklists. Many, many checklists.

A good instructor will tell you that while you do need to follow the checklists, it never hurts to do one last check. One final walk-around before getting in the cockpit, one last check of radios/transponder, one final scan across your engine instruments before takeoff, etc.

If you do these things enough times, you'll find the occasional instance where you forgot something obvious, or accidentally skipped a checklist item.

To OP, as you miss each edge case or QA thing you should have found, you add it to your checklist. Before you check in a new piece of functionality, run it through your checklist. Also, do one last walk-around of the code. How will the user interact with it, what are the API dependencies, etc.

You're not second-guessing yourself, but you always verify even your own work before calling it done. Over time, you'll learn to follow both the best practices, and your own intuition built from years of learning from your mistakes.

<comment><USER4> I came here to say basically this. Checklists are unreasonably effective. And if you can automate them with some form of metaprogramming, even better!

<comment><USER5> Example?

<comment><USER4> Here's a good one: A few years back, I had a quick stint as a wordpress PHP magician. The php community has a tool called php code sniffer. The wordpress community has a collection of "sniffs" (rules) to enforce coding conventions[0]. One folder of rules is called "Security"[1]. Set up a git precommit hook to run phpcs with whatever set of rules you like and it will give you a list of things you need to fix before your code can be committed. Automatically.

In the JS/webpack/react world, there's eslint. You can write custom rules to automatically check for and enforce whatever you have on your checklist.

[0]: [https://github.com/WordPress-Coding-Standards/WordPress- Codi...](https://github.com/WordPress-Coding-Standards/WordPress-Coding- Standards)

[1]: [https://github.com/WordPress-Coding-Standards/WordPress- Codi...](https://github.com/WordPress-Coding-Standards/WordPress-Coding- Standards/tree/develop/WordPress/Sniffs/Security)

</comment></comment></comment></comment></comment><comment><USER6> Gary Klein wrote a great book about how to learn from experience, based on research in naturalistic decision making, kinda stuff firefighters and NICU nurses do, but also e.g. design engineers for many decisions ([https://www.amazon.com/Power-Intuition-Feelings-Better- Decis...](https://www.amazon.com/Power-Intuition-Feelings-Better- Decisions/dp/0385502893)).

His advice for learning from mistakes is basically to look for the cues or patterns you missed that caused your mistake. That way you find the hints that would've helped you catch it in time.

I've been doing this myself, and writing up results in a weekly email ([https://codewithoutrules.com/softwareclown/](https://codewithoutrules.com/softwareclown/)) and it really improves how much I learn from mistakes. As in, I go from "well that was stupid of me" to "ohhhhh, I should've noticed _that_."

Example: early in career I submitted code with bad variable names (foo, bar) to customer who requested I write a library. She pointed that out as bad practice, I was super embarrassed over my bad code. My takeaway in one of initial emails was obvious one of "write readable code."

But later I revisited using the cues/patterns approach, and realized deeper mistake was not listening to what she wanted—in this case, source code. If deliverable wasn't source code then variable names wouldn't have mattered and it would've been fine.

<comment><USER7> "write readable code."

I think it doesn't matter if you give the source code or not, but you should allways "write readable code".

Sure there is a difference between throw away code and a library, but also for youself it is a good habit to understand later, what you have been doing. And so much more for other people ...

<comment><USER6> So, on the one hand, yes definitely.

On the other hand, it's worth digging deeper.

A lot of programming advice is these rules of thumb, and they're mostly good, but they're motivated by underlying principles (which you explain in this particular case). So it's useful to not just have these rules of thumbs, but also to dig deeper and look for underlying motivations.

</comment></comment></comment><comment><USER8> I believe my #1 defense against mistakes is the faint unease in the back of my mind that arises when I don't completely understand the problem. If I become aware of this nagging doubt, and follow it, it leads to the part I don't completely understand, where mistakes are likely. You can spend quite a long time seemingly immersed in a problem space without really understanding all of it. I think I may unconsciously flinch away from specific areas I understand least, because it's more comfortable to re-analyze the parts I have a good grasp on. I find once I understand a problem well enough that I have any business checking in code, and there's none of that nagging unease, then it's usually mostly correct.

<comment><AUTHOR> I have that "faint unease" too, i need to give it more importance.

In the beginning i learn to ignore it because the mentality of "moving fast and break things", and really worked because my tasks were fairly simple and it would have fewer critical points, but thinking now that is harmful when doing more complex things, i should slow down and trust in my 'feeling' more.

</comment></comment><comment><USER9> This may not be what you want to hear.

Making mistakes properly is progress. Make the exact same mistake multiple times? You might need to write them down as you find them.

At one startup we had a motto: Measure once, cut twice. Being fix the bug, then write code to mitigate that risk in the future. Fix it twice.

Now in critical systems like traffic lights and the like, mistakes kill people, so you test the everloving crap out of everything, then another person does, and another.

If your code doesn't kill people, ease up on yourself a bit.

<comment><AUTHOR> Thank you for your comment, sometimes im bit to hard on myself;

I can learn from my mistakes, but some of them are really trivial, i can find better examples in math, like:

In a calculus question, I need to find the volume inside some functions, this type of question is not new, i know how to solve, but somewhere deep in the calculation i change 'integral of sin' to be `cos` instead of `-cos` making the everything more hard to solve and obviously getting the wrong answer.

This kind of thing is currently my biggest problem and i cant find a real way to improve.

<comment><USER10> This is the sort of thing that reviewing other people's performance can really help with. Offer to teach classes, grade homework, or whatever.

Second thing that helps me pretty well is doublechecking through another path. You know, figure something like this out, check if the angles of the triangle still add to 180, check if substracting half the equation from the previous step still yields the same, that sort of thing. For the problem you said, find an "easy" definite integral that is easy to calculate (e.g. a sine is 180 degrees of the unit circle, so integral(0,1,x->sinx) is p/4).

So take a "trivial application" of the mathematical expression (like calculating the area of the unit circle), and execute it on every step, calculating what should be the area of the unit circle. As long as you replace expressions with equivalent expressions the outcome should stay the same.

And for coding, unit tests, but more than that, running the code, using a debugger or so.

</comment></comment></comment><comment><USER11> I have the exact same problem as you. The reason why I behave like that is always due to some sort of anxiety in finishing the task at hand, together with a flawed protocol to design and review it.

So what seems to help me is:

\- slow down, more time equals more time to think

\- write specifications as neatly as possible and review it with the requester (even if it is only your self, review it many times). The more bullet points (checks, and tasks) the better. (Come to think of it, the number of checkable bullet points in an specification may be a good proxy for how much you are thinking on corner cases and etc)

\- write extensible tests, read some nice TDD books (I haven't done that myself, but having some canon way of thinking about tests, together with reviewing tests can help you)

\- incorporate the expectation that there will be mistakes onto yourself, onto the client and into your planning

\- practice practice practice

<comment><AUTHOR> I'm gonna start writing more, i giving myself more time to code and review.

Do you have any recommendations on TDD books?

<comment><USER12> Hands down the best book. Plus the authors are really nice guys! [http://www.growing-object-oriented-software.com](http://www.growing-object- oriented-software.com)

<comment><USER13> I challenge your best book with the book of Kent Beck (founder of TDD) [https://www.amazon.co.uk/Test-Driven-Development-Addison- Wes...](https://www.amazon.co.uk/Test-Driven-Development-Addison-Wesley- Signature/dp/0321146530)

<comment><USER12> I was hoping someone would mention it! While it is a good book as well (and Kent Beck has many of them!) I tend to describe his book as 1st generation TDD. It certainly was a great breakthrough in 2002 but it misses some very good thoughts that only came later (and to give credit: probably only thanks to his book). So, GOOS for me is the 2nd generation of TDD. Especially part II is invaluable to give as a reading and thinking exercise for my new devs.

</comment></comment></comment></comment></comment><comment><USER14> In addition to what everyone else has said about just having more experience, my suggestion is slow down and think... and to use assert a lot!

I've noticed that some developers rely way too much on tools to do their job and they just don't spend a lot of time _thinking_. Think about the big picture as well as the details. Think about how your code interacts with its surroundings. Think about what you know to be true at any given line (and write an assertion), and whether or not that thing may ever change. Think about what every line means in isolation, and what it means to the surrounding code. Think about the names you give things.

Maybe it's because of my age, but when I started there were barely any tools to help. Even syntax highlighting wasn't readily available. Debuggers were pretty crap, or didn't exist at all. The best thing we could do to prevent bugs was to really question every bit of code. "What does this line do if x is not what we think it is?", "Can x ever not be what we think it is?", etc

I feel like a lot of developers today don't think enough about what they're doing, and care too much about their stack and their tools. Instead of moving fast and breaking things, perhaps instead try moving carefully, and try not to break things.

"The most effective debugging tool is still careful thought, coupled with judiciously placed print statements" \- Brian Kernighan (replace print with assert for my interpretation!)

<comment><USER15> Second on that use of assert. "Be assertive!" I always say.

Most language offer a way to run in DEBUG mode, or something like it, use that, along with assert (which only runs in DEBUG mode) to make sure all your assumptions are correct. You're positive a value can never be NULL? assert that! You're absolutely positive an integer addition will not overflow? assert that! You're absolutely sure that your super-fast table returns the same results as the complete algorithm? Run them both in debug mode and assert that!

</comment></comment><comment><USER16> Not sure if this is exactly what you have in mind, but I have had good success with my method of "learning from my bugs". Whenever I encounter a difficult bug, I write a short entry in my bugs file. I detail what happened, what I overlooked, where I should have found the bug (coding, testing). I also write down lessons learned from it, and I try to regularly review the lessons.

More info here: [https://henrikwarne.com/2016/04/28/learning-from-your- bugs/](https://henrikwarne.com/2016/04/28/learning-from-your-bugs/)

and here: [https://henrikwarne.com/2016/06/16/18-lessons- from-13-years-...](https://henrikwarne.com/2016/06/16/18-lessons- from-13-years-of-tricky-bugs/)

</comment><comment><USER17> I'm not quite sure this would apply to you, but maybe it will help someone else: Slow down! You'll likely add more value by being 10% slower with more correctness than 10% faster with more mistakes.

If you go by average time spent on a given task, I'm one of the slowest developers in my shop. I'm pretty sure I'm in the bottom 25% for speed. What I lack in speed I make up for in correctness and readability. Rarely is anything bounced back to me for a bug, defect, or missing edge case. If I start getting sloppy, I have no leverage, because now I'm one of the slowest developers who make just as many (or more) mistakes than everyone else.

Start by fully understanding the problem. If you ever have any doubts about anything, stop and ask. As you're breaking down the problem, create a set of abstract notes. You could write it in paragraph form, a set of steps with checkboxes, sticky notes[0] - whatever helps you get the problem from plain business requirements to something a bit more concrete and actionable.

Then start writing code. Try to stick finishing in the order of your notes. It doesn't have to be pretty, but make sure it works according to spec. Constantly execute your code to test, because it's possible to add a conditional that renders one of your passing scenarios as a failure. If you can get a specific lists of tests that will be ran, use that as your framework. Your number one priority would be ensuring that the entire list passes deterministically.

After you've got working code, clean it up. Make sure your variables and functions have good names. getValue() is a very generic name, while getTotalCost() indicates much more without looking at another line of code. Use a linter, formatter, and static analysis tools to search for common bugs. If there are any glaring optimizations, make them.

[0]: [https://news.ycombinator.com/item?id=16212374](https://news.ycombinator.com/item?id=16212374)

</comment><comment><USER18> One way that helps me is to read the code I wrote in several different contexts.

Most of my code reading is in my editor. I'm in a certain mode of thought there, mostly detail-oriented as I piece things together. When committing code, I use git diff to inspect everything going into the commit, making sure I agree with it. I do this in a terminal (I don't use a terminal-based editor) with a different color scheme. Lastly, I'll re-read it again (especially if I'm not 100% sure) on a web-based git server (Github/Gitlab) as a way to get some closure on the day/commit.

This works well for me because:

* Most committed code is read at least twice

* Each reading context is different, at least visually

* Time passes between each reading, which gives your brain space to surface doubts

Doubt is your friend here. With enough experience, you'll know when you've nailed something.

</comment><comment><USER19> Knowing edge/corner cases is experience based. You have to understand the business domain to really understand how those types of things come up. As a senior dev starting at a new company less than 2 years ago, I still don't recognize edge cases as often as others that have been there longer.

I would suggest checking your work might help. Put it down and do something else, then come back to it and pretend you are doing a code review of it.

When you state final quality of code, your work doesn't need to be perfect before another human looks at it. That is why we work in teams. I'm not saying be sloppy on purpose but if QA is coming up with trivial test additions, just add them. People should have feedback on code reviews.

If the mistakes you are making are trivial, we've all made them and all still make them. Syntax errors and mis-typed variables trip me up all the time. Those are usually easy to find because the code doesn't work. If the mistakes are more design related then get some software design reviews from a senior dev before going deep into having code written.

</comment><comment><USER20> 1\. run the code through a debugger as soon as you finish it;

2\. run the code and purposely try to break it with all the edge cases you can think of;

3\. run the code as if you are an end user who knows absolutely nothing about it;

4\. have your colleagues try to break your code before you commit it.

[https://wiki.illumos.org/display/illumos/On+the+Quality+Deat...](https://wiki.illumos.org/display/illumos/On+the+Quality+Death+Spiral)

[https://davepacheco.github.io/se411/release/fcs-quality- all-...](https://davepacheco.github.io/se411/release/fcs-quality-all-the- time.html)

<comment><USER21> 1.b. Not debugger, but a tool like valgrind or options like address and thread sanitizer.

2\. And 3. Does not help when you miss the edge cases.

4\. It's called code review.

And my own: run the logic through an automated theorem prover, for example Isabelle. They will instantly tell you if any invariant causes a contradiction (mistake, corner case) or it cannot deduce behaviour given prerequisites. (missing specification, probably corner case)

Since it makes you write and read the code twice and forces you to think of it as necessary conditions and invariants, that alone might help.

</comment></comment><comment><USER22> Like others said: experience. Training for a correct mindset.

For me, for basically every line of code written, and also for bigger pieces of code, I'll try to think of all possible corner cases which might prevent the the pre- and postconditions from being established. And make as few assumptions as possible.

It takes a while to develop that mindset, and it takes even longer to learn to write code which doesn't have problems in the first place. And I wouldn't even consider myself being really good at it.

Note that once you get a hold of it, you'll automatically start to write code which adheres to most 'best practices' like DRY, proper naming, short functions, you name it. These go hand in hand with fewer mistakes. In the beginning this will cost you time. But that is not wasted, as it'll teach you to do the right thing in the first place, and once you do that you'll have to spend less time debugging and the code will be clearer in the first place so less time lost reading and understanding it.

As a simple example take code from a person who does lack that mindset (despite having programmed decades more than I have) which I reviewed just today: if you just write bar[1].Foo() and don't have a strategy to either make sure bar does have enough elements, or else a strategy to properly deal with the error (as in, not just segfault, unless it has been established that is the way to deal with it) which will occur if you try to access that element anyway, the code is not good. So when I write even the simplest thing like bar[1].Foo() I _automatically_ will wonder about that, ask myself 'can this occur'? If it's supposed to never happen I'll likely insert an assert. If it can be totally acceptable, wrap it in an if statement. If it's a user error, complain. Etc. But never ever just assume it'll be ok. And to do that, realize you must always reflect about _everything_ you can think of.

</comment><comment><USER23> 1\. Have an IDE that points out the most obvious mistakes. 2\. Write test (unit and functional), when you forget about corner cases writing code in TDD style may help, because it makes you think about them before writing the actual code. 3\. Write your mistakes down and why you made them. 4\. Have githooks that prevent you from pushing code that doesn't pass test 5\. Don't feel bad about your mistakes, that's how we learn.

You mind find this interesting: [https://routley.io/tech/2017/11/23/logbook.html](https://routley.io/tech/2017/11/23/logbook.html)

</comment><comment><USER24> IMO improve in the small things. In many cases, developers take on large projects but have little opportunity to see the small things.

Pick a very small but important part to improve in. The most effective training I did for myself was to practice pressing shift, semicolons, and brackets accurately.

Wherever you have the most trouble with, narrow it down as small as possible. Practice writing tests. Practice your algorithms, or working with a very specific part of the stack. Things like Rx can be quite a lot to grasp.

It's not enough to know something once. You should be achieving fluency in all the little parts.

</comment><comment><USER25> I would like to sum up the comments + my thoughts:

1\. The more time you put on a task, more mistakes you find and fix.

2\. When finished with a task, come back to it after some time you will find more mistakes with fresh thoughts.

3\. This means you have other good qualities like imagination and creativity, which is a side effect of mistakes (internal mind random mistakes).

4\. Find mistakes ancestors - patterns - write them down in a short list, my top 10 mistakes patterns. When finished with a task review that you didn't repeat those 10 mistake patterns.

</comment><comment><USER26> I think it's something you learn the more experience you have. I think the more mistakes, errors and bugs you see through your career, the better you get at recognizing pitfalls when you write code.

Also, I'm a big fan of and practice "defensive" programming. There's lots of articles written about that, but in short it kind of changes your mindset a little and steers it towards more robust code. What can fail? How can I limit and validate parameters most efficiently?

<comment><USER21> There is defensive programming and there is bug hiding. Then there's also wasting performance in release builds.

Mixing the three is bad.

</comment></comment><comment><USER27> You already part of the way there just by asking. Wanting to get better and knowing you can learn more is the first and hardest step. I'd also suggest that you force yourself to become more introspective. When you make a silly mistake that breaks your code, spend time thinking about _why_ it broke and _why_ you didn't see it the first time. Find a mentor that is smarter and more talented. Talk to them, look at their code, etc.

</comment><comment><USER28> You say that "there is always a corner case that i don't think about or some test that is trivial to the QA team but i didn't do, and my code end up being broke". Is the corner case that you missed a technical issue or is it that the QA team has a better understanding of the business problem that is being solved and that hasn't been translated into a requirement/user story that you would even know to code against.

<comment><USER21> Also known as "lazy QA team who do not automate tests" problem. This is because testers are paid to little and writing good automated tests is about as hard as writing the tested code in the first place.

</comment></comment><comment><USER29> Make notes on paper of your mistakes. Keep them next to you.

</comment><comment><USER30> How about going easy on yourself and give it time? People, even the best of coders, make silly mistakes. No one is above that.

</comment><comment><USER31> Outside of code, I don't think there is anything with making mistakes. It's a path towards progress, learning, and growth.

It is important that you figure out _why_ the mistake was made, and _how_ to not recreate it in the future.

I tell my employees that creating 1000 individual mistakes is fine, so long as none of them are repeats.

</comment><comment><USER32> Find another developer like and try to find mistakes in his code while he tries to find mistakes in your code. Trying to find mistakes is not the same mindset as trying to produce good code. Maybe you can go as far as writing the unit test of each other. I have used this trick mainly to test GUI.

</comment><comment><USER33> If the senior developers around you are worthy of that title, they've reached that point by making more mistakes than you have - and learning from them. Here are some techniques I use to learn from mistakes:

Double-checking. To take an example: say you take the integral of `sin x` and get `cos x` instead of `-cos x`. You can double-check this by differentiating `cos x`, which will give you `-sin x`. Not only does this tell you you're slightly off, it suggests exactly how to fix the problem. Many problems can be double-checked: you get a result, then run the steps backwards to see if you can get back to the starting point.

Incremental testing. I've recently been learning basic robotics / electronics as part of a side job. One thing I found enormously helpful was to build up progressively larger circuits on a breadboard - I'd even test the breadboard itself (e.g. do the two halves of each row connect? Well, there's an easy way to find out...) to make sure I had the correct mental model of how my components were working.

Isolation. When confronted with a problem, try to find the minimal example that reproduces the problem. I do this a lot when building out interfaces / applications, where I need to add some non-trivial piece into a larger application. I'll build a test page that contains just that piece, get it working, then figure out how to integrate that working example with the application as a whole. As a side benefit, I've broken my seemingly hard problem down into two smaller, easier problems.

Informed questioning. You will inevitably hit something beyond your level of expertise. Half of experience is learning when to identify that this has happened, and knowing how to coherently explain your mental model of the problem. Your mental model doesn't have to be right, but it should exist, and you should know how to describe it to someone who can pick it apart and improve it. Part of this is a sort of "egolessness" mindset: having the humility to admit you don't understand everything, and to seek expert help once you've tried what you can. (We're all bad at this last step, myself included; developing this mindset is itself a learning process.)

Finally, and IMHO most importantly: failure normalization. Failure is normal when learning a new tool, framework, language, skillset, etc. In this situation, one of the first things I do is to explore what failure looks like. I'll deliberately introduce syntax / logic errors: what sorts of errors does the compiler / toolchain spit out? How can I use the debugger to step into the problem, and what does that process look like? Do my tools give me any kind of visual / tactile / etc. feedback on my error? (If not: where can I find better tools?)

</comment><comment><USER34> If you aren't embarrassed by the code you wrote 6 months ago, you haven't progressed enough.

<comment><USER35> Does that actually happen for really senior developers though?

<comment><USER36> I have 18 years of programming experience and it's definitely still true for me. [1] Unless I get some brain degenerative disease, I fully expect to keep improving at least until I'm 80 years old.

I've also seen this echoed by even more senior developers, e.g. this tweet by John Carmack: _It is scary to look in some old code that hasn't been touched in years, and see a completely non-thread-safe static global variable used_. [2]

\--

[1] My code quality is improving all the time. However I'm more accustomed to my emotions and fully expect progress, so I'm not exactly embarrassed.

[2] [https://twitter.com/id_aa_carmack/status/339406631613890560](https://twitter.com/id_aa_carmack/status/339406631613890560)

</comment></comment></comment><comment><USER37> Confirm results through orthogonal means where possible.

If it comes to it write two solutions (possibly one optimized, one not) that solve the same problem in different ways, and confirm the results against each other.

Don't count on just picking good edge cases.

</comment><comment><USER38> Consider adopting TDD (Test driven development). Be your own QA.

After finishing writing a functional piece of code, spend half an hour or so (maybe more?) trying to break it.

</comment><comment><USER39> Take it existential, imagine that there's more at stake than just this task, project, or your job. I'm not sure exactly what, be creative.

</comment><comment><USER40> Read these books, "Talent is overrated" & "The power of habits" & "Checklist manifesto"

</comment><comment><USER41> When typing, go more slowly.

</comment><comment><USER42> No omelette without breaking a few eggs ...

</comment><comment><USER43> make more mistakes, so you can learn from them.

</comment><comment><USER44> Checklists.

</comment><comment><USER45> How to make fewer mistakes.

<comment><USER46> > How to make fewer mistakes.

How to make _fewer_ mistakes.</comment></comment>


"Windows 10 Crush Steam Edition" Tim Sweeney - <AUTHOR> https://twitter.com/TimSweeneyEpic/status/826483594604339200 <comment><USER2> Tim Sweeney has continually dogged this line of attack against the UWP platform again and again, despite Microsoft even making changes to address his concerns.

1\. Regular Win32 software support is probably never ever going away, because it's the bedrock of the Windows platform to this day.

2\. Universal Windows Platform apps can be installed by third parties just like normal applications. Steam could support distribution of UWP apps if it chooses to.

3\. Cheapy Chrome OS alternatives aren't going to be competing with gaming PCs that are the bedrock of Steam... ever.

Tim's pretty much flat-out refused to recognize these facts, and has been scare-mongering this point since Windows 10 came out or before.

UWP being a sandboxed app platform is just "better" than the legacy software design from a security standpoint. Nothing about UWP inherently makes it lock out third party distributors, it's just that nobody else has chosen to distribute them yet.

<comment><USER3> > UWP being a sandboxed app platform is just "better" than the legacy software > design from a security standpoint.

In the same way that a car filled with concrete is better from a security standpoint. But in both cases you've limited it in practice. The fact is developers are ignoring windows store because it's far too limited.

<comment><USER2> There are cases where it works and makes sense, and cases where it doesn't. UWP makes the most sense for something self-contained, that doesn't need to modify other parts of the system as a basis of it's operation. (Games actually make great UWP apps for this reason!)

The other half of this is that since UWP apps are generally so safe, I can tell people if they want games for their Windows PCs... they can probably safely install anything on the Windows Store. Whereas telling people they can install any Windows software they find online would be quite the opposite.

The fact that UWP apps will never meet all possible needs for software is a big part of why Tim Sweeney's claims are so ridiculous: Non-UWP software is never going to fully go away.</comment></comment></comment>


Ask HN: I am late for the crypto currency boom, what are my options? - <AUTHOR> Hi everyone,<p>I was "stuck" in the Life Science landscape for <comment><USER2> No one can give you a definitive answer to that question.

If there's a global economic breakdown or catastrophe of a large magnitude, cryptocurrencies would surge in value. If you check the Google Trends for Ethereum and other cryptocurrencies you'd notice how high Venezuela is ranked.

In any other situation the only way cryptocurrencies could substantially increase their market cap would be if there's mainstream adoption of it. We don't seem to be very close to it at this stage, however if you personally have confidence in this mainstream adoption sometime in the future then buying some cryptocurrencies may be an informed speculative bet on your end.

(Please don't make financial decisions based solely on anything I have mentioned)</comment>


EFF's 2011 Holiday Wish List - <AUTHOR> https://www.eff.org/deeplinks/2011/12/effs-holiday-wish-list <comment><USER2> Not a security expert here but it seem like akamai should also be required to use a root CA that does not use md5 for it's encryption. It am under the impression that md5 based encryption has been broken since 2008: <http://www.win.tue.nl/hashclash/rogue-ca/#sec71>

<comment><USER3> MD5 is not an encryption algorithm. It is a hashing algorithm. You're right though, it is broken.

<comment><USER4> The authentication is based on encrypting said hash, so I would say that md5-based is good enough as a description.

</comment></comment></comment><comment><USER5> Regarding "All software downloads should be provided only over HTTPS", this is very expensive to provide, but is allowing users to compare a checksum an equally secure option?

<comment><USER6> What's to stop someone in the middle changing the checksum on the page?

<comment><USER7> The download page could still be served via HTTPS, even if the download itself isn't.

</comment></comment></comment><comment><USER8> Must be cool for Colin to have Tarsnap featured there ( _as secure backup provider Tarsnap puts it, "[b]ackups are supposed to be a tool for mitigating damage — not a potential vulnerability to worry about!"_ )</comment>


'Helicopter money' might help U.S. economy - <AUTHOR> http://mobile.reuters.com/article/idUSKCN0VR0EH <comment><USER2> The State of Alaska does something very similar with the annual Permanent Fund Dividend (usually in the $1000-2000 range, direct payout to each resident).

It certainly does create a boost in consumer spending.</comment>


U.S. widens trade blacklist to include some of China's top AI startups - <AUTHOR> https://www.reuters.com/article/us-usa-trade-china-exclusive/u-s-expands-blacklist-to-include-chinas-top-ai-startups-ahead-of-trade-talks-idUSKBN1WM25M <comment><USER2> I guess I am a somewhat neutral bystander here. I'm from India and the way I see it, these sorts of actions, will simply force China and Chinese companies to develop alternatives to US products. For the short to medium term these blacklists will hurt Chinese companies severely, perhaps even put some of them out of business. However, in the long term 15-20 years, I would imagine, China would have fully caught up with the US particularly on semiconductor design and fabrication. Once that happens, the dominance of the US tech stack will start to falter and eventually erode away. If I were the US govt., I would invest every available dollar and minute on building up a technological lead, because, oh boy it is going to need every last bit of advantage it can get. And even that may not be enough.

For the world, this may not be a terrible outcome, (although don't get me wrong -- no trade war would be the best outcome.) . For one thing, it breaks monopolies across the tech stack from E-commerce all the way to semi-conductor manufacturing equipment. That competition between US and Chinese companies can only benefit the world. It's happening in 5G already.

<comment><USER3> "However, in the long term 15-20 years, I would imagine, China would have fully caught up with the US particularly on semiconductor design and fabrication. Once that happens, the dominance of the US tech stack will start to falter and eventually erode away. "

Are you assuming the U.S. will sit stagnant during these 15-20 years? If China is 15-20 years behind currently, I doubt they will ever be at parity. Their best hope is a cultural revolution.

<comment><USER4> US was already shown to be behind in 5g, China is already caught up. Heck they even helped AMD catch up to Intel, and see what sort of major success that was ( [https://en.wikipedia.org/wiki/AMD%E2%80%93Chinese_joint_vent...](https://en.wikipedia.org/wiki/AMD%E2%80%93Chinese_joint_venture) ) . These moves are there to slow it down. But China can make other moves like moving tech knowledge from one company to others and play all sorts of games. Fact is knowledge despite what Americans want the world to believe, replicates and distributes powers in ways which are very difficult to stop. If China is not building it, they will move the knowledge to some ally which can build it. It's almost guaranteed at this point that we are already living in a bifurcated world where US will need to manufacture everything in other countries than China. And yet China's manufacturing edge is not going anywhere. They can clone any US product anyone else is producing and sell it to their trading bloc.

<comment><USER3> "US was already shown to be behind in 5g, China is already caught up."

So the mainstream media and politicians would have us believe.

"Heck they even helped AMD catch up to Intel, and see what sort of major success that was ( [https://en.wikipedia.org/wiki/AMD%E2%80%93Chinese_joint_vent...](https://en.wikipedia.org/wiki/AMD%E2%80%93Chinese_joint_vent..). ) "

All I see here is an agreement for AMD to transfer technology to China, for x86 chips destined for chinese-only server market. Further, that agreement appears stalled, since AMD will NOT transfer their Zen2 technologies in this agreement. [https://www.tomshardware.com/news/amd-zen-china-x86-ip- licen...](https://www.tomshardware.com/news/amd-zen-china-x86-ip- license,39573.html)

"And yet China's manufacturing edge is not going anywhere. They can clone any US product anyone else is producing and sell it to their trading bloc."

More like their manufacturing may not be going anywhere...their market has been shrinking by leaps and bounds.

[https://en.wikipedia.org/wiki/5G#Surveillance_concerns](https://en.wikipedia.org/wiki/5G#Surveillance_concerns)

[https://en.wikipedia.org/wiki/Concerns_over_Chinese_involvem...](https://en.wikipedia.org/wiki/Concerns_over_Chinese_involvement_in_5G_wireless_networks)

They can have Iran, AFAIC.

<comment><USER5> I don't know but from a science point of view all our last research are based on paper coming from people at China companies (Alibaba, Tencent), that currently have the edge in our specific domain (machine learning). So yes in domains that mainly require your brain they have caught up if not ahead.

<comment><USER6> Machine learning is a wide field. Could you give some examples of research you've done based on papers that came out of Alibaba, Tencent, etc.? I'm curious.

<comment><USER5> of course ML is a wide field but for instance these paper were quite relevant to our work:

* [https://arxiv.org/pdf/1802.03903.pdf](https://arxiv.org/pdf/1802.03903.pdf) * [https://ieeexplore.ieee.org/document/8710885](https://ieeexplore.ieee.org/document/8710885) but they are numerous, and the work done at Tsinghua University is very interesting

By the way down voting a comment based on facts is rather silly...

<comment><USER6> Thanks for the links.

By the way, the site guidelines exhort us to

 _Please don 't comment about the voting on comments. It never does any good, and it makes boring reading._

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER7> One thing that I really like about the Trump administration is that finally the WH has decided to act against the systemic threat posed by China.

Can someone who is well versed in politics shed some light on if this is a trump specific phenonemon or had there been a sea change and the dems are now on board too ?

<comment><USER8> Obama was manufacturing the pivot to Asia. The TTP would have given a lot of power to corporations to combat China. This presents its own set of problems though.

Clinton was adamant that her grandchildren would not be speaking Chinese.

China has been acknowledged as a threat since 2008 really, by everyone really, just, sometimes people need a very visual and visceral demonstration of action (no matter how less-optimal it actually is). Surely some business people in here can relate to that sentiment?

<comment><USER9> From what I understand many corporate victims of Chinese industrial espionage since 2008 specifically declined to pursue prosecution for fear of what it would do to their existing or potential for business with Chinese entities and individuals.[0]

And this was despite a Justice Department that was chomping at the bit to prosecute Chinese industrial espionage. I bring this up because I think this shows why leaving weighty matters involving the security and future of your country up to corporations is a poor idea, especially when corporations are motivated solely by profit as corporatists gleefully remind us at all times.

[0][https://www.npr.org/2019/04/12/711779130/as-china-hacked- u-s...](https://www.npr.org/2019/04/12/711779130/as-china-hacked-u-s- businesses-turned-a-blind-eye)

<comment><USER8> Do you think the TPP was a response to this fear? Genuine question here.

</comment></comment></comment></comment><comment><USER10> "In other news, US IoT botnet activity down 75% after shipments of Hikvision cameras stopped by customs..."

</comment><comment><USER11> Wow, interesting to see Hikvision on this list, I own several of their cameras (and keep them isolated on a separate VLAN), but once you know them, you see them everywhere, they have a huge hold in the video surveillance market. Wonder if their main Chinese competitor, Dahua will pick up their market share in the US or if there's a more local competitor.

Huawei's HiSilicon fab makes purpose built ICs for these things, I've dumped the firmware for some whitebox ones done by a local tech retailer, but they were still heavily reliant on those ICs. Will be very interesting to see what happens in that market if this persists for long.

<comment><USER12> I procure cameras for some systems development we are doing for the DoD. Hikvision and Dahua are both specifically banned by law. The number of American companies simply rebranding banned cameras and stamping "Manufactured in America" on them was a bit of a shock.

<comment><USER13> Any non Chinese manufacturers you can recommend?

<comment><USER12> Try:

[https://www.pelco.com/ndaa](https://www.pelco.com/ndaa)

[https://www.securitysales.com/surveillance/honeywell-30-seri...](https://www.securitysales.com/surveillance/honeywell-30-series- cameras/)

Careful with the Honeywell stuff. They are a "rebrander". However, the 30 series cameras claim to be compliant.

Here's an interesting article about the Army getting caught up in that trap:

[https://ipvm.com/reports/gordon-honeywell](https://ipvm.com/reports/gordon- honeywell)

Look for NDAA Section 889 compliance when searching.

</comment></comment></comment></comment><comment><USER14> [https://s3.amazonaws.com/public- inspection.federalregister.g...](https://s3.amazonaws.com/public- inspection.federalregister.gov/2019-22210.pdf)

Actual ban document.

</comment><comment><USER15> SenseTime was founded by an MIT grad and has joint AI research partnership with MIT[0]. It will be interesting what this blacklist means for these kinds of collaborations.

[0] [https://news.mit.edu/2018/mit-sensetime-announce-effort- adva...](https://news.mit.edu/2018/mit-sensetime-announce-effort-advance- artificial-intelligence-research-0228)

<comment><USER16> But he's also part of the controversial "Thousand Talents Program" [0] (link in Chinese) that is being closely watched by the US [1]. Not surprised at all about the blacklist.

[0] [https://baike.baidu.com/item/%E6%B1%A4%E6%99%93%E9%B8%A5](https://baike.baidu.com/item/%E6%B1%A4%E6%99%93%E9%B8%A5) [1] [https://www.japantimes.co.jp/news/2019/07/24/business/fbi-10...](https://www.japantimes.co.jp/news/2019/07/24/business/fbi-1000-probes- ongoing-chinese-intellectual-property-theft/)

</comment></comment><comment><USER17> The US claims that this blacklisting is unrelated to trade negotiations, but one has to wonder -- why did we wait until now?

And if this is just a way to create leverage during trade negotiations, how would the administration gracefully reverse these blacklisting actions in exchange for something unrelated without it being patently clear that this was never about human rights?

<comment><USER18> Agreed. Clearly a negotiation tactic. I expect nothing material to come out of the upcoming meeting. I work in public equities and this has been such an ongoing headache... anyone remember when a full deal was supposed to get done by end of March 2019?

What a joke...

<comment><USER13> And what, making a Uyghur American the National Security Council's China director also a negotiation tactic? Anyone in equities who believes that there will be a deal isn't paying attention.

<comment><USER19> phyek just said "I expect nothing material", so obviously is not expecting a deal.

</comment></comment></comment></comment><comment><USER20> Has this kind of strategy ever worked, in trade negotiations? It seems about as likely to be effective as a bombing campaign: It'll reduce the other side's effectiveness, but from a negotiation perspective it'll only cause them to dig in harder.

<comment><USER21> China doesn't want a deal. They only want to continue to exploit the US. So the US is gradually decoupling from them.

<comment><USER22> "Exploit the US" by providing cheap labor to US firms? It's scary to see jingoistic rhetoric spreading on HN. China is the new enemy du jour, and lots of people here seem to be itching for a conflict.

<comment><USER23> The tables are fundamentally imbalanced now, I see nothing wrong with the US attempting to finally start addressing the issue. The fact that US companies have been exploiting that imbalance to pursue cheap labor is irrelevant to the conversation.

</comment></comment></comment></comment><comment><USER24> So far, china has only retaliated defensively against the us. I wonder what will happen when china decides to go on the offensive the same way the us has and hit were it really hurts? What will happen if they cut off the us entirely and force asian countries to cease trading with it (i.e. using the same strategies used to isolate iran or turkey).

Successful military intervention is unlikely since china is a nuclear superpower with a strong army and an even stronger industrial backbone. They're not some defenseless third-world shithole.

I can't imagine it being long now, but china will eventually get to the tipping point were things start to go downhill for them. I bet china won't let it get to that point without retaliating for it's destroyed economy by thoroughly destroying the us economy while it still can.

I think we'll soon be seeing humanity's first economical MAD event.

<comment><USER25> > What will happen if they cut off the us entirely and force asian countries > to cease trading with it

What happens when we do it to them?

China is powerful, sure. But they aren't more powerful than the western world. We'll win that fight. (Well, by "win" I mean suffer less damages).

Western companies are also already pretty cut off from the Chinese market. Cutting them off even more so is unlikely to have as huge if an impact as people are predicting.

<comment><USER26> Nah this is not true, we actually sell more stuff to China than the other way around. They've just not yet really tried to retaliate. [https://www.bloomberg.com/news/articles/2018-06-12/the-1-4-t...](https://www.bloomberg.com/news/articles/2018-06-12/the-1-4-trillion- u-s-surplus-that-trump-s-not-talking-about) Tariffs hurt yourself first before anyone else. But if shit really hits the fan they no doubt will.

<comment><USER25> > They've just not yet really tried to retaliate.

You seem to be pretty uninformed on the matter. It is common knowledge that it is extremely difficult for Western companies to operate in China.

This "retaliation" has been going on for decades. China can't really make it much worse than what they have already been doing for decades.

<comment><USER22> You're constructing a narrative that puts history on its head. China has allowed foreign firms to come in and exploit cheap Chinese labor. Foreign companies have made enormous profits off of this. Not only do companies like Apple benefit hugely from Chinese labor, but they have also found a market of hundreds of millions of buyers of their product there. Foreign auto manufacturers dominate the Chinese domestic market - VW is the best-selling car brand in China, the world's largest auto market.

You're saying that China has been retaliating by giving foreign companies access to cheap labor and hundreds of millions of customers. That's completely backwards.

</comment></comment></comment></comment></comment><comment><USER27> Wouldn't be more effective to target parts of their economy that hurts they're most vulnerable members of society and spread from there? They could potentially start a mainland revolt really forcing their hand.

</comment><comment><USER28> Doesn't the trade war actually benefit all involved countries?

This could just be a hidden deal between governments to massively increase the tax income under the cover of a trade war.

</comment><comment><USER29> Using political means instead of fair competition in the market is not only showing the hegemony of the US, but also showing that the US technology is not confident.

</comment><comment><USER30> Samaritan targets AI startups.

</comment><comment><USER31> I wonder how many of you actually have been to China and spent sometime there?

</comment><comment><USER32> I wonder how much worse this is for US vendors, than it is for China?

</comment><comment><USER33> if US wants to put pressure on and punish China, then instead of shooting itself in the foot and everywhere else with tariffs US could have just offered say 10K Green Cards (each coming with $1M resettlement bonus) to the top China researchers&engineers in any industry in China that US would want to cripple as a punishment. At $1M per such a top head it would be a steal for US, and for China it would be a very painful damage. Rinse and repeat ... (Such a solution comes to my mind as result of observing of pitiful state of Russia resulting from the brain-drain (immigration as well as just tech heads switching away into business/etc) it suffered especially during 199x)

<comment><USER34> I love this idea; it plays strongly into American strengths.

However, I don't know if China would be more successful in convincing it's top talent to stay with their families, and I have no idea how to sell this idea politically to American voters. The stereotype of Chinese culture is that they tend to be more collectivist, and the stereotype of the general population of American voters would most likely rather spend any money on Americans first. For the later problem, it is hard to articulate concisely the roundabout way this ends up causing brain drain, and the eventual benefits to the US citizenry. It is much easier to sell "China did something bad, we will punish them with tariffs" than "Chinese government bad, we will pay top Chinese citizens to defect."

<comment><USER35> We were basically doing that via universities until the anti-Chinese sentiment shot up drastically in the past few years.

You can't turn the clock back. The anti-Chinese sentiment is very high now in America.

<comment><USER34> I think it's certainly possible for a gifted politician to make the distinction of Chinese people != Chinese government party. Not so much "turning the clock back" as directing any anti Chinese sentiment.

</comment></comment></comment></comment><comment><USER36> If you really want the Palantir of the Chinese, check out Novogene. Then ask yourself why they have a CLIA- and CAP-approved lab in Sacramento. Then ask yourself, what shameless, desperate, or just clueless physicians and researchers are allowing their patients' genomes to be sequenced by an asset of the Chinese Communist Party.

[https://en.novogene.com/technology/quality-control/lab- certi...](https://en.novogene.com/technology/quality-control/lab- certifications/)

[https://www.linkedin.com/company/novogene- corporation](https://www.linkedin.com/company/novogene-corporation)

[https://www.glassdoor.com/Reviews/Novogene- Reviews-E1790104....](https://www.glassdoor.com/Reviews/Novogene- Reviews-E1790104.htm)

<comment><USER26> As far as I can see everyone of importance is Chinese, the locals are all sales and admin?

</comment></comment><comment><USER37> Legitimate question: at what point does censorship become something more benign such as blacklist or sanctions? If we do it?

<comment><USER38> Censor: Highly targeted and specific, usually along the lines of communication. Like Xi and Winnie the Pooh. The US doesn't censor(?)

Blacklist: Broader, usually applied to products and companies. China blacklisted Facebook. The US blacklisted Huawei.

<comment><USER39> Every state censors things in some way, he difference is what is censored and how much impact it has obviously.

Censorship can also describe private actions such as Twitter/Facebook refusing some ideas, and is that case is vastly vastly present in every country.

<comment><USER40> > Censorship can also describe private actions such as Twitter/Facebook > refusing some ideas,

That's only true in the vernacular. True "censorship" is only relevant to government suppression. Individuals or private corporations are under no legal obligation to _allow_ certain ideas/topics.

*That is to say, I could perfectly well create some new social network messaging app that specifically does not allow any posts about honeybees, screwdrivers, or Turkey. The government could not prohibit those topics.

<comment><USER41> > Individuals or private corporations are under no legal obligation to allow > certain ideas/topics.

(Though it does become problematic as communication channels are concentrated in a few parties hands, which is why, in part, we have things like the common carrier doctrine. In the end, if one party accumulates enough power and uses it in a way that it is oppressive, whether that party is a government, a warlord, or a corporation).

</comment></comment></comment></comment></comment><comment><USER42> South Park episode and NBA fiasco made it possible for the public to be grateful for the move.

Or maybe it was planned to happen before another round of negotiations and the timing is a... coincidence? Hard to believe in these anymore.

<comment><USER39> I do not think this is a coincidence that tension between the US and China raises every time Trump has political issues, just like Russia suddenly finds ennemies when Putin faces discontent, or that Turkey fights kurds 10 times stronger when Erdogan feels threatened.

Pointing an ennemy is a great way to get away with many things, and works very well with all kinds of publics.

<comment><USER43> Obviously he wants to finish a deal w/ China before the elections so he can use it as an example. Not everything is a conspiracy.

Not to mention he seems to permanently be in a state of political crisis with his adversaries in the US. They've been rattling the impeachment sword since he got in power.

<comment><USER13> There will be no trade deal and this is not merely a trade war. We are in a new cold war.

</comment></comment></comment></comment><comment><USER44> The art of caption…

> [..] some of China's top artificial intelligence startups, punishing Beijing > for its treatment of Muslim minorities [..]

> The decision, which drew a sharp rebuke from Beijing, targets 20 Chinese > public security bureaus and eight companies including video surveillance > firm Hikvision, as well as leaders in facial recognition technology > SenseTime Group Ltd and Megvii Technology Ltd.

So Chinese palantirs get blacklisted, boo-f-hoo.

<comment> toby- I'm confused what point you're making, here? Not trying to be rude, I'm just unsure of your position. Are you implying this wasn't 'punishment' over China's treatment of Muslims? Or something else? Or am I misreading completely?

<comment><USER45> They likely mean since the list of blacklisted startups heavily (?) features surveillance companies, this whole situation is no big loss to anyone (presumbaly, the regular westerners as well as Chinese citizenry) as surveillance = absence of privacy = Orwellian = no bueno.

<comment> toby- Ahh, now I understand. That's the more sensible interpretation. Thanks.

</comment></comment></comment></comment><comment><USER46> Given the enormity of their population, one would expect they would have managed to come up with _something_. Honestly the world would be a far, far better place if the entire Chinese nation were to disappear off the surface of the earth.

(Edit: since Chinese trolls have been down voting me, I will reply here to the comment below: clearly by the Chinese nation I was talking about the 1.3 billion in China. There shouldn't be any moral qualms in _their_ case. Enlightened people and brainwashed people are not moral equals, just as humans and chickens are not)

<comment><USER14> >the world would be a far, far better place if the entire Chinese nation were to disappear off the surface of the earth.

Really? I find this argument hard to believe.

Also this is what I worry about. The US China conflict has a real likelihood of becoming a full on race war against Chinese people in America, thanks to sentiments like the one above.

<comment><USER47> I appreciate the mildness of your response to that provocation, but it's a garden variety troll whom we've banned many times. Please just flag and move on.

<comment><USER14> I can't flag comments for some reason. Is there JS I need to load?

<comment><USER47> For comments, you have to go to where the flag link appears. Please see [https://news.ycombinator.com/newsfaq.html#cflag](https://news.ycombinator.com/newsfaq.html#cflag).

It's done that way as a speed bump to discourage reflexive flagging. An old PG trick.

</comment></comment></comment></comment></comment><comment><USER48> Have any other candidates expressed support for hardline Chinese policies? Trump easily has 4 more years, but I'm not sure who can successfully keep this going after that. I haven't paid much attention to the field, but I haven't seen any news on anyone else making statements on the topic.

<comment><USER49> > Easily 4 more years.

What planet do you live on?

<comment><USER50> Myself, the planet where a president with a stronger stock market and unemployment than when he entered ~always gets re-elected.

<comment><USER51> Maybe, you know, look at the stock market to see if that's true, instead of just believing Trump's tweets about it...

<comment><USER52> You should probably look yourself. From what I've been reading from financial postings, the Trump administration has done many good things for the stock market (for the people however is a different story)

Usually whoever keeps the economy going and doesn't harm it in anyway gets re- elected for a second term.

<comment><USER51> Please.. just go look.

Since his inauguration, the S&P500 is up 27.37%. At this point during Obama's first term, the S&P500 was up 65.19%. Apples and oranges, true. Let's look at the preceding 46 months before Trump's inauguration. Over that time, the market rose 26.69%.

Anyone pretending the market under Trump is anything but "normal" is participating in partisan hackery. Don't do it.

<comment><USER50> You're mental if you think that this is normal. We've been on a huge bull market since 2008. It's not due to Obama or Trump but Obama got credit and got re-elected and the same will happen with Trump.

<comment><USER51> What's the average annual return of the DOW since its inception? What's the average annual return been since Trump's inauguration?

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER53> I thought that "blacklist" was deprecated and that "denylist" or "blocklist" were appropriate usages?

[https://developers.google.com/style/word- list#letter-B](https://developers.google.com/style/word-list#letter-B)

<comment><USER54> You're racist for thinking that the word "black" used to refer to something as bad is at all related to dark skinned people.</comment></comment>


Ask HN: Clojure best practice for web applications? - <AUTHOR>

Does anybody here have experience building a web application using Clojure?
I would like to be able to set up a mysql driven web application using clojure as the language to build it in, but I don't know where to begin to look for the 'best of breed' components to do this with.
This is my first foray in to the big and scary world of functional programming, a trial project to be followed by a much larger one.
Any pointers in the right direction would be greatly appreciated. <comment><USER2> Compojure is a good bet for clojure web applications.

To get you started, have a look at the source for clojars and briancarpers cow-blog.

<http://github.com/ato/clojars-web> <http://github.com/briancarper/cow-blog>

Brian Carper has a load of information about using compojure on his site (<http://briancarper.net>). In particular interest are:

compojure to the rescue: [http://briancarper.net/blog/clojure-and-compojure- to-the-res...](http://briancarper.net/blog/clojure-and-compojure-to-the- rescue-again)

deploying clojure sites <http://briancarper.net/blog/deploying-clojure- websites>

</comment><comment><USER3> I wrote a website on Google App Engine using Clojure. I used compojure and some Java library for OpenID. My database was (naturally) Google Datastore for which I had a custom wrapper based on <http://github.com/duelinmarkers/appengine-clj/tree/master>. I'm not giving the link, because it's all in Czech, so it would be no use for you :)

It was a nice experience, functional programming fits well to website programming (the response is a function of the request and data in the database).

For debugging/development purposes I strongy recommend to reload the code on each request using load-file. Restarting the server every time a change is made is unbearable.

</comment><comment><USER4> Use compojure and clojure commons. You might want to use leiningen too. It is definately worth really checking out the clojure commons thoroughly before you start looking for other software packages, you'll have something to judge them against. For my own purpouses I've found the database bindings in commons good enough, and there's tons of cool stuf in commons that I would like to play with.

<comment><USER5> I tried a Google search for clojure commons, and your post here was the third result. Maybe you meant clojure contrib?

I wrote a small Compojure application about a week ago. It's only an afternoon's worth of work, plus some cleaning up later, so should also be easy for a newcomer to digest.

The source code is here: <http://github.com/ericlavigne/island-wari>

You can try out the application here: <http://ericlavigne.net:8054>

<comment><AUTHOR> Very neat. Can I use your code to jump off from ?

<comment><USER5> Do whatever you want with it. I hope you enjoy Clojure - I certainly have.

<comment><AUTHOR> Ok, thank you very much, I will definitely credit you in whatever I derive from it.

</comment></comment></comment></comment></comment><comment><USER6> Two hours old (albeit on a Sunday), and the only thing in this post is the sound of crickets chirping.

I have been learning Clojure, and the lack of responses is a bit of a surprise.

Perhaps #clojure on freenode will get more responses?

</comment><comment><AUTHOR> thank you all! More reading to do :)</comment>


Sleeper spaceship could carry first humans to Mars in hibernation state - <AUTHOR> http://edition.cnn.com/2014/10/07/tech/innovation/mars-hibernation-flight/

<comment><USER2> I doubt it. First, improvements to thrusters will sooner lead to shorter trips. Secondly, if we build ships in space instead of on the ground we can build much better and larger ships and can accommodate the journey.

And we should get started pronto.</comment>


Complicated patterns aren't always that complicated. Usually it's the "simple" - <AUTHOR> https://hackernoon.com/complicated-patterns-arent-always-that-complicated-usually-it-s-the-simple-ones-that-bite-you-caf870f2bf03 <comment><AUTHOR> Complicated patterns aren't always that complicated. Usually it's the "simple" ones that bite you.

A story of how a codebase became complicated while intending the opposite, the importance of language, and examples of EventSourcing/DDD with the Repository Pattern for Node.js!</comment>


Reasons to use dot graphs - <AUTHOR> http://www.maartenlambrechts.be/to-the-point-7-reasons-you-should-use-dot-graphs/

<comment><USER2> While doing scientific research I usually just use scatter plots. If you summarise things into statistics it's too easy to miss things. However, some of those plots were unreadable -- what the hell do the colours mean in that unemployment rates graph?

<comment><USER3> Yes, the missing legend doesn't help readability unless you're familiar with Eurostat dataset terminology. Actually, that's total unemployment rate for >15y at a regional level. Ignore the sex and age part - it's the total number here. Colors stand for magnitude of total unemployment in a given region.

Here's the original version of the graph from Eurostat: [http://ec.europa.eu/eurostat/cache/RSI/#?vis=nuts2.labourmar...](http://ec.europa.eu/eurostat/cache/RSI/#?vis=nuts2.labourmarket)

</comment></comment><comment><USER4> Strongly disagree with replacing bar charts by scattered points with arbitrary position on the horizontal axis (2 and 3). It is very difficult to disassociate horizontal proximity from vertical proximity, and the former is meaningless and distracting here.

<comment><USER5> Strongly disagree with your disagreement. The scattered points are very readable. They present more data, data that's simply missing from the bar charts. I always feel a little bit bad presenting, say, just a box and whisker plot when the original data is so much richer.

</comment></comment><comment><USER6> It's a very important message. We, humans, are great at aggregating visual patterns. So, most of the time, it makes sense to show raw data (and we can make our own conclusions/observations) rather than aggregate it to much (there is no possibility to go the other way).

</comment><comment><USER7> As someone who works with data, this makes a lot of sense.

I challenge the applicability to people who do not. It is difficult for significant parts of the population to digest simplified data (or file their taxes). Reducing information density by turning dots into a histogram makes it easier to consume (and hide the weaknesses in your paper).

This brings us back to the challenge of accessibility of published papers vs scientific reporting.

I would suggest working in dots and including them as appendices, but producing simplified (honest) visualizations to reach a greater audience.

</comment><comment><USER8> Hey if the author reads this nice article! On my iPhone 5S running the latest iOS (8.3) and using Safari the pictures seem to cut off a bit. It might be worth checking out if you're interested.

I enjoyed checking out the different uses of dots though. After the semester and once my blogs up I hope to do some data projects so it will be fun to work with different ways of displaying some of the information that comes out.</comment>


Bernie Sanders and His Critics Should Know Why Norway Works - <AUTHOR> http://evonomics.com/bernie-sanders-critics-know-norway-success/ <comment><USER2> It works for some things... It doesn't for others, but there's a lot more social justice than in many other places</comment>


How to use Google AdSense Ads on Responsive Websites - <AUTHOR> http://www.labnol.org/internet/google-adsense-responsive-design/25252/

<comment><USER2> _this shouldn't be against AdSense TOS in my opinion since we aren't resizing the ads or modifying the JavaScript code..._

Until Google themselves come out and recommend a method, I'm not risking my entire Google account on a should or shouldn't. I've read the TOS a while back and changing an ad after it has been loaded or using js is pretty forbidden.

<comment><USER3> As far as I understand, this will just set ad options dynamically, before the ad is loaded.

This is why it is not connected with window.onresize event, the ad is loaded just once and do not change.

<comment><USER2> from [http://support.google.com/adsense/bin/answer.py?hl=en&an...](http://support.google.com/adsense/bin/answer.py?hl=en&answer=48182)

 _Ad behavior AdSense code may not be altered, nor may the standard behavior, targeting or delivery of ads be manipulated in any way that is not explicitly permitted by Google. This includes but is not limited to the following: clicking Google ads may not result in a new browser window being launched, nor may Google ads be placed in an IFRAME._

If you ask me, loading different units through conditionals qualifies as altered. Good way to get hit with the No Explanation Ban Hammer.

<comment><USER3> And what if you do it server side (using user-agent and other info get before with javascript)? The ad placement is not altered, and it is not adsense code that is changed in any way.

I understand you want to underline the risks. It is possible Google uses some automated site code screening which will flag this for a ban. Even than, doing it server site must be completely legit.

<comment><USER2> We're not talking mobile vs. desktop, we're talking responsive layout controlled by media queries, which can't be determined until the code hits the browser and your js (Modernizr or similar) measures the window. UA measures the screen size, not the window size. Not to mention that in theory, you would only load one size, but changing the orientation of a device or resizing your desktop browser window can trigger another breakpoint and essentially hide your ad, making the whole exercise pointless. And yes, the main point is always act in fear of Google, until they announce responsive ads.

</comment></comment></comment></comment></comment><comment><USER4> I would stay clear from anything that manipulates adsense code.

Google suspended my adsense account for a technique which Google approved / suggested in their support forums.

<comment><USER5> I would just stay clear of AdSense, period. Not that I have much of a choice ever since they randomly decided I was committing click-fraud (I wasn't) a few years back and banned me.

<comment><USER6> I had the exact same situation, click-fraud out of the blue. You can find many such cases reported. I strongly believe that AdSense for small, powerless publishers is a scam. Google can do whatever it likes with your ad space and cut you off whenever.

</comment></comment></comment><comment><USER7> I'd recommend wrapping this with inside of window.onresize as well.</comment>


Head Wounds and Steel Helmets - <AUTHOR> https://www.historicalfirearms.info/post/185622315174/historicalfirearms-head-wounds-steel-helmets <comment><USER3> It reminded me of this funny "paradox" : [https://www.youtube.com/watch?v=1IQE0uZUMys](https://www.youtube.com/watch?v=1IQE0uZUMys) TLDW : In WW1, after being issued helmets, the number of head injuries for soldiers rose significantly.

<comment><USER4> It's like the old story about when airbags (or was it seatbelts?) became mandatory, serious injuries from car crashes became much more common - <USER2> many more people were surviving serious crashes and being counted as injured, not killed.

<comment><USER5> These both seem illogically logical, kind of like the other story about an engineer who figured out where to armor aircraft by looking at the ones that came back -- he armored the places that were never shot up.

<comment><USER6> More info:

>Blackett's team made the logical recommendation that the armour be placed in the areas which were completely untouched by damage in the bombers which returned. They reasoned that the survey was biased, since it only included aircraft that returned to Britain. The areas untouched in returning aircraft were probably vital areas, which, if hit, would result in the loss of the aircraft.

[https://en.wikipedia.org/wiki/Operations_research#Second_Wor...](https://en.wikipedia.org/wiki/Operations_research#Second_World_War)

<comment><USER7> I've heard it many times, and it's great, but I think it must not be true. Planes had hardly any armor at all and all I've ever seen was put in very logical places. Protect the engines, fuel, pilot, and other crew.

It's not like they welded a piece of steel into a random place on the hull because they'd never seen it get hit before.

<comment><USER8> Whilst it may not have been Blackett or his team doing the research, research in this area does seem to have been done(1), and there are books and papers written about it(2). 1- [https://www.lesswrong.com/posts/kyZgEKzZZtJQTCSG2/examine- yo...](https://www.lesswrong.com/posts/kyZgEKzZZtJQTCSG2/examine-your- assumptions) 2 - [https://people.ucsc.edu/~msmangel/Wald.pdf](https://people.ucsc.edu/~msmangel/Wald.pdf)

</comment></comment></comment></comment></comment></comment><comment> who-knows95 this reminds me of ~~ [https://www.napoleon.org/en/history-of-the-two- empires/objec...](https://www.napoleon.org/en/history-of-the-two- empires/objects/carabiniers-breastplate-from-the-waterloo-battlefield/)

</comment><comment><USER9> NOT FOUND

The URL you requested could not be found.

<comment><USER10> I got that too, seems to be working at [https://www.historicalfirearms.info/post/185618493489/head-w...](https://www.historicalfirearms.info/post/185618493489/head- wounds-steel-helmets-in-the-march-1943)</comment></comment>


Show HN: Copy/Paste for Jira tickets - <AUTHOR> https://chrome.google.com/webstore/detail/jira-copy-paste/cadnjkpcmmnhfbildhaandnhbghfgcid?hl=en <comment><AUTHOR> Hello HN! I made a tool to help me fill out my daily standup faster and easily send lists of Jira tickets to my co-workers.

Let me know if you find this helpful too or have any ideas :)</comment>


"TPP Is the Most Brazen Corporate Power Grab in American History" - <AUTHOR> http://www.alternet.org/economy/chris-hedges-tpp-most-brazen-corporate-power-grab-american-history <comment><USER2> It's a power grab by specific industries _and_ several governments, not 'the corporations' as an amorphous concept. Mischaracterizing the shittiness of TPP to score rhetorical points for favored politics is a sorry trick, and it lends an air of intellectual dishonesty to a very important topic.

<comment><USER3> I don't know about you, but I don't expect anything more from alternet.

<comment><USER4> I wish people understood that hyperbole weakens their position.

It's an example of the seen vs. the unseen. What they see when they do this is lots and lots of clicks and lots of attention on social media, and that's interpreted as a win. What they don't see is all the more mature and informed people being swayed _in the other direction_ since they understand that hyperbole signifies a lack of deeper comprehension.

<comment><USER5> > I wish people understood that hyperbole weakens their position.

Depends on the audience. Hyperbole won't convince anyone who fundamentally disagrees with you; you need a reasoned argument for that. But hyperbole can work wonders on people already slightly inclined towards your position but not yet acting on it.

<comment><USER4> I'm inclined to be suspicious of things like the TPP, but the hyperbole I see actually makes me wonder if it's a lot more benign.

Of course there's a deeper underlying reason in my case: I am very deeply cynical about "activists" regardless of their political bent. Left, right, up, down, doesn't matter-- I've long observed that activists are True Believers for whom the victory of a pet ideology is more important than truth or reality. It really is equal opportunity: I am about as skeptical of Greenpeace's latest claim as I am of the religious right's recent "abortion doctors are selling chopped up fetus parts" outrage.

I will take you seriously if you have a genuine grievance. Otherwise I see third party activism (moral outrage tourism?) today as largely a form of entertainment. It's something people do to feel morally superior and self- righteous or to be part of a "scene."

</comment></comment></comment></comment></comment><comment><USER6> Even if all this is true, the fact that it contains no references to sections of the TPP that one can independently verify makes the entire article useless.

</comment><comment><USER7> At what point can we call these attempts to undermine government power an _attack_? Modern war uses economic weapons, which can sometimes be more effective (and less expensive) than the more traditional invasion or blockade.

Consider the "tea"/wingnut faction in the GOP (I think they're gone full doublespeak and now call themselves the "freedom caucus"?) We have people cheering over government shutdowns and explicit claims that dysfunction of government _is the goal_ ("It's exactly what we wanted, and we got it."[1], "I don't want to abolish government. I simply want to reduce it to the size where I can drag it into the bathroom and drown it in the bathtub."[2]). AT what point does that become "making war"?

I'm totally fine with people that want to argue even absurd points _within the system_. Attempting to replace that system with something else - such as the ISDS - is another matter entirely. Consider any sizable power of your choice (corporate, foreign government, or anything else). If they hired people to try and subvert the legitimate functioning of our government, would you recognize it? Or would you consider it the usual corruption we call "lobbying". No empire lasts forever, and the American empire is is more precarious than we like to admit.

[1] [https://www.washingtonpost.com/politics/on-cusp-of- shutdown-...](https://www.washingtonpost.com/politics/on-cusp-of-shutdown- house-conservatives-excited-say-they-are-doing-the-right- thing/2013/09/28/2a5ab618-285e-11e3-97e6-2e07cad1b77e_story.html)

[2] [https://en.wikiquote.org/wiki/Grover_Norquist](https://en.wikiquote.org/wiki/Grover_Norquist)

<comment><USER8> Do these look like "economic weapons" to you?

[https://en.wikipedia.org/wiki/Overseas_interventions_of_the_...](https://en.wikipedia.org/wiki/Overseas_interventions_of_the_United_States)

[https://en.wikipedia.org/wiki/Covert_United_States_foreign_r...](https://en.wikipedia.org/wiki/Covert_United_States_foreign_regime_change_actions)

[https://en.wikipedia.org/wiki/Timeline_of_United_States_mili...](https://en.wikipedia.org/wiki/Timeline_of_United_States_military_operations)

[http://qz.com/374138/these-are-all-the-countries-where- the-u...](http://qz.com/374138/these-are-all-the-countries-where-the-us-has-a- military-presence/)

</comment></comment><comment><USER9> I share the sentiment of many of the responses, that this article doesn't really say anything.

However, I've heard bits or pieces about this ISDS mechanism during previous articles about the TPP. Does anyone have reference to a good (balanced) analysis of the TPP in references to the international disputes, and what it actually might imply?

Does it actually make it easier for corporations to challenge laws that might be put in place by countries?

<comment><USER10> Public Citizen has published a detailed history and analysis of investor-state disputes. They are opposed to the TPP, but at least the issues are summarized by trade lawyers and not only journalists. Their summary page includes statements by members of the U.S. Congress.

[http://www.citizen.org/investorcases](http://www.citizen.org/investorcases)

</comment></comment><comment><USER11> It's the Trade federation all over again!

<comment><USER12> I will not condone a course of action that will lead us to war!

</comment></comment><comment><USER13> I can't help but reflect that if democracy functioned properly, TPP would never have got this far. When and _how_ do we bring out the pitchforks?

One means of resistance may be cryptographically secured supply chains, wherein consumers may vote with their wallets to embargo bad actors either at the corporate or national level. OK, so that's hard to achieve with physical goods without a significant cost blowout (or even with one), but it could be a strategy. Any others?</comment>