General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
Mikko Rantalainen
ThePrimeTime
comments
Comments by "Mikko Rantalainen" (@MikkoRantalainen) on "Functional Programming IS NO BETTER than Object Oriented Programming | Prime Reacts" video.
43:10 The days or even weeks I'm spending in state "I'm thinking more than writing the code" is when there are no good solutions given the existing infrastructure and the task at hand. Only multiple options to proceed but each with various obvious con-sides. In practice, in that case "thinking" is about going through existing programs (searching for something similar and looking for results with pros and cons any given solution had), implementations (typically reading code of some open source libraries to understand how they handle the problematic edge cases), research papers, writing some test code etc. That's the "research" in R&D. I have trouble imagining a coder that just sits there meditating and coming up with a good solution they will finally write. Some call this maintaining a legacy system but I think it also covers making any complex changes to any big system, not matter how old or new the code is. Legacy systems are just typically bigger than newly created (toy?) projects. And you get old hairy legacy systems as a result if you repeatedly try to skip the thinking and research part and always go for the most simple solution you can think of without thinking about the con-sides. Basically: how much technical debt your next change is creating to the whole system? If you ignore the debt, making changes is faster but it will bite your ass later for sure. On the other hand, you don't want to waste time trying to create perfect solution either because perfect is enemy of good and it requires insane amounts of time to create perfect solutions.
4
You test the tests with mutation testing. If mutation testing cannot make a logical change to the project source code without triggering at least one test failure, your tests are good because then all of the code is verified instead of every line executed at least once. Obviously, you cannot do any mutation testing before your tests have 100% code coverage which pretty rarely happens in any project not obsessed with automatic testing.
1
I would define functional programming by saying that it's any language that has functions as first class objects and no mutatable state on variables. As for OOP, I would consider any language OO that has the built-in syntax for function call indirection via object instances in addition to ability to capsulate object related data inside the object (logically or physically). To be worth using, it should allow delegating the implementation to another code; possible solutions include prototype inheritance, class inheritance or maybe even traits nesting only (e.g. PHP Traits). For example, if you write JS code without ever creating any variables (that is, strict mode and only ever use const) your programming style is definitely functional. However, the usual way to use JS is definitely OO procedural.
1
16:45 I think he was talking about Python 2 where print is not a function so there are various limitation where you can write it. The problem was that bad that Python developers decided to make Python 3 a not-backwards compatible language (read: a different language) just because they hated the old "print" that they had created previously.
1
I've been writing software professionally for 20+ years and all I can say is that there are no silver bullets. You can write great code and crappy code with any turing complete programming language. I've yet to see any examples where FP or OOP is obviously better. If you truly don't want to use any libraries and want to write everything from scratch, Haskell style FP may be easier for writing parsers.
1
"When it's done right" is just another variant of "No true Scotman".
1
18:18 I think UML diagrams are one option for visualization of the code you already have. I have never ever seen a case where it has been a good idea to first create UML diagrams first and then generated code based on those diagrams. Whenever somebody asks me to create an UML diagram, I always generate it from code, even if I had to write the code just to generate the diagram.
1