14 ms·
John Carmack on Functional Programming (2013) [video]
- cthulhujr 9y agoI really like John's perspective on things, he can take a listener or reader from the most abstract concepts to the nitty-gritty without losing focus. He's a tremendous asset to the programming world.
- ksk 9y agoI agree with the second part of your sentence. I have watched every single one of his talks, and while I find them entertaining, I don't think his brain-dump style of communication is appropriate for teaching/instruction (to clarify: I use his talks as a springboard for my own discovery, not as a terminal point to aggregate knowledge).
- waivek 9y agohttps://youtu.be/lHLpKzUxjGk https://youtu.be/lHLpKzUxjGk I disagree. See the above link for a lecture where he describes the difficulties in VR in a manner that anybody with minimal programming experience can understand.
- babuskov 9y agoIt actually starts here: https://youtu.be/1PhArSujR_A?t=2m7s https://youtu.be/1PhArSujR_A?t=2m7s
- ballpark 9y agoShould add (2013) and [video] to the title
- keymone 9y agothis is a best video to explain to your C++ friend why functional programming is worth it even in gamedev world.
- pjmlp 9y agoC++ has been getting functional programming goodies since C++11. Nowadays with C++17, functional programming in C++ is a common talk subject at C++ conferences.
- keymone 9y agothat's nice, but generally speaking the mindset is still very much imperative.
- pjmlp 9y agoWell, it is still a huge fight to get many devs to stop writing "C with C++ compiler" style anyway. The C++ community that cares about C++Now, CppCon, ACCU kind of material, does care about applying functional programming ideas to their daily coding.
- f00_ 9y agois it bad that I prefer C to all the shit in C++? Now I don't even write C/C++ regularly, so my opinion is probably shit. But I really like the simplicity of C over all the features of C++.
- pjmlp 9y agoWhat is so simple about more than 200 documented cases of UB and all the ways one can write unsafe code without even knowing about it? C++ has stronger type safety, offers the libraries and language features to only go down to C like unsafe coding as last resort.
- laythea 9y agoC + classes does the job for me. I hate decoding code - that's the compilers job!
- ece 9y agoI wonder about the present state of the functional projects he talks about and is currently working on. A bit old, but good video talking about FP and static typing from a veteran perspective. Would like to see a conversation between Sid Meier and Carmack, the modern Civ engines seem to have made some strides in stability methinks.
- jandrese 9y agoInteresting that he ran into friction exactly where you would expect him to. He was talking about having the AI scripts running in different purely functional threads. Later (around 21 minutes in) he mentions what happens when two AIs decide to move to the same place at the same time, and has not figured out the solution. Of course parallel programming is easy if you ignore the data dependencies, but eventually you run into unavoidable dependencies and your clean elegant system has to pick up some smell.
- ece 9y agoHe talked about a whole FP-powered architecture to solve this.
- sololipsist 9y agoMotivated reasoning. He prefers imperative programming (or something other than functional programming), so he hears the "criticism" without hearing the solution. I mean, of course he physically hears both, but one is prominent in his consciousness. It doesn't matter that there is a solution, he heard what he needed to hear to get the evidence he needs to maintain his bias, and shuts off his frontal lobe. To be clear: Everyone does this. I just think it's interesting.
- RUG3Y 9y agoYou can train yourself to recognize this pattern in your own behavior.
- sololipsist 9y agoMhm. I try to. Why? Are you implying I prefer functional programming? I don't. I don't have a horse in this race.
- RUG3Y 9y agoNo, I was commenting on statement, "everyone does this". What I was trying to say is that with effort, you can begin to identify times when you are biased toward a certain thing (in this case, different programming styles), and consciously choose to leave your emotions out of the equation.
- pmarreck 9y agoHe wrote a very good piece here: http://www.gamasutra.com/view/news/169296/Indepth_Functional_programming_in_C.php http://www.gamasutra.com/view/news/169296/Indepth_Functional... on the same topic (is it in fact the same?)
- seanalltogether 9y agoI come back to this quote over and over when talking about desktop and mobile apps/games, especially since they tend to be highly state driven view collections and devs are always trying to come up with DRY patterns to bury important features in subclasses or helper utils. > A large fraction of the flaws in software development are due to programmers not fully understanding all the possible states their code may execute in.
- pmarreck 9y agoThis is also simultaneously a strong argument for unit tests (which encode knowledge of that state into a proof of sorts). The limit of a programmer is his/her brain's ability to contain all these possible states. Bugs always come from missing some mental modeling of state or having a flawed conception of it, either at the point of design, the version 1, or the rewrite. OO just buries that state "elsewhere", so things seem easier superficially to contain mentally (but the state is still there, ready to get corrupted and pounce on you). FP makes the state explicit, so you're forced to deal with it at all times (this perhaps not uncoincidentally also makes FP easier to unit-test AND reason about). If managing that state upfront becomes unwieldy, then that becomes a good code smell/indicator that your design is suboptimal. The upshot of all this is that I think that using FP in conjunction with unit-testing reduces bug production by some statistically-significant amount, especially as a codebase grows. We definitely need more empirical data about this, though. But that's what my intuition says.
- grogenaut 9y agoone of the hard things about game dev and testing is that there are all sorts of bits of code that don't really have strong "success criteria". A lot of it comes down to "did that feel good" or "does that look better" which is very hard to quantify in unit tests. However I think there's also a huge swath of code in games that can be unit tested. Scorekeeping systems, ai evaluation trees, etc. The industry as a whole has much more of an integration or manual testing bent focus than a unit testing one. I will say that coming from a no tester all dev unit / integration test world to no automated test, 30-120 high skill manual tester world (30 gameplay testers, every other employee using new builds 2x daily), there is definitely something to having lots of really good manual testers with very short feedback loops. People noticed bugs that were hard to test for within 10-15 minutes of checkin on a regular basis. Really if I did a studio I'd have both but then I'd likely be spending too much money and go out of business.
- deleted 9y ago[deleted]
- vog 9y agoEDIT: Why all those downvotes? Are famous developers not supposed to criticized on HN? While John has a lot of interesting things to say, the presentation is awful, almost an imposition to the audience. There's not a single slide, or any repetition to clarify structure, or any notable gestures to make up for that. A simple overview, just a damn simple list of keywords, would already go a long way. That would add a lot of structure and would make the talk so much easier to follow, especially for non-native speakers. Just because one is so much respected by the audience that they will tolerate everything, one should not act like the audience will tolerate everything.
- rootlocus 9y agoThis was a keynote at a Quakecon, a conference for game players, not a technical presentation for software developers.
- savanaly 9y agoPersonally, I watched it with rapt attention throughout and I'm eagerly anticipating having time later to do so for the other 6 parts of the keynote. Can't remember the last presentation that captured me so. I think he is a very good public speaker and the talk did not meander and was not hard to follow in any way. I did crank the playback speed up a lot though, which helps considerably (I'm not sure I would enjoy it half as much if it were live, where of course I have to hear it at 1x speed).
- saganus 9y ago
- zerr 9y agoI guess we all had that FP click at some point in our lives, but then we got back to our regular (imperative) flow, hopefully as better engineers :)
- yogthos 9y agoI got that FP click, switch to Clojure, and pretty happy with that move 7 years later. :)
- scierama 9y agoTL;DR Famous game developer take an hour here and there and "makes himself" do "some stuff" in Haskell, looks back through some old code on another project that was written in a functional style and forgotten about; forgetting all the other working code that was forgotten about because FP is being discussed so why not and declares that FP is really good. Haskell disciples on HN dig out this video which mentions FP among other unrelated topics and post it on HN as the definitive reason why all other programming methods should be abandoned in favor of FP, _because Carmack_.
- asdfnn88 9y agoCommunity cynic gets meta in sarcastic tone, not realizing it's undermining discourse, not contributing to. Outcome generally being that community cynic can carry around "I'm so smart" feeling all day.
- bmc7505 9y agoHas there been any progress on garbage collection since then? He discusses GC in games starting here: https://youtu.be/1PhArSujR_A?t=1443 https://youtu.be/1PhArSujR_A?t=1443
- vog 9y agoWhile he says a lot of interesting things, it is too bad he is really just sitting and talking. No slides, gestures or any other facilities. Those would have brought more structure into the talk, making it easier to follow - especially for non-native speakers.
- epigramx 9y agoOr more distracting and annoying.
- JohnCarmack 9y agoI am aware that my presentations aren't optimal for communicating targeted information, and it does weigh on me more and more as the years go by. So far, I haven't been able to justify to myself the time required to do a really professional job, so I just show up and talk for a few hours. I like to think there is some value in the spontaneity and unscripted nature, but I don't kid myself about it being the most effective way to communicate important information. I'm taking some baby steps -- I at least made a rough outline to guide my talking at last year's Oculus Connect instead of being in full ramble mode.
- tosh 9y agoMight not be the easiest if you intend to get a certain thought or point across but I really enjoy the format. Reminds me of long-form radio shows.
- dgritsko 9y agoWhile this may be true, please don't let it cause you to shy away from "full ramble mode" when the opportunity presents itself! I know I speak for many when I say that I have learned much from hearing these sorts of talks of yours over the years. Your willingness to share your wealth of experience is inspirational, regardless of the format.
- bluejellybean 9y agoAgreed, full ramble isn't something many people do well and it's fun too watch. Random but useful information will fall out of peoples brain and it's great!
- joncampbelldev 9y agoJust to say, from my perspective I love your talks, zero distractions, just a long cogent train of thought to follow. Please don't feel the need to make too many changes.
- treebeard901 9y agoYour contributions to computing over the years more than outweigh any lack of preparation for a presentation.
- zengid 9y agoThe thing that's interesting about Haskell is that lazyness had a payoff of leading to the discovery of monad-based IO [1]. [1] https://youtu.be/re96UgMk6GQ?t=31m22s https://youtu.be/re96UgMk6GQ?t=31m22s