Computer Science Courses that Don't Exist, But Should
Computer Science Courses that Don't Exist, But Should
Computer Science Courses that Don't Exist, But Should
Computer Science Courses that Don't Exist, But Should
Computer Science Courses that Don't Exist, But Should
History of software design would be an AMAZING course.
It'd be a good idea. Hopefully it'd see an end to those idiots claiming single exit means there can only be one return statement.
Where's
Using Solutions that Already Exist
No, seriously, you don't have to build everything from scratch by yourself. Other people write code too.
It's a double-edged sword and understanding when to re-use and when to re-implement is an art that goes wrong more often than right.
We desperately need to teach people when a 3rd party dependency is necessary and not just optional to save writing a single function (cough left pad cough).
Also when the dependency is really good but other considerations override it being a viable option like security or code ownership.
How we all didn't collectively learn our lesson from left pad baffles me.
Got caught in that trap at my first coding job. Made a sort formula and a sr dev asked my I didn’t just use the array.sort.
My answer: I didn’t know it was there.
Ah, the ever-elusive, mysterious stage in my process - the one I can't ever seem to move much before the "planning" and at least "beginning to implement" stages, and sometimes stubbornly comes even later than that.
I always find it funny to see calls to “unlearn oop”. It’s a tool, useful in some contexts and not useful in others. At some point industry treated it like a silver bullet, and now people are reacting to it by checks notes treating the hot new paradigm as a silver bullet.
learn oop, learn fp, learn logic programming, learn whatever you want. Also, learn when not to use them.
It’s a tool, useful in some contexts and not useful in others.
In my opinion this is a thought terminating cliche in programming and the IT industry in general. It can be, and is, said in response to any sentiment about any thing.
Now, saying what sort of context you think something should or should not be used in, and what qualities of that thing make it desirable/undesirable in that context, could lead to fruitful discussion. But just "use the right tool for the right job" doesn't contribute anything.
In my opinion this is a thought terminating cliche in programming and the IT industry in general. It can be, and is, said in response to any sentiment about any thing.
Sure, I agree it can be. But it doesn’t make it less true that “it depends” is often the answer. As I see it, my job is often to think “what applies in this case”. Including thinking about things like:
Now, saying what sort of context you think something should or should not be used in, and what qualities of that thing make it desirable/undesirable in that context, could lead to fruitful discussion. But just "use the right tool for the right job" doesn't contribute anything.
Sure. I lean towards object oriented design when things represent a simple well known object with a stable set of “nouns and verbs” that are unlikely to change. In my case this tends to be around UI elements or the data layer very basic things, where I don’t care too much about “data transformation”, but want to encapsulate an action (eg. I think being toggleable is intrinsic to a switch, so switch.toggle feels like a stable api and I can design an object like this that others can understand without having to care about the internals)
Some design patterns that come from the oop tradition (not exclusive to oop, but very much part of the toolkit) that I find exceptionally useful. For example, the strategy pattern is something I’ve used often when building things like data exporter and importer tools. I can structure my logic in this way, move all the specific logic to the leaves.
I can’t be exhaustive, but for me oop is all about encapsulation, and so I use it when it calls for that. I think it also makes APIs easy to test.
——
Functional programming I absolutely love. Whenever I’m transforming data, i think in functional terms. Composable functions, immutable data. It’s just a lot easier, and for me it makes it easier to test processes and operations. I tend to lean to this this in a business logic layer. If I can describe operations in a way that we talk about them in the company, and make those units of transformation testable, then bigger processes become safer and auditable.
Another thing from functional programming languages that I love is things like algebraic data types. It just pains me to use a language without sum types now.
——
A while back I used “aspect oriented programming”. That didn’t catch on, but moving some things like logging, event tracking, etc. to aspects makes sense to me. If a language supports function annotations, I /will/ try to move those sorts of aspects to a function annotation.
——
I spent a while doing prolog, and that language is just something else. I wish I had an easy to embed prolog that I could use for constraints on data. This one I don’t “get to mix and match” because multi purpose languages don’t include aspects of it. But thinking in terms of reversing operations (eg. Given this result, what set of constraints produce it) is still a tool that helps me understand how to shape a problem.
——
There’s a lot of nuance to this, more than can fit in a comment, and definitely nuance that doesn’t apply to imaginary problems or problems/sotuations that we don’t share. Also, you and others will probably think about it differently. to me that’s kind of the point, both thinking in terms of a diverse toolkit, and having a team with diversity of thought.
FP has been around a long time, and yes, it is outright better than OOP. Sorry. I write Haskell professionally, and never have I ever felt like something would be easier done in an OOP language. Quite the opposite.
Unrestricted mutation makes programming really hard, and OOP and mutability go hand-in-hand. If you try to make immutable objects, then you're just doing FP with worse ergonomics.
I would humbly suggest FP may seem especially natural to you precisely because that's what you use all day.
An object is a poor man's closure.
A closure is a poor man's object.
These are two sides of the same coin, and both of them miss the point. You should be dealing with scale, and you should use a language that allows you to concisely describe how to compute large amounts of data easily. The best part is that once you start writing APL, you'll feel like a wizard.
FP & OOP both have their use cases. Generally, I think people use OOP for stateful programming, and FP for stateless programming. Of course, OOP is excessive in a lot of cases, and so is FP.
OOP is more useful as an abstraction than a programming paradigm. Real, human, non-computer programming is object-oriented, and so people find it a natural way of organizing things. It makes more sense to say "for each dog, dog, dog.bark()" instead of "map( bark, dogs)".
A good use case for OOP is machine learning. Despite the industry's best effort to use functional programming for it, Object oriented just makes more sense. You want a set of parameters, unique to each function applied to the input. This allows you to use each function without referencing the parameters every single time. You can write "function(input)" instead of "function(input, parameters)". Then, if you are using a clever library, it will use pointers to the parameters within the functions to update during the optimization step. It hides how the parameters influence the result, but machine learning is a black box anyway.
In my limited use of FP, I've found it useful for manipulating basic data structures in bulk. If I need to normalize a large number of arrays, it's easy to go "map(normalize, arrays)" and call it a day. The FP specific functions such as scan and reduce are incredibly useful since OOP typically requires you to set up a loop and manually keep track of the intermediate results. I will admit though, that my only real use of FP is python list comprehension and APL, so take whatever I say about FP with a grain of salt.
I've been working as first a Python and then a Java dev for the last 15 years and I can count the amount of times when I've seen actual OOP on one hand.
I mean, we write "class" at the beginning of our modules and at the beginning of our structs, and we write "interface" at the beginning of our header files, but none of that is actually OOP.
If you use Spring Boot, you are essentially doing C (not even C++) in Java.
You have data-only classes without methods (at best there's a conversion method or something shallow like that) that work identical to C structs. You have service interfaces, which serve the same purpose as C header files. And then you have data-less collections of functions (service/controller classes), which work like .c files.
Nowhere in this whole process are you actually using OOP techniques.
There's a lot of humour in there, but this:
CSCI 3300: Classical Software Studies
Discuss and dissect historically significant products, including VisiCalc, AppleWorks, Robot Odyssey, Zork, and MacPaint. Emphases are on user interface and creativity fostered by hardware limitations.
I'd take that course in a heart beat. I've read some of Atkinson's ideas and thoughts, and the man was deeply sane.
It must be decades now that my LinkedIn background banner is a screen shot of Zork source code.
deeply sane
I hope somebody describes me like this one day.
Hello programmers, electrical engineer here.
I work in MEP design, basically power design for commercial buildings and multi-tenant residential.
I am constantly saying I wish every fucking engineer, architect, interior designer, building manager, etc. had been forced to take a class on project management and accountability.
Curious if some of you run into a similar desire...
It'd be fun to talk shop with the fast code in slow languages folks. I do that for a living. I remember three ways, but I'm sure there's more:
Arguably "we can just put it in docker, and create an auto scaling microservice with a load balancer, behind a CDN for avg request latency" fits this group too. The hoops I have to jump through to get a good user experience on top of our shitty PHP backend are unreal
That's not what I was thinking but I like it! Http caching is pretty magic. Stateless nodes and easy scaling too.
For some kinds of problems you really can't beat varnish and friends. It's how we have Wikipedia, after all.
It's almost always slow is ways that the language choice doesn't matter even a little
"Key Search Words 101". Make it quicker and easier to find other programmers solutions on the web.
I've never seen a course on functional programming. That would be interesting.
It's what the Wizard Book (Structure and Interpretation of Computer Programs) was written for.
I had one. I wish I remembered more of it.
My uni had one. Sadly I couldn't fit it into my schedule because of overlaps and other requirements.
i took two courses on functional programming through coursera. it was based on scala.
-1 for unlerning OOP
But
+1 for Zork
+1 for unlearning OOP
It's a cult
Like everything that's impressive at first sight, but misunderstood because you never go past that first impression.
Why? I find it quite useful.
Have you ever seen a real-world project that actually uses OOP in any significant capacity? I haven't.
When using Java, you might write "class" on top of your structs and modules, but actual OOP with self-contained classes that contain both data and business logic using inheritance and all the other OOP concepts, that's incredibly rare.
I would actually love to take 3300! That sounds fun.
As for 4020, writing performant code in Python typically means calling into libraries that are written in C.
At what level is SOLID good, and when insanity begins.
You have to learn this through suffering. Class would have to be project based.
Missing "how to politely but firmly tell management 'that's a dumb fucking idea'"