HomeНаука и техникаRelated VideosMore From: Coding Tech

Procedural Programming: It's Back? It Never Went Away

611 ratings | 28874 views
When programmers describe code as 'procedural', it's generally not meant as a compliment. There is the belief that we have collectively moved pass such thinking and onto better paradigms. But a paradigm is no more than a pattern language, a family of solutions fit for a context. Change the kind of problem you are solving and you may find a different solution makes sense — even, in these days where pure functions battle it out with classy objects, procedural programming. This talk takes a look at some of the past, present and future of procedural programming, looking at how there's more to it than many first assume, how it still informs language design and how it relates to other paradigms, such as functional and OO. EVENT: Build Stuff 2017 PERMISSIONS: Build Stuff Conference Organizer provided Coding Tech with the permission to republish this video.
Html code for embedding videos on your blog
Text Comments (93)
Ch Pe (2 days ago)
Are there any procedural programming languages where i can actually do useful things without needing OOP or Date Structures?
marko tikvic (4 days ago)
The fact that these talks still exist is the proof of how self-absorbed most programming communities are. Instead of bickering like little girls maybe you should pick a fucking programming language and do something useful with it or at least stop writing shitty, unusable, incomplete code. The fact that there are tons of amazing software tools, apps, games (or whatever you fancy) out there is the one and only proof that diehard people of any paradigm are delusional. Some languages are better than other for certain tasks. Some languages are better than most at some tasks and that's it. Statically typed vs dynamic, procedural vs OO, garbage collected vs manual memory management all have upsides and downsides. I mean, this really isn't that hard to understand. Why are people still popping veins over this stuff?
marko tikvic (4 days ago)
That's the main difference between programmers and engineers. The former waste their time on shit like this, while the latter do something useful.
Wen0110 (2 months ago)
Good lecture! OOP has become a kind of religion for many, and this is actually a bit puzzling. Most of the pioneers of Object Oriented Programming were actually pretty clear that OOP was to be an additional tool in tool design toolbox. They never intended to create a world in which people would say that something is wrong because you din't use OOP.
Cezary Dudek (3 months ago)
Off-topic... I don't like the way that Daft Punk's Rinzler song was sped up so much at the closing of the talk.
Rory O Connor (4 months ago)
Excellent talk, truly insightful! 1=D
Virtus Brædder Opstrup (5 months ago)
Holy shit his wig is nearly falling off his back
Procedural programming + FPGAs = Match Made in Heaven?
Zantorc (5 months ago)
Algol 68R was 50 years ahead of it's time.
Patrick Isbendjian (5 months ago)
Goodness, makes me feel old. It reminded me of Algol68, which was taught in my computer science classes in the mid-70's. And also of Professor Paul Branquart who was teaching us compiler construction and was one of the authors of the Philips Laboratories Algol68 compiler... Thanks Kevlin for stressing that almost all the ideas we are seeing pop up now are old ideas in new guise
Ted Mosby (5 months ago)
hahah how did he know i never new my grandfather && i thought al gore was of TV he looks 68
Dan Cook (6 months ago)
Magnificent! In many ways, OOP had taken these old ideas and made them worse or locked down (and this was a refreshing review of history that many are ignorant about). Most devs nowadays think opposite, and to them I provide the following articles which compliment this video very well: https://csis.pace.edu/~bergin/patterns/ppoop.html http://www.smashcompany.com/technology/object-oriented-programming-is-an-expensive-disaster-which-must-end (The first one is an excellent example of how procedural programming is thought of in the limited way that this video describes). My observation is that a lot of modern OO is a long shot process of realizing the good of other paradigms, and then providing them (in a more locked-down or limited form) as breakthrough OO advancements. OO as a culture is more about what is popular and makes you look professional, than about understanding first principles (and historical context) and using them judiciously. This video is a refreshing revisit of history and first principles from which OO (and others) eventually derived.
aylictal (7 months ago)
Nice presentation. I wanted to expand more upon his ideas and say that while pure functional programming is the opposite of the imperative procedural model, they each have their pro's and their cons, which is why procedural is still very valid today, but shouldn't be used everywhere. I think the rule of thumb I try to follow (as a javascript developer that has access to both models at any given time) when figuring out the best implementation or utilization of a paradigm is two things A) Managing State B) Performance. I feel functional programming designs cater to A however procedural in essence caters more to B. Managing state is always goign to be a bitch, but that is the primary concern that functional programming addresses because it attempts to effectively eliminate it. Procedural doesn't necessarily address performance as it's concern, but it turns out that it really is the most explicit way to perform the best because there is (usually) no additional overhead ... niceties if you will. As a couple of examples of the above: Recursion specifically is very much welcomed and promoted in the functional programming paradigm, but the overhead is actually significantly worse than explicitly detailing exactly what you want the program to do imperatively. In javascript specfically, the forEach native method to iterate over an array as a functional method, doesn't even allow you to exit the loop unless you throw a hard exception or error. This definitely highlights the key difference between the two paradigms: a pure function such as forEach vs a native iterative procedural for loop with a nested break condition. This may also be the reason why C took off in the 70s over lisp. Performance was valued moreso than managing state back then because of hardware limitations. Vice versa, in today's era, hardware isn't the bottleneck, it's creation of apps that are doing absolutely insane things that were only dreamed about back in the 70s, which makes managing state the more primary concern. This is why functional programming is the current buzz over procedural.
aylictal (5 months ago)
To additionally add here, my response is that while functional can be utilized to easier convey to other developers their implementation and understanding, it is not often the best approach to do so. Me personally I struggle very hard understanding that ES5 functional implementation, yet the ES6 implementation (functional) is quite easy for me to understand. Likewise, the ES5 procedural implementation is easy for me to understand as well to solve a fairly daunting problem when looked at initially at face value. Perhaps you'd like to try to solve this without even looking at the solution. Heres the problem: Given a 2 dimensional array of positive integer values which form a trianglular grid, where the first row has a length of one, and each sequential row has an additional array length of lastrow+1 length, find the path from the bottom of the grid to the top which will add up to the maximum possible value if traversed, where you can only travel along a segmented line which has to be adjacent to the row below it (example, if you start on the fifth element of the last row, your next traversal point upwards has to be the 4th or 5th element of the next array only which you can traverse).
aylictal (5 months ago)
There is a very good example of a triangle counting problem posted online on how to solve for the path with the largest sum. I will post it at the end of this message. For the javascript solution, there are two answers posted. One is written in a procedural style, and the other is written in a pure functional style (as pure as possibly can be done). I don't think things written in a functional style are necessarily easier to read. as per this example. What do you think? And sorry I am estimating here that you understand Javascript. If you don't I apologize. Also I am referring to the ES5 implementation. After working with specifically JS for the past 5 years exclusively, I feel that the ES6 functional approach is the easiest, however the ES5 functional (haskell translation) is the hardest for me to actually comprehend, and this is all because in ES5 there were no native functional array methods available: https://rosettacode.org/wiki/Maximum_triangle_path_sum#JavaScript
Okuno Zankoku (5 months ago)
Your point is not lost on me, but I just wanted to clear up some functional programming stuff. I don't think forEach is a good example for your argument. It isn't that functional, since its point is to perform side-effects. Also, the idea behind not having early exit in forEach (or its functional cousin map) is that those operations could in principle be vectorized. I don't know of any compilers that currently do this vectorization automatically, but in Haskell, you can manually switch map for parMap to instantly get vectorized code and thereby a performance gain. Second, manually writing recursion in modern functional languages is actually discouraged. Instead, programmers should use a standard library of basic recursion patterns (map, fold, &c), and in doing so , they open up a ton of compiler optimizations. The Glasgow Haskell compiler, even though it's fighting both recursion and laziness, is able to translate large but idiomatic uses of recursion into tight loops. Often, these loops will be tighter than the corresponding hand-optimized loops because compilers are much more comfortable with cross-module optimization than humans. Of course, in Javascript, especially in the browser, your JIT will vary. And because js is a dynamically typed, impure language, optimizations like stream fusion are going to be essentially impossible without incurring too much latency from the optimizer. The underlying reason to pop into procedural is to avoid reliance on the mythical "sufficiently intelligent compiler", and procedural is the only option given today's hardware. I don't think functional is really a buzz for two reasons. Empirically, it's already demonstrated over fifty years of staying power despite implementation difficulties. Theoretically, the lambda calculus and its descendants are the easiest formal theories of computation that can be manipulated by humans at the source-code level, which makes it immensely readable. On the other hand, I do think that functional programming is now a misnomer, and as it becomes a buzzword, that will dilute the important idea: restrict the power of the programmer in order to increase their ability to communicate both with the compiler as well as with other humans. Of course, that's also the idea behind structured programming, so I have hope that we'll keep seeing the idea come up until we get it right.
Filip Majetić (8 months ago)
"X is the dark souls of Y" well who would've thought this had a name
Jared Maddox (8 months ago)
For those who are confused, this entire talk is essentially "Everything that you think is new and exciting is actually really old ideas, so there's a lot of old books and papers that you can look at for help with it. Here's an hours worth of working through this concept." Technically he's right and wrong at the same time, because type arithmetic is not math, and yet it is.
realcygnus (9 months ago)
The evolution of technology is almost as interesting as the technology itself.
moofymoo (9 months ago)
About 15min in video and my inner hipster senses are tingling.
Bryon Lape (9 months ago)
My god....I understand that C code.....I am old...
Ko- Jap (4 months ago)
noxabellus Or someone who went to almost any college... For IT , CS, SE ...etc
noxabellus (7 months ago)
My god...I understand that C code... I am [ a real programmer* ]
Saul Axel Martinez Ortiz (8 months ago)
I also understand it, and I'm 21
Ian Schimnoski (9 months ago)
11:29 😑 WOULD YOU PLEASE: NOT BE A HUMAN WHO SOMETIMES SUFFERS FROM THE URGE TO COUGH!!😬 (Joking😄😄 you're cool, yo, anonymous person who coughed. We all been there; I was once choking to death on water in a movie theater, and then to add insult to injury: I accidently farted whilst trying to choke as quietly as possible... ...it was embarassing, but people politely pretended they weren't aware of it )
Carl Franz (9 months ago)
"Next gen. Object Oriented programming"? Did I miss something?
ck sin (10 months ago)
I spent an hour to listen to this non-sense and I cannot find a single example he talked about which cannot be recreated in C#. Experienced programmer has no doubt that things he talked about are foundation of modern OO languages, those fundamental ideas are actually already embedded in modern OO languages in an improved way. What modern languages are doing are improving on those foundation, because those foundations are not nearly enough for complex programs or are not easy to be used. There is no point to mocking at what "All these crazy 'new' solutions" are doing, it like mocking at electric vehicles(EV) and saying "Haha. What's "crazy new" about EVs? it also has 4 wheels as same as my chariot! See? Chariot is already the solution to transportation, why struggle with EV? They're both the same!". This argument may fool people who know nothing about EV, but we all know this could not be further from the truth. **Laughing at EV** Chariot:It's Back? It Never Went Away ! .... What a clickbait!
marko tikvic (4 days ago)
Learn something about computers, go pro and then revisit this comment.
random phallus (1 month ago)
+noxabellus you're making a false equivocation fallacy on "app". He is clearly a Java developer who makes android apps. By "app" he doesn't mean "application, as it is generally understood." He means "Android apk compiled from Java. A pure OOP language." Of course you don't have to have Java and OOP to make android apps, and of course there are different applications rather than just android apps, but you two are talking past each other. He is in a specific domain that is a subset of your domain of discourse. But you are assuming his language is in the over arching general domain; but the subject of that assumption, is not the case.
Dan Cook (5 months ago)
ck sin "cannot find a single example that can't be recreated in C#" ... That's the point, except you are turning it on it's head. It's not that the past is a lesser version of the present, it's that after decades of "improvement", were right back where we started, and not necessarily better. The JS examples show that these proc concepts (now thought of as OO) can be done ad-hoc, versus requiring the language to have provided the mechanism for you. One thing you missed though, is that ad-hoc class composition can NOT be done in C#. Although the examples he gave can be done with single-inheritance of classes, the same technique can be used to mix multiple classes together into a new class (or into an existing object) without there having to be such any inheritance hierarchy. What he's shown is not single inheritance; it's mixins or traits
Dan Cook (5 months ago)
noxabellus I agree. The "cannot even" may apply to the (supposed) fact that OO Apps are the only available ones; but not the only feesible ones.
Dan Cook (5 months ago)
ck sin Your definition of slow and unresponsive, is not the same as the end user's definition. You're telling me that you've never heard anyone complain about they're phone being slow and unresponsive? It's quite common, and unjustified when you consider how much better technology is now. It *must* be the software.
hytlerson (10 months ago)
O, čia Lietuvukėj :D
moofymoo (9 months ago)
čau braļuga! :D
Justin Smith (10 months ago)
Nuclear proliferation is Bill Clinton and Obama's fault. They made deals with North Korea and Iran making their nuclear programs possible.
Pedro Montoto García (10 months ago)
The talk that spawned ten thousand startups based around Algol 68
keedt (5 months ago)
I see what you did there. Algol is beautiful and fortran is in use ;-)
Elite7555 (6 months ago)
In fact, Algol and Fortran were beautiful languages and are still in use for scientific programming, and not only for legacy's sake, but because they are much easier to teach than C++ and they are better suited for certain numerical operations.
ronP __ (10 months ago)
Alexey Lyahov (10 months ago)
This is highly educational! Thank you
John Appleseed (10 months ago)
I believe this guy takes advantage of a subset of programmers (or aspiring programmers) who are desperate to escape complexity and are also vulnerable to vague promises of "a better way". He is right about one thing, though. Procedural programming never "died". It's used all the time and is entirely appropriate sometimes, just like the other paradigms. I'm all for pushing the boundaries of what it means to program, but this guy often revisits things which have been thoroughly tested over the decades; the strengths and limitations of which are well known, but he's presenting it like it just might be the magical solution to your complexity ills! He's a decent story-teller, but he doesn't have any concrete solutions.
Phil Adams (7 months ago)
Yeah, this talk starts out great but kinda goes nowhere. Well, it does go SOMEWHERE, just off course a bit. He's a great speaker though and has some other good talks on YouTube.
John Appleseed (10 months ago)
+noxabellus I can see that and it's a good point, but I also hear loads of talking without much content. He dances around one common sense idea for an hour essentially restating his case over and over, alluding that when he finally gets to the point he's going to reveal that 'one simple trick'. Of course we know there's no simple trick, but that hook is powerful and I think he knows it. Anyway, you took away a good message, so maybe it's not as slimy as I think.
noxabellus (10 months ago)
Quite a different take than I had. It seemed to me he was doing just the opposite, and saying "All these crazy 'new' solutions youre struggling with for complexity arent actually new and if you knew the foundation of the ideas you might be better able to achieve your goals"
Min Luchs (10 months ago)
the hardware architecture with registers fits to stateful procedural programming. Neumann messed it up I guess. oop + procedural programming crap. each object having his own api. so you learn each time everything from start. dynamic language makes it even worse. Why is python and golang so popular?
marko tikvic (4 days ago)
Everyone who read this comment is now dumber. Thanks.
Lothar Scholz (5 months ago)
Van Neuman is just about having code and data in the same address space. It has nothing to do with what you talking.
boptillyouflop (5 months ago)
Hardware just implements whatever is fast (which is why hardware CPUs are all the same nowadays for a given CPU speed). How did Neumann mess it up? Personally I view OOP as just an extension of procedural programming... Especially C++ style OOP. Basically the one extension to procedural that isn't slow to process and is relatively well matched with real problems and easy to understand (compared to functional). If you're not doing OOP as extended procedural programming, IMHO that's a red flag for having overengineered your solution.
moofymoo (8 months ago)
OOP alows to write more robust-idiot proof code. You don't want idiots to mess with registers/global variables/goto in procerural code and then blame you for errors. In ideal world, where all programmers know what they are doing, there would be no need for antipatterns and extra safety nets.
Clingfilm Productions (9 months ago)
Golang isnt object oriented
toferj (10 months ago)
What's with the crack about Americans counting floors in a hotel "wrong"? Why do so many people try to make me feel bad about where I was accidentally born? I can't help that we use imperial instead of metric, or spell some words differently, or any other stuff. Why do they think it's funny to take the piss out of us because of stuff that we can't really control? Well, I apologize, sir. I'm dreadfully sorry that I was born in America. I'm not particularly proud of it. But thanks for poking me in the ribs (you and others like you). I'm just tired of hearing this kind of thing. I consume a lot of British media online, and I this kind of thing happens a lot. I'm just tired of being made to feel bad for where I was born.
Ko- Jap (4 months ago)
Chris Jordan 2018 sensitive American is a must to find on YouTube .... Stop bitching nobody cares
Sean Ramey (5 months ago)
+Chris Jordan While I can see were you are coming from, you can't just expect others to keep opinions and certain thoughts to themselves because they might offend somebody. You know, there is something great about being born in the U.S., and that is that we have so many rights that we take for granted sometimes, such as Freedom of Speech. And I think others have left some good advice, so I'll end my comment here.
noxabellus (7 months ago)
This is only hilarious because you'r probably one of those people who goes around calling other folks snowflakes.
Delix (9 months ago)
Ryan M (10 months ago)
Nah, he's free to say what he likes. If it had a negative effect on you then choose not to watch him. There are plenty of speakers that don't make jokes at the expense of sensitive Americans.
tOmzz4video (10 months ago)
Very good talk!
Cees Timmerman (10 months ago)
Nice talk. I love how you leave out the semicolon clutter, but suggest you oneline the "goto fail" style at 28:52.

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.