top 50 comments

sorted by: hot top controversial new old
[–] 118 points 10 months ago (7 children)

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.

  • source
  • hideshow 7 child comments
  • [–] 19 points 10 months ago (3 children)

    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.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 2 points 10 months ago (2 children)

    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.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 2 points 10 months ago (1 child)

    Yeah, the problem is the balance. In-house code sucks. Nobody outside the team tests your code. Self-developed code is not battle hardened. You can only use the skills available in your team and especially for specialist topics like databases, security or cryptography having in-house expertise is rare and expensive.

    Using external dependencies sucks. You are dependant on externally developed code and on someone elses skills, quality controls and trustworthyness, and you usually don't have time or ability to really verify any of that. Even a good dependency can get stuck in some kind of development hell (like e.g. OkHTTPClient) and not deliver updates for years, and supply-chain attacks are constant threat.

    In the end both options suck for different reasons and it really depends on the scenario where one or the other is useful. Leftpad is an extreme example, but most options are less obvious.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 2 points 10 months ago

    Well said. I find I have a hard time with trying to get devs who cut their teeth on Node to take a moment and think before just reaching for a dependency. A dependency might be the right move but taking a moment to consider is a bare minimum and most people don't do that.

    I'm trying to keep my panic over how that behavior translates to AI code in check but it's a struggle given human behavior time and time again.

  • source
  • parent
  • [–] 4 points 10 months ago

    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.

  • source
  • parent
  • load more comments (1 reply)
    [–] 65 points 10 months ago (13 children)

    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.

  • source
  • hideshow 13 child comments
  • [–] 5 points 10 months ago* (last edited 10 months ago) (2 children)

    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.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 3 points 10 months ago (1 child)

    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: 

    • what matches the mental model the company has about this
    • what’s the shape of the problem
    • what type of abstractions do we already use
    • what aspect do I want to make available, how is this expected to change?
    • etc

    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.

  • source
  • parent
  • hideshow 1 child comment
  • load more comments (1 reply)
  • [–] 2 points 10 months ago

    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.

  • source
  • parent
  • load more comments (9 replies)
    [–] 51 points 10 months ago* (1 child)

    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.

  • source
  • hideshow 1 child comment
  • [–] 31 points 10 months ago (14 children)

    I feel like I'm the only CS major to have taken a CS focused ethics class

    Would be nice if all engineers had to take ethics

  • source
  • hideshow 14 child comments
  • [–] 16 points 10 months ago

    I'm a CS major who had to take ethics, but the REQUIRED textbook was written by the professor teaching the class. Managed to get through the semester with an A without buying it and called him out in the class survey.

  • source
  • parent
  • load more comments (11 replies)
    [–] 25 points 10 months ago (1 child)

    History of software design would be an AMAZING course.

  • source
  • hideshow 1 child comment
  • [–] 20 points 10 months ago (3 children)

    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:

    • "Just use a better data structure"
    • "My language is a DSL for a faster language" (Polars, Numpy, etc)
    • "My compiler is surprisingly good if I'm careful" (Julia, JVM, etc)
  • source
  • hideshow 3 child comments
  • [–] 12 points 10 months ago

    "Key Search Words 101". Make it quicker and easier to find other programmers solutions on the web.

  • source
  • [–] 12 points 10 months ago

    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...

  • source
  • [–] 11 points 10 months ago
    [–] 11 points 10 months ago (4 children)

    I've never seen a course on functional programming. That would be interesting.

  • source
  • hideshow 4 child comments
  • [–] 5 points 10 months ago

    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.

  • source
  • [–] 5 points 10 months ago (13 children)

    -1 for unlerning OOP

    But

    +1 for Zork

  • source
  • hideshow 13 child comments
  • [–] 14 points 10 months ago (12 children)

    +1 for unlearning OOP

    It's a cult

  • source
  • parent
  • hideshow 12 child comments
  • load more comments (3 replies)
  • [–] 2 points 10 months ago (1 child)

    At what level is SOLID good, and when insanity begins.

  • source
  • hideshow 1 child comment
  • [–] 1 point 10 months ago

    You forgot the most important one:

    CSCI 7999 - logging with cat.

  • source
  • load more comments
    view more: next ›