I haven't yet had the luxury to experiment with the latest version of Java, but this is one of the reasons why I wish Java introduced named parameters the say way kotlin and scala do.
Eg:
data class Make(makeId: String, name: String)
data class Model(modelId: String, name: String)
data class Car(make: Make, model: Model, year: String, ...)
Now you can go ahead and order the params whichever way you wish so long as you're explicitly naming them:
val v1 = Car(make = myMake1, model = myModel1, year = "2023", ...)
val v1 = Car(model = myModel1, make = myMake1, year = "2023", ...)
Once withers land, I think you could approximate this by letting your record class have a zero argument constructor which sets every field to some blank value, and then fill the fields using `with`.
var x = new Car() with { make = "Volvo"; year = "2023"; };
If you want the Car constructor to enforce constraints, you could use this pattern in a separate Builder record:
record Car(String make, String year) {
Car {
Objects.requireNonNull(make);
Objects.requireNonNull(year);
}
record Builder(String make, String year) {
Builder() {
this(null, null);
}
Car build() {
return new Car(make, year);
}
}
}
var x = new Car.Builder() with { make = "Volvo"; year = "2023"; }.build();
So much syntax to enable something that other languages have had for 10+ years. That's why I can't take the "Java is as good as Kotlin now" arguments seriously.
Thanks. It extracts the sentence from what you're reading, and adds both the word and sentence to the card, with a link to the source material if it's from the web.
Emacs is more like an ecosystem around text, so switching keybinding does not matter much. And most people's system is installed on a single computer, very much like Photoshop or Visual Studio. Vim is all about editing text and the keybinding are like a DSL for this purpose, so changing things will make you awkward everywhere.
The clue lies in the fact that you can customize the editing experience to function like Vim. Because that’s one out of a thousand different ways you can customize that app to function like a one-off editor, a Git client, an email reader, and so on.
Vi is like an standard for moving around and editing text files. I use Vi-style commands in all my editors: Emacs, IntelliJ, and VSCode. For me, any application that supports Vi keybindings and has some sort of command palette will feel like home.
Regarding why edit files in Emacs instead of vim: I simply work on Emacs. I don't use a CLI or a file manager to navigate to my files, I already have projects set up in Emacs and can quickly open files in any such projects. Emacs also holds my note taking system. And when I'm dealing with git, nothing comes close to magit. Also, I've been using the Spacemacs framework for years, which makes it really easy to create such a customized and efficient configuration without much hassle.
The reason people like emacs has nothing to do with the default key bindings, which are basically arbitrary. Emacs is a framework and programming environment for building custom IDEs.
You get the vi bindings and modal behaviour which I find better _plus_ all emacs functions and most of the emacs bindings. I’m often mixing the 2 modes while editing.
You're right, but it's weird for such a tech-focused company to close stores in such a fashion, because we're used to the giant margins of tech. Apple has never closed that many stores that quickly.
Apple stores are famous for being some of the most profitable stores mankind has ever created. And there aren't that many of them.
These Amazon stores are just local convenience stores. They're selling candy bars. And Amazon is a much more "experimental" company than Apple -- they launch and shut down stuff all the time to iterate and learn. This isn't about penny-pinching or margins, it's about finding product-market fit.
It's a loss of 8 Go stores, but Amazon has been ramping up the Amazon Fresh grocery stores over the last 2 years. There are 33 Amazon Fresh stores from my count.
Amazon Go and Amazon Fresh are two distinct and different retail entities. The subject of the post is specifically Amazon Go. That being said, on the most recent earnings call Amazon also announced that they were "pausing" the rollout of Fresh stores.
“We’ve decided over the last year or so that we’re not going to expand the physical Fresh doors until we have that equation with differentiation and economic value that we like, but we're optimistic that we're going to find that in 2023,” [1]
And the 2 “closed” in seattle have been boarded up for some time, they are in an area that became even higher crime during Covid and never really recovered.
More accurately: they are in an area that dropped to zero foot traffic during covid and never really recovered. I think the literal number of people that go past the store on 6th is lower than the number of crimes committed in most areas.
I use an extension to remove them - no affiliation but it seems to work. Chrome: "No YouTube Shorts". Between that, a plugin to remove already watched videos and my ad blocker, youtube is a way better experience!
I use Remove YouTube Suggestions: <https://lawrencehook.com/rys/> It has settings for a lot of customizations, including removing shorts. (You can keep suggestions if you want to.)
I'd like the option to filter out cable tv news designed to emotionally outrage from my recommendations.
I'm well aware there is a land war in Europe right now, when I turn on the TV at 6pm on a Thursday to watch cooking videos I don't need reminders pushed in my face.
Out of all the issues with youtube, this is probably the one that has the most real negative cognitive impact for me.
Lot of replies to this describing hacks/workarounds/scripts for something that should really just be an option in the official interface. I get that this is hackernews and everyone's just trying to be helpful, but I'm sick of needing to do work on my end to work around crap UI decisions.
Eg:
Now you can go ahead and order the params whichever way you wish so long as you're explicitly naming them: