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

I have rejected a proposal of introducing a mapping library, LLMs can do mapping code very very easily with almost no downsides

ORMs would be my next battle, but SQL injection could become an issue if not treated carefully, so I would still consider libraries like SQLDelight or other SQL first libraries


You just have to duplicate things a bit more, but with the help of LLMs building the queries is very simple and extending them even easier


I spend around 30%, if not more of my work time on Slack (collaborating with others, solving customer issues, searching, documenting)

I want that experience to be good, and not using a subpar tool like (Teams, IRC etc)

As a rule of thumb, I want to use the best tool available for the job, IntelliJ for the IDE, the best coding model (whatever that is at the time), the best Video call tool, the best monitor, the best keyboard etc

Although best is usually subjective, in some of this cases what is "best" is objectively clear, in some cases the gap between the best and the next one is small in others is huge. In the case of communication tools I think the difference is huge.

Is this needed to do my work? nope It makes working more pleasant? definitely yes


People with such strong beliefs can be unpleasant to work with as well. Not saying you are, but there are often considerations beyond the immediate needs of developers that dictate tool choice in a company, and I find it not great if people complain about such minor inconveniences all the time (it's ok to discuss to some degree, but not in an overzealous way). Same goes for tech stacks, frameworks etc., I avoid hiring people that express extremely strong views (e.g. "JS is utter garbage") as they tend to be difficult to work with since they drag the team down with endless tech stack discussions and make others feel bad/inferior.


March - early June or Mid September - November

Avoid July and August, horrible heat and most people have left the city


> Avoid July and August, horrible heat and most people have left the city

You mean it's bad that you don't have to wait in lines or get into crowded spaces?


There are still tourists who for some weird reason come in the worst heat. Bring a hat.


Also sleep during most of the afternoon. Everything is open late.


Yep, those tasty formation and travel budgets are also being squeezed in the quest for profits, reducing the market size for these tech events...


Working as a contractor for a public entity, I can't think of anything that I would like to do less than that...


I can certainly feel what you mean, it's where those who will take on anything to get a bigger car congregate in these parts. But it's actually not that bad I think, deployments are not "the temp guy in an in-house team" but projects with a presumably not too difficult buyer: the customer-side person you are working with doesn't have too much skin in the game. Realistic expectations and all that. One of the more graspeable downsides I think (never worked that way, but went though the hiring process once) is that those state clients seem to never outsource a complete project, but insist on keeping projects neutral by staffing them from as many different consultancies as possible, which means that you'll only ever work with people who are nominally your competitors.


Always focus on PPI, some rough numbers

27” 5k (5120 x 2880) -> 218 PPI

32” 4k (3840 x 2160) -> 137.68 PPI

34” 5k (5120 x 2160) -> 163.44 PPI

39,7 5K (5120 x 2160) -> 139.97 PPI

Apple Pro Display XDR 32" 6k (6016 x 3384) -> 218 PPI


PPI doesn't translate to screen estate, though


And too many PPI won't make text easier to read, unless you magnify the screen, thus actually loosing PPIs.

PPIs will display sharper pictures, provided that they have enough quality.


The text is sharper with a higher PPI even if the actual size of the text is the same. I have a 4k 24" screen, and text is much much sharper than on any FHD 24". Hell, it's noticeably sharper even than on my 14" FHD laptop. And sharper text helps with legibility, so I find I can actually use smaller font sizes more comfortably than the "regular" size on a lower-res screen.

You don't get more real estate, indeed, since that depends on zoom level. However, depending on your setup and habits, you may actually gain some. In my case, I use 4k at 100% zoom. I don't care for window decorations, interface icons and so on, so it's not an issue if they're small.


If you go up PPI by a percentage you can reduce font size by a similar amount. Too small to be legible? Literally move the screen closer. No need to magnify anything.

Have a 27" 4k monitor and a 42" 4k monitor? Move the 27" close enough that it takes up the same FOV as the 4k and you get the same experience.

This isn't like home theatre where you're constrained to the dimensions of a room (ie. wall or console location a TV sits on top of and seat viewing distance).


For eye health, I've gotten the recommendation to keep my monitor an arms length away.

If that is true, I'd consider move the screen closer to not be an option.


You don't want it too close, but it can be closer than that if you have normal eyesight. The line should be where your eyes have trouble focusing and add a small buffer. For me that's about a foot. So wherever you're comfortable looking at a smartphone (or really any object) is a good point of reference.

Otherwise this is a commonly propagated myth related to radiation from early TV sets.

https://theopticalshoppetn.com/is-sitting-too-close-to-the-t...


My preferred setup in terms of screen real estate is 24" 2k (2560x1440) without scaling. In terms of PPI it's a bit low (122), but 244 PPI 24" screens are hard to get. 1.5x scaling is an option


I like 25x14 on a 27" and the fact that on a mac you have to buy BetterDisplay just to make it work about 80% as good as on Windows makes me... not at all surprised since I'm supposed to use an apple display with an apple computer, right?


Why not just get a 4K 27”? They can be had for around $220 USD nowadays. I paid that for mine.

I do dislike the fact that Apple removed decent support for lower resolution monitors, but I also don’t see why anyone would prefer them to higher res unless it’s a budget issue.


The core issue with 4k on Mac is that unlike Windows or Linux, Mac doesn't have usable 125%, 150% or 175% scaling modes. But at 1x font rendering on Macs sucks, and at 2x you basically have a fancy 1080p screen; it just doesn't fit as much as an unscaled 1440p screen.

This forces you into 5k screens, or tricks to make the OS do actually useful scaling.


4k is... too low res for desktop use on a mac. 25x14 upscaled to 5k only to be downscaled again to device native resolution by a $15 tool still gives me more usable screen real estate than a native 4k and the $15 makes it so text is actually legible...


By 25x14, do you mean 2560x1440? If so, are you saying that a $15 device will magically make a 2560x1440 monitor higher resolution than 3840x2160? If that's what you're saying, do you have a link that provides some detail on this because I don't believe it.

I'm also unable to believe someone would consider 27" 4K text illegible on a mac since that's what I use that every day and can read text comfortably. Edit: Unless you're using it unscaled, then yeah, text isn't that legible.

These are strange statements to make without any detail.


It isn't a device, it's a software tool. It doesn't make the monitor magically 2x the resolution; it can trick macos to render onto a 5k buffer and then downscale the output to the physical display so it looks not-broken.

https://github.com/waydabber/BetterDisplay

I'm saying macOS is unusable on native resolutions - everything is either too small or too blurry, so a 4k display won't do me any good. 25x14 is the sweet spot for me, but I guess Apple decided I'm holding it wrong, because they want me to get a 5k display to get usable 25x14.


There are many taxes that are not paid on profit... VAT/sales taxes, property taxes and a big etc

ABNB creates externalities to the countries where it operates (increase rent prices), so it would make sense to tax them because of it.

And if they don't like the tax, they are free to stop operating in that country ;)


It is way easier for me to read than what you proposed in Typescript, more characters to write? sure but how many times do I have to write a piece of code and how many times do I have to read it?

I guess ultimately it depends on which language you are more familiar with...


I'm more than happy with either of those variations. My favourite though would be Elm's syntax ;)

    type Message 
        = IncrementBy Int
        | DecrementBy Int
        | Set Int


One big difference between how Dart (and other OO languages that take a similar approach) and what Elm and other functional languages do is that in Dart, each of the cases is also its own fully usable type.

In Dart, if you do:

    sealed class Message {}

    class IncrementBy extends Message {
      final int amount;
      IncrementBy(this.amount);
    }

    class DecrementBy extends Message {
      final int amount;
      DecrementBy(this.amount);
    }

    class Set extends Message {
      final int amount;
      Set(this.amount);
    }
You can then write functions that accept specific cases, like:

    onlyOnIncrement(IncrementBy increment) {
      ...
    }
In Elm and friends, IncrementBy is just a type constructor, not a type. Further, we can use the class hierarchy to reuse shared state and behavior in a way that sum types don't let you easily do. In your example, each case has an int and it so happens that they reasonably represent roughly the same thing, so you could do:

    sealed class Message {
      final int amount;
      Message(this.amount);    
    }

    class IncrementBy extends Message {
      IncrementBy(super.amount);
    }

    class DecrementBy extends Message {
      DecrementBy(super.amount);
    }

    class Set extends Message {
      Set(super.amount);
    }
And now you can write code that works with the amount of any Message without having to pattern match on all of the cases to extract it:

    showAmount(Message message) {
      print(message.amount);
    }
So, yes, it's more verbose than a sum type (and we do have ideas to trim it down some), but you also get a lot more flexibility in return.


In an FP code base, it’s common for ADTs to be the backbone of all data structures from Maybe to Either, to anything you use to model data types. That being the case changing 4 lines into 13 scaled into a entire code base is a massive amount of sludge to wade thru & one of the best way to up the code quality is to increase readability for maintainers. More LoC is more LoC to maintain even if it seems like it’s just a few more lines.


> changing 4 lines into 13 scaled into a entire code base is a massive amount of sludge to wade thru

It's only more verbose for the code that is defining new types. Code that is simply defining behavior (either in functions or methods) is unaffected and my experience is that that's the majority of code.


But reading those definitions at the top of the file is usually one of the first places I’m going to go to understand what’s going on. The 4-line option to me is much easier to grok, not only because it’s more terse but the way the pipes are stacked to indicate visually that they are related to the same underlying structure. The `extends Message` bit is a level of indirection that requires the reader to juggle a lot more in their head (as is immutable `final` not being the default). The `class` keyword also carries a lot of baggage that it’s not clear what to expect (will this have methods or not?, will we be seeing `this`?, etc.).


I think you're evaluating this as a notation for defining sum types. But that's not what it is. It's a notation for defining a class hierarchy, with all of the additional affordances that gives you.

In practice, most real-world Dart code that uses sealed types also defines methods in those types, getters, and all sorts of useful stuff. Once you factor that in, the data definitions themselves are a relatively small part.

(Of course, you could argue that defining class hierarchies is already intrinscally bad. But Dart is an object-oriented language targeting people that like organizing their code using classes.)


This is definitely an FP vs OO thing. If you wanted to refer to the value in an ADT you'd introduce a new type to refer to it, which in Elm would be:

    type Message 
        = IncrementBy Amount
        | DecrementBy Amount
        | Set Amount

    type Amount = Amount Int
Obviously this is a contrived example - you wouldn't bother if you were dealing with an Int but once the message gets more complicated it can make sense.


That's a different thing.

Given the above ADT, how would you write a function that prints the amount of a Message, regardless of which case it is?


You'd use a switch over the ADT and extract the values as appropriate. This is method dispatch vs function dispatch. In practice you can do the same things with either, but they reflect the focus on behaviour (OO) vs data (FP).


That's the point of my last example. By building this on subtyping, you can hoist that shared property out of the cases and up to the supertype. That lets you define state and behavior that is case independent without having to write a bunch of brain-dead matches that go over every case to extract conceptually the same field from each one.

Of course, you can also reorganize you datatype so that the shared state is hoisted out into a record that also contains a sum typed field for the non-shared stuff. But that reorganization is a breaking change to any consumers of the type.

Modeling this on top of classes and subtyping lets you make those changes without touching the user-visible API.


I appreciate you taking the time to answer, but honestly the boilerplate is just a killer. I don't care about the additional flexibility when the code is so much harder to make sense of, and this is just a toy example.


fp-ts has this same unfortunate issue (https://gcanti.github.io/fp-ts/guides/purescript.html#data) where a PureScript one-liner becomes 11 lines of boilerplate TypeScript. Or (https://gcanti.github.io/fp-ts/guides/purescript.html#patter...) 3 lines of pattern matching becomes 10 where the matching is done on strings (ad-hoc _tag property).


Thanks!


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

Search: