[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


https://strawpoll.com/e7ZJaepmdg3
>>
>>109243578
Now translate this to English.
I know what object oriented is and functional.
But what the fuck is Declarative and Imperative?
Where is Procedural, the most sensible one?
>>
>>109243615
vro please...
>>
VPN voting is not allowed
goy site
>>
>>109243578
>unironically discussing programming paradigms in fucking 2026
>>
>>109243578
vibe.

herbs.
>>
>>109243578
Real software uses C.
CRUD shit usually OOP, because it's convinient.
UI is usually declarative, configs also.
And nobody really uses functional. A bunch of startups did, purely for scaling purposes, but it was decade(s) ago, probably was rewritten back to OOP slop by now.
>>
>>109243615
It's like a political compass thing.

This website needs a rule that demand 3-digit IQ to visit, else gives out permaban.
>>
>>109243578
declarative languages do not actually exist though?
otherwise, functional paradigm has obviously won out over the object oriented paradigm
>>
>>109243854
what else is there to do? may I have your opinion on the typestate pattern?
>>109243937
I agree, but functional is so much more flexible and expressive. Once I got pipelines, my only thought was 'why is not everything written this way?'
>>109243946
I would pass that test.
>>109244021
I find it interesting to implement declarative patterns. It is much more convient for whoever uses the library, much of the complexity is hidden.
>>
>>109243578
>hurr durr which paradigm
>all modern high level languages are multi paradigm
nigga what you doing. That's like asking do you prefer screwdrivers or power drills. They are different tools for different situations and you have both in the toolbox
>>
>>109243937
>And nobody really uses functional
with one exception
>>
>>109244117
Tell me the advantages of an imperative, object-oriented approach over a functional, imperative approach.
Pro Tip: You can't because there are none other than slopians get to 'understand your code'
>>
>>109244127
*functional, declarative approach that is.
I'm drunk stone me
>>
File: fact.jpg (57 KB, 716x687)
57 KB JPG
object oriented with no inheritance
>>
>>109244127
Objects oriented concepts are much better at encapsulation of functionality which can be a benefit in exported code such as libraries. It's much easier to work with an object and it's associated methods than a loosely coupled import of 30 different functions
>>
>>109243578
whats the difference between interfaces and oop? Reuse and extension?
>>
File: 1782866446514126.png (46 KB, 657x718)
46 KB PNG
>>109244155
How you even stay sane without sharing functions across objects/structs?
>>
>>109243578
Smalltalk - Java - C++
Clojure - Common Lisp - Rust
Haskell - OCaml - F#
>>
>>109244127
>>109244178
btfo
>>
>>109243578
Nonfunctional
Destructive
>>
>>109243578
I prefer natural language (aiGOD)
Coding manually is trans
>pic related, literally me
>>
>>109243615
golang is the easiest imperitive language to identify with. more popular C++/java type languages are declarative
>imperitive
when you write a function, you define _what traits_ the caller must posess to be able to call you
>declarative
when you write a function, you define _what class/parent_ explicitly has the ability to call you
>>
>>109243578
object-oriented is imperative
functional is declarative

>>109243615
>But what the fuck is Declarative and Imperative?
imperative = you write instructions how to get something
declarative = you write instructions what to get
>>
File: 1000035402.png (44 KB, 1280x524)
44 KB PNG
>>109244155
More like
> Object oriented without class
>>
>>109244185
careful alignment of data so you can pull typecasting fuckery
>>
File: 1759837664781.png (154 KB, 480x320)
154 KB PNG
>>109243578
Oh yeah, I'm a declarative functional bro all the way. OOP is so archaic. My tools, you ask?
>object.map()
>object.filter()
>object.reduce()
>object.toString()
Need to be more dynamic? I have a tool for that too.
>function(functionObject)
>>
>>109243578
I really hate these AI generated charts
>>
File: rikka.jpg (280 KB, 960x1440)
280 KB JPG
>>109243578
I prefer whatever provides more value for a specific project.
>>
>>109243578
i really really like using object-oriented programming on C
for some reason, it always ends up being elegant
>>
>>109243578
I like Rust
>>
> The industry has largely moved away from choosing one absolute style. Most modern systems leverage both approaches where they fit best.

> A high-performance backend engine might be written imperatively to optimize memory throughput and minimize latency, while exposing a clean, declarative API or fluent interface for developers to interact with. The best style is the one that minimizes cognitive load for the specific layer of the architecture being built.

thus, the Q doesnt make sense. each style - Delcarative/Imperative is appropriate for a specific context. though, i would argue that Declarative style has to be chosen, while imperative is not chosen, its a "nobrainer" way of implementation
>>
>>109248727
wrong choice of Declarative over Imperative comes from "architecture astronauts" trying to apply patterns everywhere and creating config files for nothingburgers (build systems).
>>
File: 2026-07-11-15:50:17.png (41 KB, 413x318)
41 KB PNG
>>109247671
this. i have a small build script that create linker tables for dynamic dispatching. you can statically build them at build time, but you lose the read-only part.

'oop' in C is actually nice because you only use what you need, you inherit via composition and can build your own rtti with custom features.

custom rtti is so good, wish languages like c++ had it.
>>
>>109243578
Which option is for Rust-style programming? I choose that.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.