Hacker Newsnew | past | comments | ask | show | jobs | submit | balfebs's commentslogin

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


Except when they're not.


And when is that? The docs just say it's right associative[1]. And while it's been a long time since I've written any nontrivial Perl, I don't remember ever having ?: be left associative.

[1] https://perldoc.perl.org/perlop


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.


There would have been circumpolar stars though, and those would have been very noticeable.


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


Contraire, it's illustrative of the content's quality.


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.


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.


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.


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.


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.


> 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

No denying English spelling is particularly atrocious – but still easier than learning Chinese characters. The Chinese writing system is arguably the most difficult to learn of all writing systems in common modern use – even if your native language doesn't use the Latin alphabet, the Latin alphabet is going to be much easier to learn than the Chinese writing system is; even learning crazy inconsistent English spelling is likely easier.


Pick your poison.

Knights ride at night nightly, to get knighted.

Does that make any sense to someone learning English.

It's a silly argument though. Other countries are willing to learn English. We aren't willing, not nationally anyway, to learn anything else.


You can operate on very little knowledge of English.

Essentially you can learn middle-out vs other languages.

To understand a programming language you just need the bare bones.

English is the JS of programming languages though, being that it's everywhere and it's very easy to use.


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"


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: