top | item 34403796

(no title)

rodrigosetti | 3 years ago

I don’t think any technique is inherently bad: imperative, global variables, and even “goto” can be used wisely to solve problems.

Functional programming (similarly type systems) is another great technique to use when you have constraints that you’d like to be automatically enforced by the compiler (referential transparency, equational reasoning, etc.)

When I have to use a language that doesn’t allow expressing problems functionally when that would be the ideal expression of it, I feel I’m using the wrong tool for the job.

discuss

order

karmakurtisaani|3 years ago

>I don’t think any technique is inherently bad: imperative, global variables, and even “goto” can be used wisely to solve problems.

The word "wisely" does the heavy lifting here. Put it this way: would you rather work on a legacy code base that has goto statements all over the place, or on one where strict standards were applied?

I find this is the relevant question when it comes to programming styles.

rodrigosetti|3 years ago

I’d rather work on a codebase where strict standards were applied.

Banning “goto” is one of such, but also allowing to be utilized under certain conditions to write state machines for example.

I think we will miss innovations if we are dogmatic about features.

“Learn the rules like a pro, so you can break them like an artist.” - Pablo Picasso