4 ms·
Are there programming paradigms for which this isn’t the case?
by thom 3y ago
Are there programming paradigms for which this isn’t the case?
- Detrytus 3y agoWell, the functional programming promise is that output is a function (pun intended) of inputs, no side effects allowed, thus you can understand any given function by reading only its code, no additional context required.
- carlmr 3y agoI find if you combine this with a strong type system like in F# the promise is upheld. You need strong type guarantees on the parameters to make it easy to understand the behavior though.
- uoaei 3y agoThat's not a pun, that's just the definition of 'functional'.
- thom 3y agoSure, but that's still you having to go to lots of places to understand what individual functions do, which doesn't seem different to the original complaint about OOP.
- ponderings 3y agoI at times still write spaghetti code. I switch to functional if the repetition justifies it. It can be quite beautiful. OT: I remember someone noting that he tried to have modular code with as little functionality per module but reached a point where searching for things took writing it. I sometimes ponder if it would be possible to create a DSL for every tiny niche part of each application. It would likewise depend on how awesome the documentation is and if you can even find it. I think LLM's could make both ideas viable. One would be able to find anything and figure out how it works. Could have a committee that judges how reusable your language extensions are and possibly grades you as a programmer with hints on how to improve. Writing the coffee machine DSL should give you bragging rights. A bit like languages nowadays accumulate new features. In an ideal world one would write functions, the repetition of those would be documented and spawn language features, repetition and usage of those would spawn features in the lower language in which the language is implemented which in turn would spawn machine instructions. All using real data in stead of a cultivated hunch or popularity contest. How many installs, how often does that part of the code run, how many cycles can we save globally.
- thom 3y agoPeople don't want DSLs though. There's an enormous contingent of programmers these days who seem to object to literally any form of abstraction at all. They just want to see - imperatively - what something does from top to bottom.