Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ragnese
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
51 ms
·
301.
▲
by
ragnese
5y ago
In my experience, it's much more of a momentum killer and context switch to research an annotation than a function call. First of all, in most IDEs, it's very quick to jump to a function's actual definition to investigate suc
302.
▲
by
ragnese
5y ago
Not in the real world, though. And for similar reasons, too. Most real Java projects I end up working on/with are littered with annotations that do God-knows-what.
303.
▲
by
ragnese
5y ago
> A few years ago that seemed to start to change. From my perspective, some of the features added to the language to support SwiftUI - specifically property wrappers and function builders - very much felt rushed and forced into the langu
304.
▲
by
ragnese
5y ago
A lot of negative comments here, so I'm going to throw out some positivity/praise. I do think there is value in putting a name to the process of analyzing what assumptions, mental models, schemata, etc are more fundamental than ot
305.
▲
by
ragnese
5y ago
I'm almost positive they mean season 7 a.k.a. the most recent finale.
306.
▲
by
ragnese
5y ago
Oh, good point. I forgot about var not getting mad at redeclaration. So the default TS implementation will merge an existing object with the newly defined fields. I'm too lazy to check, but I wonder what happens if MyType already exist
307.
▲
by
ragnese
5y ago
Fair point.
308.
▲
by
ragnese
5y ago
> Rust is great for reliable production systems, for sure, but for 'let's quickly prototype this new feature', it’s too strict. Imagine figuring out a perfect algorithm and spending a few hours implementing it just to be
309.
▲
by
ragnese
5y ago
> Since Java 8 there is static and default methods in interfaces. That's not relevant to the part of my post that you quoted... I was describing a hypothetical situation where you already have two interfaces, but would like to have
310.
▲
by
ragnese
5y ago
Your comment said two things. You said that you don't like the generated implementation for enums and then you said "this approach does not suffer the problems described by the article." The article listed literally one reaso
311.
▲
by
ragnese
5y ago
> Substantially. Look at the generated code for an enum. I'll give you that. It looks like the TS compiler (according to the playground site) spits out some code that's intended for maximum compatibility with older versions of
312.
▲
by
ragnese
5y ago
I keep trying to switch away from Ubuntu Mono, but I always end up switching back after a few days. I just played "the font game" and Source Code Pro won for me, today (But my top contenders were pretty much what I expected: Fira,
313.
▲
by
ragnese
5y ago
Yes, I didn't intend to imply otherwise, but I could've elaborated. Some people will argue a preference for string literal union types over enums because the string literal types don't have any runtime overhead. They just pro
314.
▲
by
ragnese
5y ago
Thank you for the answer! I won't waste your time because I'm sure the answer is somewhere on the web, but off the top of my head, I don't understand why TS "has" to emit different JS. I would've assumed that t
315.
▲
by
ragnese
5y ago
So... You have two declarations, one of which is a real array that's allocated at runtime. Is that really better than an enum? Not to mention, there's a slight mental overhead to parsing this. When I see this code, I might wonde
316.
▲
by
ragnese
5y ago
Unfortunately, neither (string) enums nor string literal unions are supersets of each other when it comes to functionality. But, IMO, string-only enums are generally better. You can't test if a given string is an element of a union wit
317.
▲
by
ragnese
5y ago
I have to admit, that looks pretty slick. Have you used it? I'd be curious to hear how well it works in practice. It seems like the only "big" things Scala has over this is its implicits (which so many people hate, but have b
318.
▲
by
ragnese
5y ago
I disagree. Enums are fine if they're string-only. It's only the numeric enums that cause the issues everyone complains about enums for. If there were a lint for making sure all enums are string-only, it would be the best solution
319.
▲
by
ragnese
5y ago
I remember reading somewhere that the TypeScript devs considered const enums to be a mistake and recommend against using them. I don't remember why, though.
320.
▲
by
ragnese
5y ago
Fair. You're right that I didn't address that concern. I guess the problem is that I don't know what we mean by "flexible". The GP did mention lifetimes around the same part of their comment, so I assume that there&
321.
▲
by
ragnese
5y ago
That's exactly my complaint- most languages have eager, mutable, non-persistent, collections because they were not designed with functional programming in mind. Then FP became the hot new shit, so they all added some of the lowest hang
322.
▲
by
ragnese
5y ago
Ah. You know what? I forgot that the Java implementation of these concepts isn't stupid like it is in some other languages (except what the heck is mapToInt? Some optimized version that makes a primitive array, I guess? Yucky- I wish t
323.
▲
by
ragnese
5y ago
> Thanks for the non-flame-baity answer! Hopefully I wasn’t too emotional in my previous reply, because it unfortunately does happen from time to time. I didn't pick up any high emotions, but I get it. For some reason, I get fiery
324.
▲
by
ragnese
5y ago
> OTOH lets consider Rust. It is in my book a low-level lang, close to the metal (hence Rust?). It has a muuuuuuch better feature set compared to Java (IMHO). But it is geared at low-level, so no VM and certainly no GC out-of-the-box...
325.
▲
by
ragnese
5y ago
Fair points. I haven't worked with Go in a few years, and I remember hating it when I did, but I feel like I remember hating Java more. It's possible that part of the Java hate is not from the language itself, but from the ecosyst
326.
▲
by
ragnese
5y ago
Definitely a preference thing- no doubt. But thank you for responding anyway. (As a clarification, in case it's needed: I obviously didn't LOVE it when I had to update 20 ctors after changing a somewhat fundamental "service&q
327.
▲
by
ragnese
5y ago
> I don’t think that it is any easier in other languages either — object serialization, conversion between language’s object/json/xml/etc, and database access with object relational mapping is just complex. You can make th
328.
▲
by
ragnese
5y ago
> I disagree here. Having GC, VM, streams, big stdlib, makes is quite highlevel. I used to think that, too. I probably wont't convince you otherwise, and it really doesn't matter how you or I categorize the language, but I thi
329.
▲
by
ragnese
5y ago
I'd say that the only one of your listed solutions-in-other-languages that is actually a valid solution is deep argument passing. And I fail to see why it's a problem. If your FooService depends on a BarService, which depends on a
330.
▲
by
ragnese
5y ago
> I did a fair bit of work in Go at Pivotal. I found Go anything but readable - a comical amount of boilerplate (especially around error handling), incredibly wordy constructs for simple tasks like making http requests, and the language
More ›