Hacker News new | ask | show | jobs
by kw123 1191 days ago
I have exactly the same feeling. Schema vs schemaless is like static typed vs dynamic language. The extreme is java vs JavaScript. With JavaScript, you have all freedom to construct objects with whatever properties, then you pay with hard-to-detect runtime errors. That is why people are going for TypeScript nowadays. I have learned this hard way, as I had hated Java so much sometime ago. For that I used quite bit Groovy, but later I had to refactor some with Java just for static typing, to avoid running time problems in critical area.
1 comments

I've been in PHP for a long time, and over the last 8-10 years there's been a push for more typing in the language, and we have a lot more typing ceremony than earlier PHP. The nice aspect is that you can get away without it, at least for a while, and add in later. By later I'm usually meaning minutes or hours, not months. :) Biggest example I can provide right now is writing a class method - I don't have to put a return type on a method (indeed, you couldn't in earlier PHP!). When I'm first writing a method, I don't always necessarily know how I might use it. I can write up something basic, then decide after testing/experimenting that I want the return type to be a float, not an integer.

Did this in Groovy as well for a few years - not being required to declare a bunch of stuff up front let me focus on the internals/logic a bit more first. Once that was working, putting more explicit types in (return types, parameter types, etc) would help 'freeze' it in place.