Our rules have been updated and given
their own forum. Go and look at them! They are nice, and there may be new ones that you didn't know about! Hooray for rules! Hooray for The System! Hooray for Conforming!
Our new Indie Games subforum is now open for business in G&T. Go and check it out, you might land a code for a free game. If you're developing an indie game and want to post about it,
follow these directions. If you don't, he'll break your legs! Hahaha! Seriously though.
[Programming] Thread: Restricting masking of red pandas since 2013.
Posts
Nice post. I'll steal some of that for the next programming class I'm doing. Last time I walked through making a simple Door class with some properties (name, width, height) and methods (open, close) and then inheriting from that to a SafeDoor where I modified the constructor and open() to require a code to open the door.
I think that what you're describing as "imperative" is what I generally see referred to as "procedural". Imperative programming gets the job done by affecting program state; both procedural programming (a series of procedures that call one another) and OOP (a series of entities that interact with each other) are generally imperative. OOP, really, is a direct evolution of procedural programming; it bundles together related functions and variables into little packages in much the same way that procedural programming bundles together related individual statements and variables into little packages. OOP is like the next step from procedural programming.
Strict, pure functional programming doesn't allow modification of state. One way to think about it is this: the only way a function can interact with the world outside of itself is through its return value. Of course, then you run into the unfortunate fact that the real world is totes stateful, and if you want your application to have to sort of an impact on the world (you know, like do basic I/O), you have to come up with work-arounds for certain scenarios (this is where Haskell's monads come in, if I understand correctly).
Anyway, many languages tend to be multi-paradigm, anyway. Functional features are leaking into C# all the time, and F# is a functional-first language, but if you want to start changing state and building complex objects, you're more than welcome to. If you've ever used a lambda expression in a language like C++ or C#, then you've used a functional feature in a mostly-imperative language.