Better HN
topnewbestaskshowjobs
Log inSign up

balfebs

21 karma · joined Aug 10, 2022 (4y ago) · 9 submissions

Submissions

comment 3y ago · link · parent

Not sure what you mean, but ternaries are right-associative in Perl just like most other languages. PHP is the odd one out.

comment 3y ago · link · parent

I believe that 9,000 years ago there wasn’t as distinct a pole star due to axial procession. Celestial north would probably have been somewhere between Vega and Tau Hercluis with a fairly wide separation.

comment 3y ago · link · parent

Unfortunate that the repo name and header text of the README both misspell “programming”

comment 3y ago · link · parent

If you define fall as the size of the gap. You could also take it as acceleration towards the barycenter, which would be the same. These are indistinguishable for everyday objects so could argue that the word “fall” could be interpreted either way.

comment 3y ago · link · parent

That is a concern, but this makes invariants something the compiler can reason about more easily, since they happen at function boundaries and are distinct from regular code, unlike “vanilla” assertions.

comment 3y ago · link · parent

The post assertions do look very similar to a unit test, but the pre assertions seem really useful; it can sometimes be difficult to know every code path that leads to your function, and though tools exist for this, assertions on inputs help you catch errors arising from unusual conditions.

This seems like it’s mostly syntactic sugar for assertions, keeping them at the interfaces of the function (in and out).

It can also be sometimes useful to have these conditions right there alongside the implementation and not just somewhere else in your unit tests.

comment 4y ago · link · parent

Without other planets to examine, we have no way of knowing whether this is survivorship bias.

Is life truly that tenacious or are we incredibly lucky? Perhaps best not to tempt fate if the latter.

comment 4y ago · link · parent

There is a great deal more to learning a language than its alphabet, and English is probably one of the worst languages to learn that use the Latin alphabet, with many inconsistencies and exceptions in grammar and pronunciation. The reason so many people learn it is because they have to, not because it's easy to learn or use.

English is the JavaScript of human languages.

comment 4y ago · link · parent

When I was a Perl programmer, in our shop we amended the motto "There's more than one way to do it" to "There's more than one way to do it, but most of those ways are wrong."

The Perl community themselves eventually extended the motto to "There's more than one way to do it, but sometimes consistency is not a bad thing either"