Hacker Newsnew | past | comments | ask | show | jobs | submit | djmetzle's commentslogin

>Generally, the burstier your workload is, the more cloudy your architecture should be.

Well, crap dude, that's the web!


Meh. Is this a hot debate still?

No mention of Ruby or smalltalk in this post, which i think of as "true" OO languages, down to the runtime. The ruby object model has its merits! Sandi Metz's POODR is a fantastic intro into OO _and_ a compositional approach to design.

FP vs OO is always a false dichotomy for sure. Actors and messaging appear in FP languages. Inheritance surely has nothing to do with OO. Inheritance means nothing for data, and it's almost a bug to extend Record types.

In short, this post seems to rage against inheritance and blind use of design patterns, not the spirit of OO. But the post also qualifies that "that is what an OO advocate would say".

Consider Typescript. The same program can be written with `class`es, or as a module of "loose" types and functions. Really, lets pick a mix that best represents the problem we're solving? I think OO can be a _useful complement_ to FP and other paradigms.


It is really weird in 2020 we are still seeing those largely ideological essays against OOP.

The solution is simple, there are tons of languages to use today in a single service/application. Just create your own and put it on the market for validation, if OOP or not is really at the center of productivity then it will be addressed.

Otherwise, I really don't understand the point of such rant posts, feels like marketing and personal flexing.


I only played with Small talk in school as it was before my time but it was great. As I am working at a large Ruby shop currently, Ruby is a lovely language. Ruby really does solve many of the issues I had with Java. Its a very elegant language. I think the behavior of any object taking messages is great, though thats not used much in professional code it seems. I think more people should give ruby a shot.

I do wish it were a bit faster ,but hopefully truffle ruby, sorbet, yjit, etc. can put in the work to fix that.


I completely agree with this. I love writing functional Java. The issue is mutation, not OOP


Would you have any resource on functional Java? My experience with 8 and onward is better for sure. I find myself writing more robust filtering / map-reduce logic. But that’s kind of it.

For instance I don’t feel like function are first class citizen still. ( I almost never user higher order function in Java, even if it’s possible )


Effective Java [0] is the single most important book I can recommend for any Java programmer. This article [1] gives an overview of some of the primitives you can use for writing functional Java. Lombok [2] is a very common library that makes writing functional Java much more ergonomic with its `@Value` annotation, but that might not be needed anymore with Java 14's Record types [3].

The book Clean Code [4] helped me a lot to really learn how to write clean Java, and many of these ideas directly translate into writing good functional code. One of the key takeaways was just how small functions should be which incidentally is a great thing to learn when functions are your main unit of composition.

Java isn't a purely functional language, so you obviously will always have some impurity regarding state/mutation. I personally try to do the following: 1. Keep all state in some top-level class and let everything else be immutable 2. Nearly every class I write is immutable 3. Follow common OOP principles like SOLID 4. Write reactive code with heavy use of Optional and Streams

Here's [5] an example repo of board game written using those ideas.

[0] https://www.oreilly.com/library/view/effective-java/97801346... [1] https://www.baeldung.com/java-functional-programming [2] https://projectlombok.org/ [3] https://www.baeldung.com/java-record-keyword [4] https://smile.amazon.com/Clean-Code-Handbook-Software-Crafts... [5] https://github.com/harding-capstone/logic


Thanks for your answer, I think I’m stuck with Java for the time being but I least I now cater to a modern codebase. I think it’s … alright. But I miss the function being truly a first class citizen.

Those advice ring familiar or interesting. I need to give effective Java a second look. It’s been year and I’m a different dev now.


God. Those example how to archive currying or composition are painful to read. Not wonder why I never write code this way in Java. Still. I want to be more diligent in that domain because I know it pays off down the line.


Outstanding!


Oh no. oh no no. Do you have examples of languages without the usual local scope binding semantics?

I think the example here is misleading and causing confusion.


I believe Wolfram Mathematica has this terrible global scoping by default.

It's not exactly a language that programmers refer to often, as it's not really general purpose, but I had to do some work with MRI data in it and I hated it mostly due to the scoping.

An "I spent a decent bit of time rewriting the entire lab's codebase in python" type of hate.


Javascript and C.

Neither are considered pinnacles of language design.


Javascript requires explicit variable declaration if you're bringing it to a new scope, though. Which is to say:

    var s = "Geeksforgeeks";
    function f_global() {
        s = "Me too";
    }
    // is different from
    function f_local() {
        var s = "Me too";
    }


I like that better (and I realize I might be alone!). But I don't like that you can declare a global variable in a local function by omitting the var. It's a similar needless ambiguity and frankly much more prone to errors than the python local variable initialization. At least there is strict mode.


Have you tried not buying their shit?


> I think modern "Docker"'s security properties are underrated†

100% agree.

The docker/CRI-de-jour (by default) strips off many "dangerous" system capabilities. By default a pid on linux gets something like over one hundred system capabilities, and most container runtimes strip that down to around 50. Those number are not exact.

Stripping down the system level capabilities of your workload is assuredly a security improvement over running that workload "bare metal" on the system.

Ref: https://www.redhat.com/en/blog/secure-your-containers-one-we...


Truth! Deep work and focus is difficult, expensive with continuous meetings and notifications. So the OP is extra right! Cutting through the noise looks like magic now.


Should be an interesting post-mortem...



That's great!


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: