6 ms·
FRP is a constrained environment, which makes it easier to reason about. PHP is comparatively unconstrained, so when reading code you can’t make as many shortcu
by DenisM 9y ago
FRP is a constrained environment, which makes it easier to reason about. PHP is comparatively unconstrained, so when reading code you can’t make as many shortcut assumptions. Of course you could write in PHP in accordance to the rules, but subsequent maintainers, including the future you, cannot trust this self-imposed discipline. In other words, you wouldn’t argue that assembler is just fine because through vigor and discipline you can build PHP-like application. Similarly, PHP is not well-suited to stand in for FRP.
- chubot 9y agoI probably shouldn't have said PHP, since people have reactions to that language that may confuse the issue. I should have said stateless Python front ends. Not even CGI/FastCGI, but just plain HTTP front ends. Many large websites use this architecture (YouTube, Instagram, etc.) An example of something that doesn't follow the architecture is a stateful node.js or Go server. I would say that the typical web architecture is similar to what they are talking about, with the benefit of existence :) But you're right in the sense that they are trying to be more strict, starting on page 50: - benefits for state -- avoid useless accidental state. This is the same philosophy behind SQL. - benefits for control -- They are being more strict here, but I think it is missing a lot, because sometimes you need control flow. - benefits for code volume -- I would need to see a real system to evaluate this claim. It's not fair to compare systems that exist with ones that don't :) - benefits for data abstraction -- SQL agrees here. You don't abstract data. People sometimes make this mistake in their OOP languages, but's incidental.
- DenisM 9y agoI see what you mean. I was thinking of smaller granularity, less than an entire HTTP request. You have a good point.