Hacker News new | ask | show | jobs
by eternityforest 1452 days ago
I'm not quite sure I agree with the title. Having access to code when you need it is probably a good thing.

But I think code is, in general, something to be avoided when declarative approaches are available.

Declarative is easier for a computer to understand, it restricts the inputs to one domain the computer can deal with.

You don't get the same classes of bugs with declarative. You could even do things like double checking with machine translation and flagging anything that doesn't match for human review.

Plus, you don't need a programmer to do it. Security issues go away. You often achieve very good reuse with code only existing in one place without language variants.

I'm sure there are great uses for this, but I have trouble thinking of even a single case where I'd prefer code to data in general.

1 comments

Building complex sentences absolutely require some form of logic. Different languages have very different rules for gender, plural, sexus, classes ( animated/humane/plants/etc).

I'm arguing that each implemented language in a program should be able to define its own set of utility functions that makes sense for that particular language.

Also, since translations as code can return both plain strings and (for example) HTML fragments, security is instead increased, because encoding/decoding would no longer be an issue.