4 Programming Paradigms In 40 Minutes

  Рет қаралды 486,867

Coding Tech

Coding Tech

Күн бұрын

One of the most important lessons I've learned is that programming languages are tools and not all tools are good for all jobs. Some tasks are easier to solve functionally. Some are clearly suited for OO. Others get simpler when you use constraint solving or pattern matching.
Let's go on a whirlwind tour of 4 different programming languages emphasizing different programming techniques: OO, functional, logical, and procedural. You'll leave this talk with a better understanding of which languages are best suited to which types of jobs and a list of resources for learning more.
EVENT:
RubyConf 2017
SPEAKER:
Aja Hammerly
PERMISSIONS:
The original video was published with the Creative Commons Attribution license (reuse allowed).
CREDITS:
Original video source: • RubyConf 2017: 4 Progr...

Пікірлер: 524
@123userthatsme
@123userthatsme 5 жыл бұрын
2:49 Objected-oriented programming w/Ruby 10:48 Functional programing w/Racket 19:46 Logic programming w/Prolog 32:08 Procedural programming w/Assembly
@stevegreatt
@stevegreatt 5 жыл бұрын
Thank you very much, you made my life much easier :)
@rifkyari6220
@rifkyari6220 4 жыл бұрын
thanks for your kindness
@DeadPool-pf1km
@DeadPool-pf1km 3 жыл бұрын
Tysm
@chudchadanstud
@chudchadanstud 3 жыл бұрын
thank you
@professionalshahbaz8655
@professionalshahbaz8655 Жыл бұрын
Thank you man you saved my 40 mins ❤️
@VOID-nq4oq
@VOID-nq4oq 3 жыл бұрын
13:15 "math is not particularly interesting on its own" *angry mathematician noises*
@VOID-nq4oq
@VOID-nq4oq 3 жыл бұрын
@@JinnGuild good
@terrymiller111
@terrymiller111 2 жыл бұрын
There are a select few who love math for what it is. Most love it for what it can do, or they "hate it".
@MrHatoi
@MrHatoi 5 жыл бұрын
After going through LISP and Prolog I was actually relieved when assembly came up!
@writingpanda
@writingpanda 6 жыл бұрын
I love this talk. She did a great job with this.
@ViktorEngelmann
@ViktorEngelmann 6 жыл бұрын
23:00 The :- in prolog is a logical implication from right to left, not left to right.
@KbIPbIL0
@KbIPbIL0 6 жыл бұрын
wow now it actually made more sense to me :) thanks
@alurma
@alurma 4 жыл бұрын
Oh, thank you! Now i understand the example at 31st minute
@solitone
@solitone 4 жыл бұрын
that’s right. “if A then B” means “A implies B”, not “B implies A”.
@amateruss
@amateruss 6 жыл бұрын
If you are wondering what CS grads can do, this is one of the most prominent examples there is. They eat fundamental concepts for breakfast.
@theblackhundreds7124
@theblackhundreds7124 5 жыл бұрын
You must be from outside of California where jobs aren't in massive quantity for programmers. I see alot of programmers from CS degrees who simply dont have such basic concepts down. Sadly, I have known plenty of CS degree indivduals who sadly never took the time to do this and kind of just treated these classes like general ed (memorize and forget momentarily after test and semester)
@kirangouds
@kirangouds 5 жыл бұрын
@@theblackhundreds7124 true
@adrianbundy3249
@adrianbundy3249 4 жыл бұрын
@@theblackhundreds7124 Unfortunately, that is what at least 2-4 year schools I have had experience seem to do. They have a series of general criteria they want the students to learn, in a somewhat tight time-frame, and you test them for that. There is no emphasis on a deeper or better understanding, they leave that to the student (who usually doesn't feel the inclination to do too much extra with all the other large bits of course-work for other classes). I think how financial aid and government laid down dos-don'ts has gotten in the way for a lot of how these colleges operate, and not for the better.
@Nemesis816
@Nemesis816 4 жыл бұрын
But they utterly fail when presented with a real world problem to solve during a job interview. CS Grads are plagued by the illness of ivory tower thinking. It’s so comfortable up there, please don’t throw us in the cold water.
@nickbrutanna9973
@nickbrutanna9973 4 жыл бұрын
This is what they SHOULD be able to do... But most schools are too busy running up the tab on their student loans and indoctrinating them into the liberal cult to actually teach them.
@iAmTheSquidThing
@iAmTheSquidThing 6 жыл бұрын
This was actually pretty fascinating. I kind-of want to learn a logic programming language now.
@greenghost2008
@greenghost2008 6 жыл бұрын
Object Oriented ones are the simplest imo
@SamBIllium
@SamBIllium 6 жыл бұрын
Try Haskell. You can basically do all the logic stuff Prolog can do (like pattern matching! Yay!) plus a lot of really neat functional programming things. It will break your brain in a good way.
@iAmTheSquidThing
@iAmTheSquidThing 6 жыл бұрын
Sam MacKinnon Yeah, I've learned a bit of Haskell, and got quite into the functional way of doing things. So you're saying it can be used as a logic programming language?
@SamBIllium
@SamBIllium 6 жыл бұрын
Yeah, I think if you take advantage of pattern matching, you can do a lot of the same things -- I took a course where we learned Prolog in the first month and a half and Haskell for the second half, and a lot of the Prolog logic ideas could be carried over and expanded on in Haskell. That being said, I clicked into the functional stuff more than the logic stuff, so it may just be that I understood Haskell better than Prolog :P
@timh.6872
@timh.6872 5 жыл бұрын
Sam MacKinnon Using Haskell as a logic language is less than ideal. While it looks like they have similar features, their fundamental understandings of computation is vastly different. If you really wanted to do logic programming with Haskell, you'd use the type system as a theorem prover, which it was not designed for. An illustrative example is Aphyr's "Typing the Technical Interview" post.
5 жыл бұрын
Long time ago, about twenty years, I had to solve the same problem with the same language (PROLOG) at the university. Many things have changed but I never thought to find the solution 20 years after.
@KoltPenny
@KoltPenny 5 жыл бұрын
You missed the opportunity to say "vs. Infix Postfix"
@hafsaryuzaki3295
@hafsaryuzaki3295 3 жыл бұрын
hahahahaha
@alexismandelias
@alexismandelias 3 жыл бұрын
That was amazing
@csbnikhil
@csbnikhil 2 жыл бұрын
Infix Postfix vs.
@markstevens7699
@markstevens7699 2 жыл бұрын
Missed or avoided
@KoltPenny
@KoltPenny 2 жыл бұрын
@@markstevens7699 Good question
@surohittandon6082
@surohittandon6082 4 жыл бұрын
Unbelievably good talk. As a junior MLE looking to learn more about programming fundamentals she crushed it.
@MadpolygonDEV
@MadpolygonDEV Жыл бұрын
Kind of appreciate C++ which doesnt force you to use a certain style and allows you to pick the best of each
@j-r-hill
@j-r-hill 5 жыл бұрын
This is only from March, but I've referred to this video a number of times already. Great presentation!
@spicemasterii6775
@spicemasterii6775 5 жыл бұрын
Amazing talk! I totally didn't expect this. I didn't even know language like Prolog exists. Thank you. Learned a lot
@MidnightSt
@MidnightSt 2 жыл бұрын
I did know it existed, and I did know the philosophy behind how it's supposed to work, and I did try to learn/understand its basics some time ago... and failed. This talk succeeded. :)
@amypellegrini1732
@amypellegrini1732 5 жыл бұрын
This is such a clear-cut explanation. Awesome
@TE89
@TE89 6 жыл бұрын
Loved this talk
@dskinnerify
@dskinnerify 6 жыл бұрын
Really really well done. I watch a lot of videos like this and this one is a gem.
@dimkir100
@dimkir100 5 жыл бұрын
Indeed this is a true gem! Sadly most of videos which public sees are just “recipes” on language syntax or framework, whereas this presentation marvellously shows cross paradigm programming and unlocks your mind from being locked onto syntax. A++ ps. I also like Kevlin Henney s videos : he also looks at code in more profound and conceptual way rather than just syntax.
@monk_mode8273
@monk_mode8273 4 жыл бұрын
Thank you for uploading this video! It's really awesome and makes things very clear!
@9to5Magic
@9to5Magic 5 жыл бұрын
Nice. That's the clearest explanation of Prolog I've seen.
@RealToughCandy
@RealToughCandy 6 жыл бұрын
Wildly useful. Thanks Aja and Coding Tech.
@IOwnThisHandle
@IOwnThisHandle 6 жыл бұрын
Coding Tech did nothing but steal this video from some where else.
@RealToughCandy
@RealToughCandy 6 жыл бұрын
It's nice to meet you too, Bob. I hope you're having a nice day.
@xynyde0
@xynyde0 6 жыл бұрын
+Bob , there's something known as Creative Commons Attribution license.
@cupajoesir
@cupajoesir 5 жыл бұрын
@Bob It's called a curated list. And AFAIK Coding Tech never posts without authorization from the source if the license does not allow re-posting. And if you still want to piss all over the Cheerios you can go watch the original, it's linked to in the Description.
@ThomasGodart
@ThomasGodart 4 жыл бұрын
Excellent talk & pace, great stage presence, neat examples. Thanks very much 👍 Appreciated
@righton3730
@righton3730 6 жыл бұрын
Excellent stuff! Thanks for sharing!
@im-a-trailblazer
@im-a-trailblazer 4 жыл бұрын
This is one the best tech talks i have ever seen, thanks!
@pjf7044
@pjf7044 Жыл бұрын
After watching this I feel more comfortable venturing onto other languages. I was always afraid it would somehow confused me and lead me to forgetting my primary language but now I see it will only make me better if anything especially if it is another style of programming
@jd42010
@jd42010 9 ай бұрын
Already loving this talk. After having an informal learning experience with code, it is very helpful in understanding the actual concepts of the language more in depth. Reallys helps my understanding of C# and makes me more comfortable venturing into C++
@immortalsofar5314
@immortalsofar5314 3 жыл бұрын
I once saved a massive project by implementing 68K assembler's link instruction (learned on Commodore's Amiga) in CICS COBOL II on a mainframe to create a stack frame. The mainframe guys hadn't even heard of pointers, let alone realised that that was how the Linkage section worked, and COBOL II had just introduced pointer functionality so having 3 lines of code that solved their problem it seemed like magic to them.
@apexhacker346
@apexhacker346 2 ай бұрын
train me
@kwccoin3115
@kwccoin3115 25 күн бұрын
It is just the application programmer. System one used control block and reading dump all the time. Hence “pointer” is there in a sense, as Assembler is the language of s/360 from day one. But the c pointer is not.
@immortalsofar5314
@immortalsofar5314 25 күн бұрын
@@kwccoin3115 Of course it was available in assembler but not COBOL. The linkage section works by pointers but it wasn't until COBOLII that you could use "set address of..." to use them yourself.
@tristanhurley9071
@tristanhurley9071 5 жыл бұрын
The syntax to abstract concept is the key.
@cupajoesir
@cupajoesir 5 жыл бұрын
This chick has mad skills. I have a whole new respect for prolog. Awesome talk.
@rowannieuport3942
@rowannieuport3942 5 жыл бұрын
Where were you when i took my first comp sci courses in the late 70s!! Wonderful talk. I am keen to learn Prolog now.
@Adam-yr2nq
@Adam-yr2nq 5 жыл бұрын
This video is fantastic - brief, informative, and providing extra resources to go in depth.
@NevadaWilliford
@NevadaWilliford 6 жыл бұрын
I thoroughly enjoyed this talk. Some negative comments have been made but I don't think the intent of the talk was for you to follow every example completely and understand every detail. I think the intent is to show that different languages embody different mindsets when solving a problem. More importantly, you can learn new languages and think differently about solving problems and you should.
@chethan1773
@chethan1773 4 жыл бұрын
This what I needed. Finally got something to comprehend these computer heavy terminologies.
@gs8323
@gs8323 2 жыл бұрын
Thanks for this. It helped clear up a lot. Great presentation.
@thekidsacademy3820
@thekidsacademy3820 6 жыл бұрын
Very fundamental! Amazing talk!
@dirkwalker9686
@dirkwalker9686 6 жыл бұрын
Interesting talk. Logic programming was pretty weird but I'm tempted to try it out.
@Elite7555
@Elite7555 3 жыл бұрын
It is mostly used for parsers or theorem solvers or modeling of non-deterministic automatons. And to be honest, it isn't really good for anything else. It is inherently slow, requires huge amount of RAM and it obviously has a significant mental overhead.
@Sttuey
@Sttuey 4 жыл бұрын
My biggest takeaway is I need to avoid languages where the number of brackets required for the most basic thing exceeds the number of fingers I have 😅
@ashleybyrd2015
@ashleybyrd2015 4 жыл бұрын
The biggest takeaway for me was that I need to confront more languages like that
@17rusy
@17rusy 5 жыл бұрын
What a great talk, I know javascript but it gave me a lot of pain when I try to learn java and kotlin to build my first android app. Kind of miss the most fundamental different since I don't take any computer science degree.
@speirnhujin8940
@speirnhujin8940 6 жыл бұрын
at 33:38 I lost my shit. The dude that says ahh in understanding was so unexpected
@tech6hutch
@tech6hutch 4 жыл бұрын
I didn't hear it until you pointed it out
@leonbishop7404
@leonbishop7404 4 жыл бұрын
@@tech6hutch but I did! :D
@powermetallistic2293
@powermetallistic2293 3 жыл бұрын
This is huge.
@darksalmon
@darksalmon 2 жыл бұрын
Near the first 10 minutes I had been doing a search on CAR and CDR. I got pretty much everything but what they said the acronyms stood for. When that guy went "ahhh" in the background much later, it shocked me out of my stupor (mind on tangents) and I heard the echo of what he was responding to. Only because of him did I get to go back and catch what she had just ran past. The object of my heart's desire. I programmed in assembly in college so it was familiar. I just didn't expect it to be mentioned in...was it Racket or Prolog...
@flyingspaghettimonster8612
@flyingspaghettimonster8612 2 жыл бұрын
bruh you got that shit cranked up
@CodeTechandTutorials
@CodeTechandTutorials 5 жыл бұрын
That was excellent! Wish I saw this before some of my college courses.
@sethjchandler
@sethjchandler 4 жыл бұрын
Brilliant talk: I am going to use it to introduce law students to ideas about computation and programming languages.
@coolworx
@coolworx 6 жыл бұрын
What a cool talk. Makes me want to learn LISP.
@leoassis3694
@leoassis3694 6 жыл бұрын
People say that it abuses the characters '(' and ')'. They might as well say there is no other valid flaw. It must be good!
@squirlmy
@squirlmy 5 жыл бұрын
Racket is designed from the ground up to teach functional programming. It is the rename of PLT Scheme, which is inseparable from the DrScheme IDE, which is as much a tutorial app as it is an environment. I assume you know the relationship between Scheme and LISP. Symbolics Inc. and TI and Xerox used to make LISP Machines in the 80s, whose OS was in LISP in the 80s. I believe LISP or LISP-like code was embedded in their CPUs. I used to daydream about getting my hands on one of those.
@nativechatter999
@nativechatter999 4 жыл бұрын
@@casperes0912 All those parentheses are part of the power of Lisp. Lisp's syntax is very uniform, making it easy to write macros that generate Lisp code. These macros make up a large part of the power of Lisp.
@felixthehuman
@felixthehuman 4 жыл бұрын
I think the "that's not really OO" might have started me down the road to finding out about smalltalk/squeak/pharo/SuperCollider.
@MethodOverRide
@MethodOverRide Жыл бұрын
Fantastic video! I definitely want to learn more about Prolog!
@ShinobiEngineer
@ShinobiEngineer 6 жыл бұрын
EXCELLENT TALK ! ! ! REALLY HELPFUL ! ! ! THANK YOU AJA ! ! !
@kornbread5359
@kornbread5359 4 жыл бұрын
Always hated math and scripts in highschool. Total 360 degree turn, obsessed with this stuff now, a beautiful and powerful art.
@saumeeldesai750
@saumeeldesai750 Жыл бұрын
Thank you for sharing your knowledge and thought process :)
@dirtrockground4543
@dirtrockground4543 2 жыл бұрын
13:10 "Math is not interesting on its own" I died inside lmao! Great talk though
@bruhmoment1835
@bruhmoment1835 3 жыл бұрын
Hobbyist with no formal comp sci background. Both func and logic look insanely fun to play around with. Def gonna try it out
@ianprado1488
@ianprado1488 6 жыл бұрын
Wow! Amazing speaker. I hope she does more
@Sivet555
@Sivet555 5 жыл бұрын
I'm in love. That was amazing :)
@Albert-fe8jx
@Albert-fe8jx 5 жыл бұрын
Thank you. Great talk.
@andreagrossetti7589
@andreagrossetti7589 4 жыл бұрын
Awesome, fell in love with prolog
@nove1398
@nove1398 6 жыл бұрын
great video, very informative
@mrlithium69
@mrlithium69 6 жыл бұрын
Wow this was a lot to take in. She's cool for this one
@dkutagulla
@dkutagulla 5 ай бұрын
Ultimate lecture!!! Ma'am you rock - reminded me of my CS307 course at UT. ( loved that course). Your lecture Bought back memories of my undergraduate studies at UTCS before I 'chickened' out to UTECE. ( pan to fire). But UTCS forcing me into polyglotism made me better Computer Engineer. Being in EDA requires you to be a polyglot.
@perkodanny
@perkodanny 5 жыл бұрын
I'm guessing there are a lot of Ruby programmers out there who either didn't go to college or didn't do so well there. It really explains a lot.
@markcollinscope
@markcollinscope 2 жыл бұрын
This is an excellent talk - well presented and fascinating. The speaker is great and has a nice sense of humour. If you're serious about programming you should definitely watch it - even if you've touched on the topics (see "The Red Willow" below) previously.
@Kingromstar
@Kingromstar 5 жыл бұрын
Great talk, very captivating
@kristypolymath1359
@kristypolymath1359 4 жыл бұрын
I think that what many people do not realize is that we *think* in the same way that LISP programming is done. It's actually IMPOSSIBLE to know that you are adding two numbers (in your head) without telling yourself that you're going to add two numbers. Therefore, the operator should come first. Even if someone grabs an arbitrary collection of numbers, and you tell them "okay, now add them", just by saying that have placed higher priority on the operator than you have on the operands.
@yosid1702
@yosid1702 3 жыл бұрын
interesting thought
@ansidhe
@ansidhe Жыл бұрын
I see your point but you do say: „a times b”, which to me sounds more like an infix way, rather than prefix („multiply a by b”). Obviously, whichever works for you :) - I just prefer to visualise infix operators as functions, eg. „add(a,b)” or „multiply(a,b)”. BTW, that looks quite similar to Excel formulas ;P
@danielchuang7218
@danielchuang7218 2 жыл бұрын
Fantastic upload!
@Unit_00
@Unit_00 2 жыл бұрын
I wrote an assembler for nand2tetris assembly. One of the coolest assignments I've had to do.
@akab211
@akab211 5 жыл бұрын
This is awesome!
@murad4485
@murad4485 5 жыл бұрын
very useful talk. she did a great job
@labwax
@labwax 5 жыл бұрын
Awesome talk. I learned a lot :-D
@richardlindgren5875
@richardlindgren5875 5 жыл бұрын
Finally someone who could explain the weird origins of car and cdr.
@sudeepkuchara5287
@sudeepkuchara5287 2 жыл бұрын
in the functional programming part. she taught the lisp how the Sicp teaches scheme, pretty reminiscent. loved it
@stnhndg
@stnhndg 3 жыл бұрын
'Assembly... Very very limiting' Have just remembered my study times when I had to solve problems in Post Machine language... Believe me, assembly is a very very syntax rich language ))
@mikesimms1
@mikesimms1 6 жыл бұрын
I use assembly on a regular basis - now get off my lawn, kids!
@moonbeam2926
@moonbeam2926 5 жыл бұрын
These whippersnappers will never understand the glory of assembly with their new-age techno languages like C and FORTRAN
@tzacks_
@tzacks_ 5 жыл бұрын
@@moonbeam2926 omg man, thanks :D top
@DodgyBrothersEngineering
@DodgyBrothersEngineering 5 жыл бұрын
@@moonbeam2926 Luxury... When I was a lad, I had to assemble my own binary before I could use it.
@csgowoes6319
@csgowoes6319 5 жыл бұрын
You aren't a real programmer unless you physically switch the transistors into the configuration of the code.
@tisurmaster
@tisurmaster 5 жыл бұрын
bro, I remember using stones and seashells to program. those were the good ol days.
@DudeWatIsThis
@DudeWatIsThis 3 жыл бұрын
Shit, what an interesting talk. I wish I was there. But then again, I'm glad I'm not in New Orleans, lol.
@mooks500
@mooks500 2 жыл бұрын
Lol
@bobDotJS
@bobDotJS 3 жыл бұрын
It's really nice of her to use modern languages. That makes this video digestible for even the beginners. Jokes aside, I find this really interesting but I'm obsessed with learning new languages, I would have assumed that most people would be turned off from the talk with such obscure languages used for the examples.
@alexgorodecky1661
@alexgorodecky1661 5 жыл бұрын
Not bad. Especially about Prolog. Thanks
@MidnightSt
@MidnightSt 2 жыл бұрын
40:36 THIS. I mean... thanks, the talk was great, I finally understood the basics of prolog, but... 40:36 THIS... Info about this book existing was such a huge, HUGE BEAUTIFUL GIFT for me... thank you...
@kedarpednekar9582
@kedarpednekar9582 Жыл бұрын
nice lecture for quick review
@cpuwrite
@cpuwrite 3 жыл бұрын
In lisp, "car" stands for "contents of address register" and "cdr" stands for "contents of decrement register."
@davedaley9093
@davedaley9093 3 жыл бұрын
From the register names in the IBM model 704 on which LISP was originally developed. Incidentally FORTRAN was also written for the 704 and it's instruction set weirdness accounts for the odd way memory was laid out in original FORTRAN and for the notorious 3-way branch.
@cpuwrite
@cpuwrite 3 жыл бұрын
@@davedaley9093 It's been so long that I had forgotten about those! Thanks for the trip down amnesia lane! ;)
@jennifermeier3873
@jennifermeier3873 3 жыл бұрын
@FelonyVideos
@FelonyVideos 5 жыл бұрын
This was a great talk. Kudos. I was educated in machine code, assembly, basic, c, b, fortran, cobol, and cpp. I've sent things to space and made machines interact with humans in physical and direct mental ways. I understand why we need higher level languages and object oriented programming, but the fundamental problem of the "task at hand" getting beyond the brain of the programmer remains. The technological singularity is probably the moment we program the perfect programmer. But we can't have the perfect programmer until we have the perfect language. And by language, I mean human language, not programming language. From that, all else should be a trivial exercise for the common reader. We need a new language, one that is perfect, without ambiguity. It's just around the corner, we are almost there. This is scary, to be honest. I sure hope the TS is our servant, and not our master. Agriculture and domestication of animals was an order of magnitude advance for mankind. The industrial age was 2.5 orders of magnitude advance. The TS is an infinity power advance. We can't even imagine what the exponent is. Godspeed, fellow humans. You've been given an incredible beyond belief blessing, if you can keep it in your control. Make sure you always control it!
@Twisted_Logic
@Twisted_Logic 5 жыл бұрын
xu do se bangu la lojban
@FelonyVideos
@FelonyVideos 5 жыл бұрын
@@Twisted_Logic I fully agree!
@FelonyVideos
@FelonyVideos 10 ай бұрын
@@maxmakman2682 I moved into a remote mountain homestead 1 year ago. That probably tells you everything.
@KbIPbIL0
@KbIPbIL0 6 жыл бұрын
omg prolog is awesome as is this girl :)
@bafi29
@bafi29 2 жыл бұрын
Before this talk, I was afraid of functional programing... now I'm also afraid of logical and procedural.
@janAkaliKilo
@janAkaliKilo Жыл бұрын
Procedural is just how any sane person solves tasks - top to bottom. It's just PURE procedural/functional without much abstractions is hard to wrap your brain around.
@chuckmoreland1258
@chuckmoreland1258 6 жыл бұрын
I think I want to learn Prolog... ugh. Great presentation.
@CodingPhase
@CodingPhase 6 жыл бұрын
god i love this video.... but damn that lisp language is ugly
@BrandonOsborn404
@BrandonOsborn404 5 жыл бұрын
I like her presentation style, he organization, and that she's a cat person.
@AhmedMohamed-ke1bn
@AhmedMohamed-ke1bn 4 жыл бұрын
thank you very much you are amazing
@cloudkungfu
@cloudkungfu 3 жыл бұрын
This was the missing piece that helped me understand infix and prefix 💯
@nopnop4790
@nopnop4790 2 жыл бұрын
Hi there! noob over here, still studying OO (C#). I've always used float variables to save data like money, or any floating numbers that aren't really large. I've noticed some of my professors use double instead, but they said it's basically the same thing and not to worry about it for now. I'd like to know why is it a bad idea to use float in the situation described? (saving an amount of money) and why is it better to use int instead of float or double? Thanks!
@joelkronqvist6089
@joelkronqvist6089 2 жыл бұрын
Well I'm no expert myself, but I guess there are two reasons: First, floating point numbers have rounding errors due to their binary representation. For example, in most languages, 0.1 + 0.2 = 0.30000000000000004. This isn't very good when dealing with money: someone would probably find a way to create money from nothing with errors like these, and imprecision is anyways not acceptable in this case. Second, it takes up more room. You will never use more than two decimals with money, and pretty much all floating point types have more decimals, so it is a waste of memory. With integers you can use the memory allocated to your program more effectively. There may be more reasons, but these seem sensible to me.
@Hwyadylaw
@Hwyadylaw 2 жыл бұрын
​@@joelkronqvist6089 You might want to use more than two decimals for money in a number of cases. Floating point values don't really have "decimals" in that way. They are represented in the form sign * significand * 2 ^ exponent. In a single-precision float the sign is 1 bit, the significand is 23 bits, and the exponent is 8 bits, for a total of 32 bits. But yes, the main reason is that floats (unless they're special floats with a base of 10) can't represent every value we might need to store, such as 0.2, and when dealing with money you have to be exact.
@carlospedroza2604
@carlospedroza2604 Жыл бұрын
Fantastic talk! I believe there might be an oversight tough? Assembly language is technically not procedural, right?. It's very low-level imperative, but it is not structured or procedural. Procedural implies subroutines / functions, which are not a feature of assembly languages. Assembly is a paradigm in itself, but it doesn't seem to follow procedural patterns natively? Or which procedural patterns did we see in the procedural examples? Loved everything about this video, but had this thought / nitpick / doubt.
@marcusallen6123
@marcusallen6123 4 жыл бұрын
This is awesome
@sieve5
@sieve5 6 жыл бұрын
You're really smart haha! Ruby sounds cool from a perspective of loving python and javascript but not so much C
@EvenTheDogAgrees
@EvenTheDogAgrees 6 жыл бұрын
Ruby is pretty neat. I'm a Python dev, but I had to use Ruby on Rails for one of my projects. It was quite easy to pick up the basics and get comfortable with it in a short amount of time.
@matt79006
@matt79006 5 жыл бұрын
awesome awesome video.
@srinivaspithani7645
@srinivaspithani7645 3 жыл бұрын
Loved it
@luke_fabis
@luke_fabis 5 жыл бұрын
In the first example, wouldn’t it be more efficient to put a loop around each currency denomination, breaking out when the denomination is greater than the change owed, rather than having one really big loop that goes through a whole bunch of conditionals each time?
@jviper2004
@jviper2004 4 жыл бұрын
12:22 - 13:13, if you just think of (+ a b c d .....) as add(a, b, c, d......), it's not that bad.
@EzyoMusic
@EzyoMusic 5 жыл бұрын
That Assembly code blew my mind as much as the Prolog code did. Way cool!
@Imperial0666
@Imperial0666 4 жыл бұрын
that was one shitty instruction set. it makes today's x86-64 instruction set look high level.
@Zack-xz1ph
@Zack-xz1ph 5 жыл бұрын
nice. I hope one day I can understand everything she is saying
@2tvtv
@2tvtv 3 жыл бұрын
prolog just blew my mind
@patricktalksalot427
@patricktalksalot427 2 жыл бұрын
My brain is melting and I love it.
@Bm23CC
@Bm23CC 5 жыл бұрын
The first ruby program was quite messy> I had the same for a coding interview and I did it in a while loop with an if else if statements and its way easier.
@kizitoonyeagusi2824
@kizitoonyeagusi2824 4 жыл бұрын
Nobody cares... damn!! Show offs... as long as everyone gets the message, dey cool with it ok.
@FredF78
@FredF78 5 жыл бұрын
Correct me if I am wrong but the last example must be some form of quasi assembly? Or is it corresponding to a real architecture?
@pH7oslo
@pH7oslo 5 жыл бұрын
As real as any abstract architecture can be, I guess. It's for the (educational) nand2tetris hack computer - it's been implemented in hardware in a number of ways, but it's not manufactured by anyone (AFAIK) if that's what you're asking.
@ViktorEngelmann
@ViktorEngelmann 6 жыл бұрын
29:48 the prolog code is wrong. The recursive call in the second clause must have R instead of [F|R], because when you put F there, it allows you to "re-use" a coin that has already been deposited. The way it is here, ?- change(5, [2,1,1,1], C). gives you C=[2,2,1], so two 2s, although there was only a single 2 in the available coins.
@ViktorEngelmann
@ViktorEngelmann 6 жыл бұрын
By the way: this also works with 2 lines less: change(0,_,[]). change(S,[F|R],[F|X]) :- change(Q,R,X), S is F + Q. change(S,[_|R],X) :- change(S,R,X). (it is slower though, because it goes through all sub-lists and selects all that have the right sum).
@saurabhverma7366
@saurabhverma7366 2 жыл бұрын
Somehow ruby syntax draws me off. I know I shouldn't be so serious about syntax, but programming languages are primarily designed to aid humans.
@mallninja9805
@mallninja9805 2 жыл бұрын
Minor correction, LISP actually stands for "Lots of Irritating Superfluous Parentheses" Seriously tho, great talk. I really enjoyed the breakdown.
@amorestperpe
@amorestperpe 4 жыл бұрын
Prolog seems super cool. It seems to work like my brain.
@PhilipAlexanderHassialis
@PhilipAlexanderHassialis 5 жыл бұрын
But what happened @39:00 when the sound was "cut"?
@YouLilalas
@YouLilalas 3 жыл бұрын
Philip Alexander Hassialis We will never know.
How To Think Like A Programmer
1:00:07
Coding Tech
Рет қаралды 2 МЛН
Why Isn't Functional Programming the Norm? - Richard Feldman
46:09
Kitten has a slime in her diaper?! 🙀 #cat #kitten #cute
00:28
skibidi toilet 73 (part 2)
04:15
DaFuq!?Boom!
Рет қаралды 32 МЛН
STOP Using Classes In JavaScript | Prime Reacts
14:02
ThePrimeTime
Рет қаралды 209 М.
Programming Paradigms - Computerphile
10:44
Computerphile
Рет қаралды 677 М.
Comparing C to machine language
10:02
Ben Eater
Рет қаралды 5 МЛН
FP vs OOP | For Dummies
8:43
BasicOverflow
Рет қаралды 173 М.
Functional vs Array Programming
30:40
code_report
Рет қаралды 127 М.
Functional Programming & Haskell - Computerphile
9:19
Computerphile
Рет қаралды 655 М.
why are switch statements so HECKIN fast?
11:03
Low Level Learning
Рет қаралды 359 М.
The Worst Programming Language Ever - Mark Rendle - NDC Oslo 2021
1:00:41
NDC Conferences
Рет қаралды 1,3 МЛН
The purest coding style, where bugs are near impossible
10:25
Coderized
Рет қаралды 830 М.
СЛОМАЛСЯ ПК ЗА 2000$🤬
0:59
Корнеич
Рет қаралды 2,3 МЛН
How Neuralink Works 🧠
0:28
Zack D. Films
Рет қаралды 27 МЛН
Creepy Samsung Alarm cannot be turned off 😱🤣 #shorts
0:14
Adani Family
Рет қаралды 1,7 МЛН
Я Создал Новый Айфон!
0:59
FLV
Рет қаралды 3,1 МЛН