4418
Part of @thedevs General Rules: @rulesforthedevs Only related to group topic (Python + Python Frameworks) Other @thedevs groups: https://thedevs.network
When you're coding always go for the thing that is less likely to fk up
Читать полностью…
Nuh i use function pointers, both for returning and taking, to be functional
Читать полностью…
Idk much of this stuff TwT
I just code out of instinct
It doesn't impose constraints for or against the use of structs
Читать полностью…
If by this you mean the simple C-style programming, I would just call it procedural programming
Читать полностью…
It's pretty nice, and sometimes methods make it nicer
Читать полностью…
I myself prefer simple struct/function/pointer programming
Читать полностью…
Class method when you need to access class atrributes. Static method when you don't need to access neither instance nor class attributes.
Читать полностью…
Adding to that
If you can't afford the fkd up situations
So you can program with structs procedurally, and without structs procedurally
Читать полностью…
Procedural is a sub-class of imperative since procedural includes block and scope concepts, whereas imperative describes a more general concept that does not require such features. Procedural languages generally use reserved words that define blocks, such as if, while, and for, to implement control flow, whereas non-structured imperative languages (i.e. assembly language) use goto and branch tables for this purpose.
Читать полностью…
involves implementing the behavior of a computer program as procedures (a.k.a. functions, subroutines) that call each other. The resulting program is a series of steps that forms a hierarchy of calls to its constituent procedures.
Читать полностью…
And ofc using methods sometimes doesn't mean we need to *only* use methods, some things are nicer as functions
Читать полностью…
Like instead of foo_do_thing(&foo, 1, 2, 3)
We just have foo.do_thing(1, 2, 3)
I inherited this style of programming when i had to use pure c on mico controllers
Читать полностью…
https://en.wikipedia.org/wiki/Feature-oriented_programming
Читать полностью…
The first argument of a class method is the class object
In the case of static methods you have not a class object
When to use static method and class method in the code
Читать полностью…