News for hackers. Stuff that matters.
Re:Why does nobody seem to know what imperative and declarat... by eloisius on Saturday July 30, 2022 @05:05AM (#32285366)
Exactly. You could even write declarative style C, or make your code _more_ declarative. It’s not some binary decision. It generally just means writing higher level language describing the result you want, rather than all the instructions to produce it. Functional languages are very good at letting you right declarative code, especially when it comes to dealing with sequences and lists. Ruby’s enumerator in particular allows you to write code in that style, rather than complicated nested for loops full of conditional logic.

There are no comments on this comment yet.