Better HN
topnewbestaskshowjobs
Log inSign up

cryptos

1,795 karma · joined Sep 13, 2012 (14y ago) · 645 submissions

Submissions

comment 2y ago · link · parent

This is indeed nice. However, static extension methods would have made this feature simpler (and more generic).

comment 2y ago · link · parent

This is nice for beginners, but the confusion is only postponed, because then you'd have to learn why you need to write a class as a container for static methods and that these methods must be static. So, the Java developers created another special case in the language.

Compare that with Kotlin where you have top-level functions, so that `main` is just like any other function.

comment 2y ago · link · parent

Rego is a DSL and the main purpose of DSLs is to simplify things (compared to general purpose programming languages), so in my opinion Rego is not a good DSL.

comment 2y ago · link · parent

I tried to implement some simpler cases with the policy language, Rego (https://www.openpolicyagent.org/docs/latest/policy-language/), of OPA and found it overly cumbersome. A simple check like "if user is in group A and in group C, but must not be in group C" is hard to express in this language. It would be a trivial task in any somewhat decent programming language (e.g. JavaScript).

I understand why restricting the possibilities with an external DSL might be a good idea, but I consider Rego to be to restricted. I mean, in the the a policy is just a function saying basically "yes" or "no" (I know, it's not that simple with OPA, but it boils down to access yes/no, anyway).

comment 2y ago · link · parent

I doubt that the price will stay that low. Bitwarden has taken a lot of venture capital and someday the investors want to earn some money ...

https://bitwarden.com/blog/accelerating-value-for-bitwarden-...

comment 2y ago · link · parent

Skia is also used by "Compose Multiplatform" by JetBrains. https://www.jetbrains.com/lp/compose-multiplatform/

comment 2y ago · link · parent

But the project configuration has nothing to do with the web framework. You can use Javalin with Maven (and therefore XML), too. And you can use Spring without any XML by configuring the project with Gradle's Kotlin DSL. Modern Java development is not what it was 20 years ago.

comment 2y ago · link · parent

In my experience the web layer is (or should be) pretty thin, so a framework in this layer shouldn't change too much in the overall application architecture.

129.

A Splendid Scala Journey(degoes.net ↗)

1 points · by cryptos · 2y ago · 1 comment

comment 2y ago · link · parent

If the included timestamp doesn't expose sensitive data, then using UUID v7 is a good default, because it has performance advantages on database operations and items might be sorted by ID in a meaningful way, what is sometimes desired (even if I never used it).

comment 2y ago · link · parent

> The repositories include a large amount of intellectual property… connection strings, cloud access keys, blueprints, design documents, [single sign-on] passwords, API Keys [...]

That doesn't really sound like security best-practices would be applied. Why don't they use a credential store?

comment 2y ago · link · parent

Why do people use percent for such big factors? To make the headline more impressive?

comment 2y ago · link · parent

To 2) We need an app that would increase the counter for dropping iPhones automatically ;-)

comment 2y ago · link · parent

A little indicator about technical failures (or groundings) per aircraft model would be nice to have :-)

comment 2y ago · link · parent

Go is so minimalistic that it forces developers to reinvent the same things again and again. Just think about how common certain collection operations are and how easy they are in some languages (e.g. Java, Kotlin, C#, Rust), but in Go you'd write list and for loops like in the last century. This wastes developer time, makes the code harder to understand and adds chances for bugs.

So, this cite applies to Go: “Everything should be made as simple as possible, but no simpler.”

comment 2y ago · link · parent

Do you really think that it would be a good fit? Apple is mostly a hardware company, although this hardware obviously needs some software and a part of it runs in the cloud these days. But at least my impression is that they are not really in the B2B market with professional services.

To enter the cloud market they are pretty late to the game ...

comment 2y ago · link · parent

But that makes it somewhat entertaining :-) Have you ever heard of the German sports club "Bayern Munich" ("FC Bayern")? They've won all national titles since 2013! _That_ is boring.

https://en.wikipedia.org/wiki/FC_Bayern_Munich

comment 2y ago · link · parent

No, they will allow to mark types as explicitly not null (the other way around). The default in Java will still be that everything can be null.

comment 2y ago · link · parent

I feel no desire to use dynamic typing again, as nice as Clojure might otherwise be. While Kotlin is not strictly immutable, it is much better in this regard than Java. Collections are immutable by default in Kotlin (or more precisely you get an immutable view defined by the respective interface) and that is quite useful in practice.

comment 2y ago · link · parent

Java will not have the same level of null safety as Kotlin. Instead Types can be explicitly marked as "not null", so the default is still that every reference type can be null.

comment 2y ago · link · parent

> Null was always a pitfall in Java. It has slightly improved with the controversial Optional type. It’s also why I suggest that everyone use only wrapper types everywhere, instead of primitives, unless they can prove with a JMH test that a primitive provides enough of a performance benefit.

That doesn't make sense at all! Why should one do it without a need? To have NullPointerException with "primitive" types, too?

> Kotlin ecosystem is severely lacking compared to Java. FAANG has first-class support and commitments to Java, like providing JDK with multi-year support commitments.

It is not really needed to provide JDKs or something else especially for Kotlin, because Kotlin basically just uses the JVM (at least if you use the JVM as a target).

> To this day, there are significantly fewer Kotlin developers than Java developers.

Yes, that is probably true. Although almost every Android developer should know Kotlin these days and there are quite a few them. But even if a developer doesn't know Kotlin at all, it is relatively easy for a Java developer to learn it. In my experience it a takes a few days to a few weeks to be at least as productive as with Java (even not all Kotlin features are learnt in this time).

> Lack of progress: Compared to Java lately (e.g., records two years ago, pattern matching, and VT release this year), Kotlin has been stagnating in delivering the big features that would bring us (Infobip) value over alternatives.

Here, I agree. Some years ago I was super excited about Kotlin and couldn't wait for a new release. These days new releases are mostly boring. Maybe the most important stuff is simply done, but then there are enough interesting ideas to improve it (real pattern matching, meta programming, union types, ...). But JetBrains and Google decided that it is more important to improve the fundamental infrastructure first and decided to create a new, faster compiler (K2). As boring at it is feature-wise, I think it is a wise decision, because every project would benefit from it. The plan is to add new features, once the compiler is ready.

comment 2y ago · link · parent

From the Guidelines:

> What to submit? [...] anything that gratifies one's intellectual curiosity.

https://news.ycombinator.com/newsguidelines.html

Maybe it's just me, but I don't feel very inspired on an intellectual level by news about a patch version ;-)

comment 2y ago · link · parent

I always wondered how Python can be one of the world's most popular languages without anyone (company) stepping up and make the runtime as fast as modern JavaScript runtimes.

comment 2y ago · link · parent

Just out of curiosity: What backup tool do you use?

comment 2y ago · link · parent

Both points could be addressed by using a file system cache (or RAM disk) and a compiled language. A CGI application could, for example, be written in Go (https://pkg.go.dev/net/http/cgi).

comment 2y ago · link · parent

Yeah, but CGI has fallen out of fashion and needed a re-branding!

comment 2y ago · link · parent

But then again, it is Gnome's fault to pick the wrong tool for the job.

comment 2y ago · link · parent

But then again the internet is everywhere now: desktop, servers, watches, washing machines, industrial systems, sensors ... So "internet language" is a somewhat pointless term.

comment 2y ago · link · parent

I consider that a bad practice, because it doesn't make things obvious. I guess it works so well in Go, because the language itself is small, so that you don't have to remember much of these "syntax tricks". Making things explicit, but not too verbose, is the best way in my opinion. JetBrains has done amazing work in this area with Kotlin.

    for (item in collection) {
        ...
    }

    list.map { it + 1 }

    fun printAll(vararg strings: String)

    constructor(...)

    companion object
I like the `for..in` which reads like plain English. Or `vararg` is pretty clear - compare that to "*" and the like in other languages. Or `constructor` can not be more explicit, there is no need to teach anyone that the name must be the same as the class name (and changed accordingly). Same is true for companion object (compare with Scala).

comment 2y ago · link · parent

Very true! I think a lot of the accidental complexity of early Java systems were rooted in the not so powerful language. If the language is too powerful (like Scala 2) developers do insane things with it. If the language is not powerful enough, developers create their own helpers and tricks everywhere and have to write a lot of additional code to do so.

Just compare Java streams with how collections are handled in Go and scratch your head how someone can come up with such a restricted language in this century.

1
456
22