Spyke

Replies

Comment on

What is OOP, really? Why so many different definitions?

You're getting a lot of conceptual definitions, but mechanically, it's just:

keeping state (data) and behavior (functions) that operate on that state, together

At minimum, that's it. All the other things (encapsulation, message passing, inheritance, etc) are for solidifying that concept further or for extending the paradigm with features.

For example, you can express OOP semantics without OOP syntax:

foo_dict.add(key, val)  # OOP syntax

dict_add(foo_dict, key, val)  # OOP semantics

Comment on

TIFU by not using objects in my object-oriented programming coursework

Reply in thread

If you used good objects, you'll only have to make the change in one place

IMO that's generally a retroactive statement because in practice have to be lucky for that to be true. An abstraction along one dimension -- even a good one, will limit flexibility in some other dimension.

Occasionally, everything comes into alignment and an opportunity appears to reliably-ish predict the correct abstraction the future will need.

Most every other time, you're better off avoiding the possibility of the really costly bad abstraction by resisting the urge to abstract preemptively.

Comment on

Git Things

A title as uninformative as the single . commit messages he suggests writing.

Bare minimums of typo, refactor, whitespace, comments are barely any effort -- less than the thought it takes to name variables and functions.

I really can't agree with completely meaningless messages like minor and .

games

Comment on

ISPs can charge extra for fast gaming under FCC’s Internet rules, critics say

speed up certain types of applications as long as application providers don't have to pay for special treatment

Maybe they mean by doing things like giving slight priority to real-time application traffic like VOIP over streaming over websites vs file transfers, like how home routers can?

Don't think that should be something to charge people more for, though. They're not even able to deliver on their own advertised speeds.

Comment on

Push Ifs Up And Fors Down

Seems more applicable to an imperative style, and IMO even still the advice is too dependent on special/actual case details to be generally applicable as a "rule of thumb".

This is just one specific example amongst many of how redundant logic could be simplified because sometimes the branch is an implementation detail and you want to push it down, and sometimes it's not and you want to push it up.

Comment on

1 hour in Java

Reply in thread

I find it's possible to operate Python as a statically typed language if you wanted, though it takes some setup with external tooling. It wasn't hard, but had to set up pyright, editor integration, configuration to type check strictly and along with tests, and CI.

I even find the type system to be far more powerful than how I remembered Java's to be (though I'm not familiar with the newest Java versions).