HNHacker News
TopNewBestAskShowJobs

pytester

1,560 karma · joined October 24, 2018

submissionscomments
pytester··on Visual Regression Testing
>Even quite minor OS updates can cause the tests to fail en masse

I found it didn't even take that. Sometimes indeterminism in the code you wrote or indeterminism in code you can't even control will cause tests to fail en masse.

pytester··on Coders Programming Themselves Out of a Job (2018)
There are plenty of businesses where entire countries don't have enough capital to start a competitor (e.g. oil companies, aircraft factories).

It's called capitalism, not "I have an idea-ism" for a reason.

There are some businesses that operate in markets with low barriers to entry but they tend to be A) new and extremely risky or B) hypercompetitive.

pytester··on Coders Programming Themselves Out of a Job (2018)
>If your labor is so critical and all managers are useless tyrants then why are you choosing to give away your means of production to useless tyrants?

Lack of capital. It's called capitalism, not "i have an ideaism" for a reason.

pytester··on Seven deadly sins of talking about “types” (2014)
>If you can't separate Java the language from the idea of static typing and type systems

I can. It's people who make blanket statements about static or dynamic typing who can't.

>I guess chasing runtime exceptions during development is an acquired taste.

Much like building software people actually use.

pytester··on Seven deadly sins of talking about “types” (2014)
>Unless you propose that my test suite tests the libraries I am using, testing does not find code affected by API breakage.

I do find that well crafted integration tests give the best bang for the buck.

>First of all, I doubt it. Second, you just sound rather arrogant.

This was a mirror image response to your condescending assumption that I "just hadn't worked on large enough code bases"

It's a little sad that you didn't have the self awareness to recognize that my feigned arrogance was satirizing yours ;-)

pytester··on Seven deadly sins of talking about “types” (2014)
>I don't think you disprove the hypothesis, though. I think you are talking about equally, if not more, important thing - ergonomics

Types are an intrinsic part of ergonomics.

>I'd rather see something else being an ambassador of static types.

I'd be happy to see another language be an "ambassador of static types" provided the tip of the iceberg of 'visible things built in it' doesn't compromise of say, one spam filter and a file converter.

I'm getting pretty tired of hearing about how awesome and productive haskell's type system is for 15 whole years and seeing a whole lot of evidence that it's waaaaaay too unproductive to build anything of use in it.

Rust is a fine ambassador of static types (and has some great usage examples), but rust and python address extremely different non-overlapping markets and rust isn't shy about the fact it makes it fucking hard to compile things in.

pytester··on Seven deadly sins of talking about “types” (2014)
>When you change a Java API, how much time does it cost you to find all broken client code? How much in the same case for python?

With a decent test suite and a bunch of well crafted asserts, it ends up being much quicker. Indeed, for the really subtle broken stuff, pretty much only a decent test suite can catch it.

>Again, it sounds like your projects were still rather young.

Probably just better tested than yours.

In time, you might learn to appreciate this quality but who knows...

pytester··on Seven deadly sins of talking about “types” (2014)
I think a lot of java's "bureaucracy" is simply duct tape around its badly constructed type system.

>Python on the other hand is often written without any safety

Oh for sure, but I find it easy to start dialing up python's safety from day one of starting on a project (e.g. start writing asserts), no matter how complicated.

Working around java's horrible type system? Less easy.

pytester··on Seven deadly sins of talking about “types” (2014)
>I can't help the feeling that your post is about Python vs Java rather than static vs dynamic.

Because the OP was about python and because python and java are the two languages where I have worked on refactorings of large scale code bases.

I can't help but feel that if you make a hypothesis (e.g. "static typing is naturally better"), you need to be open to examples that disprove this hypothesis.

>And I don't see how your 3 points about the velocity thing are affected by static types..

Static typing usually means a lot of time spent satisfying the compiler. I don't disagree that this can be useful because it catches bugs (although a lot of stuff caught by compilers are not bugs). I disagree that this isn't a cost/benefit trade off that naturally works out.

pytester··on Seven deadly sins of talking about “types” (2014)
>When you see a huge codebase in python grown over several years and try to refactor it, reason about it, or just enhance it, you will inevitably come to the conclusion that the omission of static type checking is a grave error from a system-design perspective.

I inevitably came the exact opposite conclusion. Perhaps because at the start of my career I was trying to do the same thing with Java, and it added overhead and expense without a commensurate payoff in safety.

Frankly, I think velocity is ridiculously underrated:

* Because of the age old "customer doesn't know what they want" issue - hence you throw away a lot of the code that was not fit for purpose.

* Also because the right kind of architecture is only obvious in retrospect - hence you throw away a lot of the code that was not fit for purpose.

* And finally, because the only times in my career where I've had significant success in refactoring a large mission critical codebase it was python and it was because I'd managed to quickly build custom tooling infrastructure (e.g. testing) to support that refactoring.

I do take some issue with python's type system (e.g. the whole truthiness thing), but on the whole it balances safety and velocity in a highly pragmatic manner.

pytester··on What Happens After Prisoners Learn to Code?
This piece of PR fluff isn't helping regular ex cons get regular jobs in non-tight labor markets.
pytester··on What Happens After Prisoners Learn to Code?
>Why would we expect Slack or other tech companies to be helping random people with housing or social support?

Yet they expect congratulations. Slack's selfish commercial interest is entirely aligned with hiring cheap developers, but, they put out a press release and the atlantic magazine took it up.

I worked with a another charity that did a similar thing (not prisoners, but the underprivileged) and one of the companies we got some of them jobs at did the same thing.

The company got some cheap developers, avoided commission on a recruitment agency and then proceeded to issue a press release patting themselves on the back.

pytester··on Some BBC election result stories were computer-generated
>Voter turnout was down by 3.5 percentage points since the last general election.

hm, this example they used was my constituency. I walked around for about 15 minutes until I found the entrance because somebody moved the "POLLING STATION" sign against a wall where it was less clearly visible. I wonder if that's related :/

pytester··on Statically-typed error handling in Python using Mypy
C is a good example precisely because it highlights the fact that explicit typecasts and memory safety are a LOT better at preventing bugs than static types.
pytester··on Statically-typed error handling in Python using Mypy
None of those surprising behaviors exist in python 3.

I wouldn't say "100" < "2" really counts, since, alphabetically it makes sense (an equivalent would be "baa" < "c").

pytester··on Learning to code vs. learning to automate
Manual is often the best option. I worked for a company that was hell bent on automating a booking process and minimizing the number of humans involved until they realized how much many people preferred having a human guide them through different parts of the process.

They hired 100x as many call center workers as they thought they'd end up needing and sales skyrocketed.

My (largely younger, tech savvy) friends are always slightly shocked to hear this story - because they didn't appreciate having a human guide them.

pytester··on Learning to code vs. learning to automate
If capitalism wasn't systemically geared towards creating an underclass of unemployed and desperate part time workers it might not be a failure.
pytester··on Statically-typed error handling in Python using Mypy
Types can help eliminate errors and unwanted behavior, yes. Just like tests.

Types also help document code. Just like tests.

The point is that both are investments and both have different payoff matrices. Sophisticated are often better at preventing obscure logical bugs. They're also good at uncovering obscure not-bugs and preventing code from getting out until the compiler is satisfied. Bad unit tests also do this.

Haskell simply takes longer to write than other languages. Given two developers of equal skill and experience, anyway. I partly attribute the relative paucity of haskell software out there to this.

pytester··on Statically-typed error handling in Python using Mypy
Coz there's a difference between "dynamic type system" and "type system that's thrown together with bits of string and rubber bands":

https://www.destroyallsoftware.com/talks/wat

pytester··on Statically-typed error handling in Python using Mypy
My approach is to dial up strictness gradually as code proves its value. I'll start out building a project and not validating on I/O, but as the requirements get locked down and the code has proven itself, I'll clean up all the edge cases - which will often mean adding in progressively stricter validation on border code.

The advantage of this is that if you end up not wasting too much time "building the wrong thing". Let's say that you took one form of I/O and built massively strict validation in and then realized later that you should have taken an entirely different form of I/O for your subsystem. All that time building in validation on that useless part of code was a pointless waste.

I don't have any stats, but my gut feel is that on average 40% of code can end up being tossed in this way (in some projects it's 100% =).

Prototyping speed is, additionally, not just useful in reducing the cost of building the right kind of code, it's useful in reducing the cost of building the right kind of test (a really underappreciated facet of building mission critical systems).

In my younger years I used to believe that for mission critical systems "building the wrong thing" was somehow less of a problem in code because you could fix requirements and do architecture upfront with some sort of genius architect. Turns out this was wrong.

pytester··on Statically-typed error handling in Python using Mypy
"Strong typing" is a term so vague that it loses all usefulness in conversation. Wikipedia gives 5 different definitions.

https://en.wikipedia.org/wiki/Strong_and_weak_typing

pytester··on Statically-typed error handling in Python using Mypy
>How do you figure? If it’s mission critical, it means failure is unacceptable. Python and other dynamic languages (TS is a middle ground here) excel when failure isn’t so bad

In practice I find that static typing as done by, say, Java and C#, excels at uncovering very shallow bugs. Its benefit is the most obvious when you do very little automated testing. The tech industry's dirty little secret is that automated testing is done infrequently and badly, so it looks pretty effective.

I find that if you try to compare the cost of building sophisticated tests in a high productivity language (like python) with the cost of writing code in a low productivity/high type safety language like haskell, there's a pretty blurry cost/benefit trade off. If you take out productivity as a factor, haskell looks much better.

Nonetheless, the idea that static types (and, to a lesser extent, formal proofs) are some sort of silver bullet persists. There is no silver bullet.

pytester··on Django 3
IME database always bottlenecks first.
pytester··on Django 3
>Right as I was just about to start a new Django project...

It's rarely a good idea to use the latest version of Django simply because most projects will be reliant upon 3rd party libraries which will often be slow to catch up to supporting the latest version.

pytester··on Django 3
It's always prioritized delivery speed and quality over raw performance. If you want an ultra optimized web framework it will always be the wrong choice - it was never designed for that.
pytester··on The world needs more search engines
They should focus on building a search index and then license that to European search engine startups. That's the capital intensive part that requires you to build datacenters next to power plants, etc. and where government money will even out the competitive playing field.

It will also help insofar as site owners will be less inclined to block "EUROPEAN SEARCH INDEX CRAWLER", just as they're less inclined to block google, despite being inclined to block "small time search index".

The creative, non-capital intensive part where having a diverse ecosystem will help the most is building a layer on top of the index to actually find stuff - e.g. a bit like how duckduckgo is built atop bing's index.

pytester··on Unbundling AWS
>there are plenty of tools that support all 3 clouds equally.

there are plenty of tools that support all 3 clouds, but most of those suffer from some sort of impedance mismatch and/or do not fully support the features which those clouds supply.

pytester··on Unbundling AWS
>Aws is not a marketplace and does not enjoy network effects. I.e. if developer A uses AWS, this does not affect developer B.

It damn well does. If everybody else is using AWS it pays to use it too, because:

* The IBM/CYA effect - i.e. "nobody got fired for picking AWS".

* The supply of experienced users - it's easier to hire AWS skills than GCP skills.

pytester··on Study Finds Wind Speeds Are Increasing, Which Could Boost Wind Energy
>Because wind usually often weak and below rated speed, you need to build extra capacity to get enough electricity in normal days.

Luckily it's dirt cheap to build.

pytester··on Exploratory Testing
Exploratory testing is also useful for uncovering classes of scenario which an existing automated test suite is not currently capable of covering but which nonetheless harbor a lot of bugs.

One pretty common case is browsers - an automated test suite might run an exhaustive list of scenarios in chrome successfully while bugs lurk in edge and firefox which were assumed not to be there.

← PreviousPage 2 of 13Next →