Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
UK-Al05
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
31 ms
·
331.
▲
by
UK-Al05
6y ago
It's normally the opposite. Unit tests are too small. If you unit test all of the objects(Because their all public) then refactor the organisation of those objects then all your tests break. Since you've changed the way objects ta
332.
▲
by
UK-Al05
6y ago
People expose too much of their code as a public api. The public interface should be small, and that's what the unit tests should test against. If users should not access it directly, you don't have to unit test it directly, you t
333.
▲
by
UK-Al05
6y ago
People don't know how to test well. It's that simple.
334.
▲
by
UK-Al05
6y ago
I agree this is what it is. But a lot people people don't understand it that way. So I get rid of the existing already loaded terms, and just teach it directly without referencing it.
335.
▲
by
UK-Al05
6y ago
The extra layer will transform the objects somewhat, so you would have to change what the original object would accept. You have now broken the tests against the original object.
336.
▲
by
UK-Al05
6y ago
I mean I am a functional programmer so i naturally make code pure until the edges anyway. In a functional language I will just replace the edge function call with a fake version. But the problem with mocking, is you couple your objects to o
337.
▲
by
UK-Al05
6y ago
They can require more setup in that you have to write an object to represent the thing. They require less setup in that mocks require tons visual noise in setting them inside the test. Where as a fake will just be created with a standard co
338.
▲
by
UK-Al05
6y ago
For most web applications I barely use mocks except on the edges. For mocking out boundries like calling http service I need to call, I do the following. I will write an integration test against the real object representing API. These tests
339.
▲
by
UK-Al05
6y ago
For me tests are essentially just a repeatable REPL session. And like a REPL they can radically improve my development speed. So asking are these tests worth investment is silly, because they've decreased the time for me to write the c
340.
▲
by
UK-Al05
6y ago
You could write sum type that handles multiple cases. Value Error ValueAndError
341.
▲
by
UK-Al05
6y ago
I mean yes, if you want a use a new feature using the new api. Then your going to have to move onto the new api. But that would happen regardless of using microservices. If you version it though, services that don't care can cary on re
342.
▲
by
UK-Al05
6y ago
Yes this what has spread around and what people think of as unit tests. But it an awful way of splitting tests. Code bases following this end up with brittle tests, that break at slightest design change with no functional change. Here'
343.
▲
by
UK-Al05
6y ago
It seems like database schema and domain api are very coupled. They should have nothing to do with each other. You should be able to change your database schema without changing your api.... If you want to expose extra features or change th
344.
▲
by
UK-Al05
6y ago
I've unit tested the core domain of puzzle games and rpg games before. It's like testing business code. It's uniquely suited to that. But they can't tell you if some visual thing looks strange. It seems like testing in g
345.
▲
by
UK-Al05
6y ago
Those tests for those invariants should already exist, if your already testing.
346.
▲
by
UK-Al05
6y ago
Are you defining unit tests are per class tests? This is the biggest mistake. You should be testing a unit of behaviour, like a business rule or an effect to be expected. If this involves multiple objects collaborating then so be it. But th
347.
▲
by
UK-Al05
6y ago
I think transistors are great for electrical side of computing. Lambda calculus and lisp for the abstract model.
348.
▲
by
UK-Al05
6y ago
The advertising business actually has social status the UK. Saatchi brothers have links with the conservative party for example.
349.
▲
by
UK-Al05
6y ago
That is my first reaction...
350.
▲
by
UK-Al05
6y ago
Don't people clojure try to wrap primative types. Say an Address type? Or is that not a thing?
351.
▲
by
UK-Al05
6y ago
Most degrees in most subjects go in-depth on subjects they probably won't ever use in bog-standard industry role. Do I regret it? No, it was fun, interesting and it's cool when this hidden knowledge does come up at work.
352.
▲
by
UK-Al05
6y ago
When I was young, I remember mathematical notation being intimidating when getting started.
353.
▲
by
UK-Al05
6y ago
Because drag and dropping blocks is the same difficulty as writing it down just with more steps. The difficulty isn't in writing the code, but specifying exactly what you want to do.
354.
▲
by
UK-Al05
6y ago
You can use type aliases in f# and use them like interfaces.
355.
▲
by
UK-Al05
6y ago
F# does have type alias. It takes the form type newname = oldname You can do things like type LoadReceipt = RecordId -> Record let sqlLoad: LoadReceipt = implementation let noSqlLoad: LoadReceipt = implementation You can use it like an i
356.
▲
by
UK-Al05
6y ago
Anonymous record?
357.
▲
by
UK-Al05
6y ago
Code quality enables fast iteration. There not at odds.
358.
▲
by
UK-Al05
6y ago
TDD excels at messing around with the design of an API. As your basically exercising the API through the tests, your seeing how nice it is use.
359.
▲
by
UK-Al05
6y ago
Algebraic data types, monads, and things based around those have tons of business value for writing correct business logic for non-performance critical code. You get that in haskell. Though admittedly you can get them other functional langu
360.
▲
by
UK-Al05
6y ago
I think I remember this. The problem was you we're insisting to add in an insecure encryption algorithm into the crypto library. They didn't want to because they didn't want to add an insecure algorithm to the library to enco
More ›