skysight-inc/HackerNews huggingface dataset:
> Even for the extremely simple "two, a function that, given no arguments, returns the number 2", your unit test can't verify that to be _always_ true

That is true, I don't think anyone argues against that point. What unit tests do, is verify that under the code works under specific conditions (as defined in the test's set up). When unit tests fail under those specific conditions, then you know there is a problem.

Another thing I like about unit tests is that it is much easier (and faster) to test different combinations of conditions
> Does anyone know who's behind this site/books?

http://ithare.com/real-people-behind-the-hare/
Sadly, that's the new layout chicklet keyboard, with the messed up home/end block. It wouldn't actually address the issue.
If you think of "simply burning VC" as "wealthy benefactors subsidising content for everyone" then it looks like a very appealing model.
Or, when saving to file for imagemagic, have it be a random temp name, with the correct file extension, read in the result, and only serve it as the original name when downloaded, if it fits the use case.
Gender Identity Disorder and Schizophrenia
The HN hug of death strikes again
DistroWatch turns 15
One of my absolute favorite things about Rust is that nulls can't be used to circumvent the type system. They must be explicitly accounted for via an option type in all cases. It's very hard to go back to a language that doesn't do this after getting used to it. I get so frustrated by constant null dereference errors when that entire category of error can be avoided.
There’s a mathematical reason you’re less popular than your friends
Types provide semantic information as well so checking verifies semantics as well (extent depends on the strength of the type system).

Saying you're a Rust fan and then saying compilers only guarantee syntax when the entire point of that language is to have a constrained subset in which types guarantee no data races/leaks at compile time doesn't make sense to me.
Having spoken with Navy divers on thia issue, it could range from unpleasent to fatal depending on how loud the active is, and distance from the transducer. Before a dive, verifing that no ships nearby were planning on transmitting was a required safety precaution. Someone smarter than me could probably figure out what dB level actually causes internal damage.
Because art is not decoration, it is history.

So what if the Incan built a gold statue? We can built them much better today!
FreeBSD 11 is running a bit behind schedule, so the freeze of -CURRENT hasn't happened yet. So, yes, it'll be in FreeBSD 11.
But my point is why must people live on that land? Why not go live on some other land nearby? What is the foundational belief backing the idea that everyone should be able to live everywhere?
I have not read the whole article - but I don't think he argues against automated testing in general. Unit testing is only one type of automated testing.
Comparing to the energy that comes from the Sun to the Earth, all human and technological input is negligible. Comparing to the volcanic activity, humanity is more like a lice on the bears skin, claiming its byte will raise the bear's body temperature.

250 000 underwater volcanoes cannot be wrong.
Humanity is not a geological force.

There is more more energy striking the earth’s surface in one and a half hours (480 EJ) from the Sun than worldwide energy consumption in the year 2001 from all sources combined (430 EJ).
If they aren't using it and have more than a few years of operational expenses stockpiled, they should turn it over to stock holders as dividend payments.
I'd extend the same to anyone in the, uh, NL area. Perhaps we should set up an IRC channel specifically for this? Or does one already exist?
There was a Kickstarter campaign recently for the book which has some background info on who's behind it: https://www.kickstarter.com/projects/341701686/the-most-comp...
Unit tests are mostly useless. If one wants their tests to be anything more than a happy path and sad path that the developer thought up (combined with an accretion of sad paths that were found later as bugs), then one would do themselves a tremendous favor by adopting property-based testing and mutation testing.

Doing so forces you to define several constraint-based models for your program, and then layering mutation testing over the top helps you figure out how good your tests actually are.
Palo Alto property owners rejoice; subsidizing demand is a sure-fire way to drive up prices.
Presumably that gain after first rising is experimental error? What could cause it to gain weight there?
I feel the same way as you did, I have 2 years in a big consulting company (Atos) , and I really want to get out of here
Using Neural Networks to Evaluate Handwritten Mathematical Expressions
Generation Z? That's a new one to me.
Does this mean the apocalypse is just around the corner, or do we go back to Generation A?

The Like button has a strange, understated power, that's for sure.
Personally, I'd just assume get rid of corporate taxes, instead taxing at transaction or trade level, and also eliminate corporate person-hood (legally speaking). Top this off with policies that allow for regulatory capture of unutilized or long-term under-utilized corporate assets.
3 Different Kinds of Prototypal Inheritance: ES6+ Edition
Japan's invasion of Manchuria triggered which web of military alliances to fight against which web of military alliances?
s/python dev/person HN might care about
Are most drone operators experts on bird of prey escape tactics?
I don't think they are that different. First, the basic insight from Bayes is that belief of all kind can be represented as probabilities. Second, as @dancompton alluded to, most things are not as cut and dry as to say that they are logically in contradiction. There is usually a compatiblist view or a third alternative.
If it negates it for the majority of inputs, but you insist it negates it for very few or no inputs, I would call that cognitive dissonance as well. In other words, if it's highly unlikely that two things are both true, but you consider it very likely they are both true, that's probably cognitive dissonance even if the two propositions are not logical contradictions.
James O. Coplin has a long of experience and is steeped in theory and practice. His list of publications is about 200 entries long: https://sites.google.com/a/gertrudandcope.com/info/Publicati...

Unit tests are not free as they are also code that much is obvious. Coplin however delves also into less obvious aspects of impact of unit tests on design and also the organizational aspects. Ultimately coding patterns are going to reflect the incentives that govern the system.

Software development is a lot about trade-offs. There is plenty to be learned here how to do it. A addendum by him can be found here: http://rbcs-us.com/documents/Segue.pdf but the meat is in the 2014 article.
India's biggest online recharge – Freecharge's MITM Vulnerability
for those interested in more info:

https://en.wikipedia.org/wiki/Forest_school_%28learning_styl...

https://www.youtube.com/watch?v=ptkID2k091I

https://www.youtube.com/watch?v=Jkiij9dJfcw
My understanding was that there's a signed TrustZone binary that's more or less an ELF that runs in secure mode.
You should take value from those options rather than letting any one of them define value. Then trust yourself to move forward. Software is writ in water.
It's not their owning a home that's the problem. It's the overly strict zoning regulations and process that control whether someone else's land can be turned into more homes.
Purism's Tablet prototype running Debian
It might be worth considering switching to exclusively Soylent (or a similar product) - something you don't exactly eat and that lets you consume exact amounts of every nutrient.
Show HN: The easiest way to control tasks, notes and events
Yes you are right. In that case you have tmux to keep your session. If it doesn't do it, it's pretty much tmux's fault. I understood the previous message as if losing the connection on a train ride would be the main issue.
Speaking of (3): I have a bunch of newbies I'm mentoring. Every time I explain about unit tests, I show them a class I wrote that had 37 lines altogether. After I finished working on that project, a new team took over. They didn't write unit tests (or maintain the existing ones). A month later, that class had a method with 1500 lines.

It's been around a year since development has basically frozen on that project.
> if you said "We value reliable software over meeting deadlines", then you'd actually have said something.

This reminds me of a Jamie Zawinski quote from the book "Coders at Work":

> [...] Are you trying to write good software or are you
> trying to be done by next week? You can't do both. One
> of the jokes we made at Netscape a lot was, "We're
> absolutely 100 percent committed to quality. We're going
> to ship the highest-quality product we can on March 31st."
In OCaml (or any similar language) 95% of what you "unit test" for in Javascript just goes away.

If people cared about software quality, they would use strongly typed languages before even thinking about "unit tests". What people actually want is a) to hack it out quickly and b) to have a lot of busywork to do as a form of job security. Hence 50,000 lines of "unit tests" per 10,000 lines of application...
I think we probably need to pay teachers significantly more if we want to improve things, at least until we understand education sufficiently well to be able to train anyone to do the job.

Back in the early 1900s, and even through a significant part of the century, teaching was nearly the only place for graduates of top women's colleges, at least until they got married. Upwards of 90% of employed graduates of these schools were teaching. Whether that was a matter of it being the most respectable or the most lucrative thing for women to be doing, the fact is that it had a pretty great talent pool to work with. By the 1980s/90s, when you looked at the top 10% of women in terms of academics, only about 10% of them had any interest in teaching as a profession [1].

Now, both the money and the respect are lacking. The perception is that any idiot can become a teacher as long as they can make it through their four years of college. Some people will be quick to say that you can't teach for the money. While that's certainly the case in the US right now, and it agrees with the overall notion that it's much better to be in a job you love, it ignores a lot of the problem. Top students, when they pick what area of studies to pursue, are bound to think about the prestige and earning potential of their future careers, though the amounts of those will differ for different people. If you could easily be headed for a job where you'll make upwards of $100k, accepting $40-50k is a lot for some people to swallow. Suppose I think I'd really enjoy teaching, and hopefully even be good at it, but asking me to be unable to retire for ~40 years, versus the 7-10 I can manage otherwise, is a bit much. Even if I'm not doing my ideal job, I can afford some hobbies that will make up for that. I like sailing, skiing, and traveling, and I'd like to get my pilot's license. Teaching isn't going to pay for any of that. So I make my trade-off, reducing by one the pool of potential teachers. And there are a lot of others doing the same thing.

I have many more things I could say, but I should wrap up my rant. I also believe that home life has an enormous influence on school performance, and I think land use patterns in the US increase this effect by reducing community cohesion, and along with it possibility of parents who struggle being assisted by the people around them.

[1] Somerville College Report, 1987 and 1996. (I've used statistics from Oxford here, but the trends are similarly mirrored for US. I just don't have a resource handy.)
That's a great yarn. Makes me think about what the refugees coming to Europe face.
Well, if the information is known, then it can be shared.

The point being that once it is well known (which it will be if it's in any way successful initially), then it will simply be added to the drone operator handbook, and become less useful as an enforcement tactic.
Everything today is in one way or another connected to the internet, if we are not careful, it may not end well. There should be more awareness of do's and dont's for the internet.
I've found that few things that people are passionate about are truly boring, especially to curious hacker types like myself.

The difficult part is to find that part of the subject, even if it's just a kernel, that triggers the interest you potentially have. This can take a while, sometimes. Perhaps reading up on how to interview people can help in this regard (it's helped me!).

In my case, but I suspect this is true for most humans, my 'genuine interest' activates once the 'human interest' angle, to put it vaguely, starts appearing. Probably because that's easier to relate to.

I hate talking about football, for example, but I've had wonderful conversations with football fans once they started sharing personal stories of things they experienced, adventures they had, or stories of how they used to go to games with their fathers, and how this was one of the few ways in which to connect with them, etc. In the process, I learned some interesting things about football too, but that wasn't really the point for me.

Over time some of these football fans became close friends of mine. We don't talk about football much nowadays, because it's clear that I find the topic mind-numbingly boring. But we do still talk about dads, and that's very valuable.
Smile, nod, laugh
If they know that they probably would not be flying their drone where it can cause problems

It seems it's most a case of dimwits flying it wherever they think it's "cool" with total disregard for aircraft and other things
Tesla's Gigafactory sets grand opening for July 29th
Seems a little similar to galliumOS https://www.galliumos.org/
The final points at the end of the article are gold. They match my own experiences exactly.
Growing Internet activity created demand for cyber security in abundance. The least thing we can do to secure all the information is by increasing awareness among the users and create a user friendly, foolproof environment to secure our personal data.
Show HN: Goodbye Gun Stocks – A gun-dropping, fee-analyzing fund screener
Friends, places, social circles, kids in school... You can change all of that, but would you like to?
one thing that is really imposed by unit testing is the ability of exercise single part of code independently.

it really brings out code smells: if you need mocks injected everywhere instead of being able to use dependency injection cleanly, it shows. if you have code paths that can only be triggered within events, it shows, etc.

having "wasteful" unit testing is more an investment for the future: when users came with real bugs, the ability of reproducing their step in code and fixing that in a no-regression suite is invaluable, but requires your app to be testable in the first place, lacking which you are stuck with manually testing stuff or even worse coughselenium
cough
Ashgabat: the city of the living and the city of the dead
Flying Police Bike Simulator
> I am deeply sad this article got upvoted. People should have a sense of responsibility when giving visibility to stuff like this.

Did you actually read it? Because what you just wrote, is almost exactly the same as what the article author wrote.

His point, as I read it, was that unit tests can have purpose when you don't blindly make them for code coverage.

His case for having unit tests was:

> Keep unit tests that test key algorithms for which there is a broad, formal, independent oracle of correctness, and for which there is ascribable business value

But I don't think he would disagree with the case of providing some "executable documentation" as well. A few lines of code that demonstrate how to use a class or library, along with expected results, is definitely valueable. And those are exactly the kind of interfaces you don't expect to change even when refactoring.
It's not security. It's obfuscation. If you can use a client program to send messages, you can implement your own client code - if you put in enough effort.
Why do chatbots suck?
Agreed. GNU Guix makes it easy for anyone to publish a bunch of package recipes for their own software that users just need to add to their GUIX_PACKAGE_PATH.

The benefit is that it integrates with the rest of the system and thus shares software updates, storage space, and gets overall features such as isolated builds and transactional upgrades and rollback.
Sounds like my life these days. Been given some smelly code (2k loc) that I cannot fully comprehend, so I just went out and naively refactored it.

Code was covered without assertions, so I insisted spending some time into writing at least a few while everyone else just asked me to test. And of course once in production tons of bugs started to appear. I still believe I can write system tests though.
I think he didn't
I share a similar sentiment about unit tests. When you have a lot of code with fast changing requirements, unit testing can be a HUGE waste of time. In my previous job, we spent much more time writing and fixing unit tests than actually adding new features. I was operating at like 1/10th productivity.

It might make sense if you're working for a huge corporation with a LOT at stake. Unit tests then become a form of risk management - It forces employees to think REALLY LONG AND HARD about each tiny change that they make. It's good if the company doesn't trust their employees basically.

I MUCH prefer integration tests. I find that when you test a whole API/service end-to-end (covering all major use cases), you are more likely to uncover issues that you didn't think about, also, they're much easier to maintain because you don't have to update integration tests every time you rename a method of a class or refactor private parts of your code.

About the argument regarding using unit tests as a form of documentation engine; that makes sense but in this case you should keep your unit tests really lightweight - Only one test per method (no need to test unusual argument permutations) - At that point, I wouldn't even regard them as 'tests' anymore, but more like 'code-validated-documentation'; because their purpose then is not to uncover new issues, but rather to let you know when the documentation has become out of date.

I think if you're a small startup and you have smart people on your team (and they all understand the framework/language really well and they follow the same coding conventions), then you shouldn't even need unit tests or documentation - Devs should be able to read the code and figure it out. Maybe if a particular feature is high-risk, then you can add unit tests for that one, but you shouldn't need 100% unit test coverage for every single class in your app.
I have never met anyone who doesn't care about code quality yet writes unit tests...
Unit tests function as a kind of REPL for me and allow me to code considerably faster than without them. Without them, it takes me considerable time each time I want to test the smallest code change since in order to get my app to a testable state I have to click around in the UI, enter a few values in inputs, etc. This is just a waste of time. Moreover, there's a slightly costly context switch which happens when I go from coding the feature to setting up my app to test the feature. With judicious mocking, however, I save a ton of time getting my app to a state where I can actually test the functionality I'm coding and do away with that context switch.
Deep API Learning
Windows Media Center is dead – here are the best alternatives
Why are option types that force you to check the value for null good, but checked exceptions are frowned upon?
Dupe: https://news.ycombinator.com/item?id=11796501
It implements OpenID Connect, which basically an opinionated OAuth2 implementation, and a different thing to OpenID.
Do you disagree that given a bag of all functions which accept N inputs, it is unlikely that 2 chosen at random would negate each other across all N inputs?
Always helps to be able to test out an idea on one of the most privileged set of class mates in the world.
Here is a list of basic errors in Python. Only builtin ones, I'm not talking about ones from other libs. And I'm talking of error categories, as we all know one exception can be used in a lot of different contexts:

BaseException
+-- SystemExit
+-- KeyboardInterrupt
+-- GeneratorExit
+-- Exception
+-- StopIteration
+-- StopAsyncIteration
+-- ArithmeticError
| +-- FloatingPointError
| +-- OverflowError
| +-- ZeroDivisionError
+-- AssertionError
+-- AttributeError
+-- BufferError
+-- EOFError
+-- ImportError
+-- LookupError
| +-- IndexError
| +-- KeyError
+-- MemoryError
+-- NameError
| +-- UnboundLocalError
+-- OSError
| +-- BlockingIOError
| +-- ChildProcessError
| +-- ConnectionError
| | +-- BrokenPipeError
| | +-- ConnectionAbortedError
| | +-- ConnectionRefusedError
| | +-- ConnectionResetError
| +-- FileExistsError
| +-- FileNotFoundError
| +-- InterruptedError
| +-- IsADirectoryError
| +-- NotADirectoryError
| +-- PermissionError
| +-- ProcessLookupError
| +-- TimeoutError
+-- ReferenceError
+-- RuntimeError
| +-- NotImplementedError
| +-- RecursionError
+-- SyntaxError
| +-- IndentationError
| +-- TabError
+-- SystemError
+-- TypeError
+-- ValueError
| +-- UnicodeError
| +-- UnicodeDecodeError
| +-- UnicodeEncodeError
| +-- UnicodeTranslateError

52 exceptions.

Now, on this list, how many can be linked to language typing ?

+-- TypeError
+-- ValueError
| +-- UnicodeError
| +-- UnicodeDecodeError
| +-- UnicodeEncodeError
| +-- UnicodeTranslateError
+-- AttributeError

And ALL those errors can also be triggered with something a type system would no catch : runtime class generation, unexpexted user input, corrupted database, wrong data header, etc)

So basically, relying only on typing will cover about 10% of the error types, most of which are caught with linters such as flake8 and a code intelligence tools such as Jedi. You are making a very weak case.
Stop the French bashing. Anywhere in the world it's the right thing to protect the child until you're 100% sure the parents have nothing to do with it.

Imagine the outrage if they let the baby in the family since the parents look so innocent and 6 month later the baby is dead.
What has the number of lines got to do with the unit tests?

That functionality had to go somewhere, no matter how badly written it was.

Unit tests don't magically save you from code bloat.

Also I work on 3 code bases written by other people with zero unit tests, I refactor them all the time. Other developers have refactored them. Not having unit test is not a big barrier to refactoring.
The Evolution of the Linux Games Catalog
I do often continue working but then with a nagging sensation of not executing a task in the most optimal of ways, which is what I meant by having a healthy approach to cognitive dissonance, performing a task in a way you know or feel is not optimal but not being confused by feelings of cognitive dissonance, instead just see it as part of the learning process. In the end, the dissonance dissapear as soon as the learning process has finished, and I'm no longer anxious about that option.
My belief, and I believe the belief of many others, is that the people who work in your city should be able to live there. If all of your school teachers, fire fighters, and police, not to mention store clerks and janitors, can't afford to live in your town, then that's unsustainable in the long term. At the moment, it's likely that these folks are commuting 40, 50 or more miles into PA to work every day from the South or East.