Man, I’ve had this idea in my head for more than a month now (luckily I wrote it down, too), waiting until the day I wrote this post. I didn’t write it because I was busy with the move and new job, but now things are finally settling down!
Here’s the thing: When you really dig into it, proper object-oriented programming and functional programming are pretty similar. The biggest difference is that object-oriented programming likes to use encapsulation to hide the real data behind facades of objects – requiring you to define methods attached to the type that know about private details – while functional programming is quite up front about it all – making it so that you generally get switch-like structures (but WAY better) that allow you write one function to handle all of the different types. Continue Reading
Disclaimer: This is going to come off a bit ranty. I’m not as frustrated by the “problems” I bring us as it sounds; rather, it is used to emphasize why my thought processes did what it did. I’m not even going to be using header titles, which is weird for me 🙂
I’ve had a recent thought process about calling functions. It has been ceaselessly frustrating to me how functional languages (and even other languages at times) accomplish a certain goal.
That goal is chaining calls. Continue Reading
When I first started learning python and read about how they do class methods, I was a bit thrown off. To be an object-level method (rather than class-level, like Java
static methods), the first parameter needed to be
self. Technically, you could name it whatever you wanted, but the first parameter was supposed to be assumed to be an object of the same type as what you were working on, and it is convention to call it
I was confused. Up until then, I’d marveled at how python kept everything more concise than pretty much every other language that I’d worked with. Now they were putting in something that required extra typing. It took a while to understand why it was even necessary, especially since it was a little while yet before they even showed class-level methods. Then I realized that they would need something to distinguish between the two, and pretty much anything you did to accomplish that goal would require extra typing. So I let it go. Continue Reading