mastodontech.de ist einer von vielen unabhängigen Mastodon-Servern, mit dem du dich im Fediverse beteiligen kannst.
Offen für alle (über 16) und bereitgestellt von Markus'Blog

Serverstatistik:

1,5 Tsd.
aktive Profile

#devtools

18 Beiträge18 Beteiligte5 Beiträge heute

With this latest PR, inference for `noFloatingPromises` is pushed to over 80% success rate in Vercel's repositories: github.com/biomejs/biome/pull/

While I targeted specific patterns used by their own `swr` library, all the fixes are generically applicable, meaning other code benefits too.

Do you want to use Biome's `noFloatingPromises`, but need support for some library that is important to you? Reach out to us and we can make it happen: biomejs.dev/enterprise/

Summary
This improves type inference so that we are able to flatten intersections and are able to infer calls to objects and interfaces that have call signatures. Specifically this allows us to det...
GitHubfeat(core): flatten intersections + call signatures by arendjr · Pull Request #6404 · biomejs/biomeVon arendjr
Fortgeführter Thread

By way of follow-on, Cursor wrote me a function that uses type checks to decide which conditional branch to call.

Junior Dev Cursor, let me tell you about polymorphism, my friend.

This is the kind of thing that may get covered in a Object Oriented Programming 201 kind of course: If you're branching on type, this is screaming out for an interface/protocol/class family.

OO 310 will teach you: don't create too many families or families that are too deep or ouch time. Sometimes, composition works better than inheritance. Choose wisely. This decision requires judgement (hence experience).

#swift#swiftui#ai

Bear with me. This will piss some tech folks off. It'll likely be seen as god damn coder heresy, to many.

AI dev tools are fucking impressive.

For context: I've been a software engineer for just shy over 30 years now (yes, ok, I'm including my 5 year stint as a manager in there as well). I'm not to claim that I'm an "S" tier developer—though I've had the fortune to get to know several and work with a small handful over the years. These people helped me to get to what is maybe an "A" class.

I say this to attempt to establish my bonafides before I go further.

I've been test driving Cursor, a VS Code-based editor + SaaS that taps into several different LLMs across many different vendors.

As of about a month ago, I'd never touched Swift in my life.

Over the past several weeks, working only with ChatGPT XCode integration, one file at a time, I slowly built out a prototype of an iOS app that works. It wasn't built according to Apple HID guidelines and tips. And ChatGPT XCode integration is only able to see and edit a single file at a time (a massive limitation). I have a deep background in imperative languages both strongly (C, Java back when it was so painful to work in—'96 through '04) and loosely typed (so very very much Ruby).

And then, late last week, I started trying Cusor.

Today, I had Cursor modify the UI to adhere to Apple's design tips (developer.apple.com/design/tip).

Holy. Fucking. Shit.

My app went from looking serviceable to something resembling a real™️ iOS app in the period of a few minutes.

Sometimes, AI's code factoring leaves something to be desired, certainly. It'll do some squirrelly shit.

That's fine. I treat it like it's a junior developer. I ask it to do the tasks that I would either bore me to tears or would cause this ADHD brain to introduce all sorts of stupid bugs by way of typos and the low dopamine of necessary tedium.

**And then code review the F out of its work**

I ask for specific refactors. And the refactors look pretty damn good.

Even still being a Swift nooblet (I'll freely admit it), I know plenty about programming languages in general (and am learning Swift by example here quickly enough) that I can see opportunities to DRY, to reduce ceremony, and to express intent more clearly.

For instance, today, I saw 3 structs that were being used similarly and with essentially duplicative code. Blech. In Java, I would've used a shared Interface and passed the objects around that way. I forgot my Objective-C, learned over a decade ago, from writing a Pivotal Tracker iPad app. What I needed was a Protocol. I told Cursor what I wanted, to treat the structs in a polymorphic-ish way, so that I could DRY the code, have my One Method to handle them (thankfully, no special casing to care about here so nice and cleanly too). It immediately said, "Oh, I need a Protocol", wrote one, wrote the method, modified the UI accordingly and wham, bam, thank you, ma'am, refactored UI code that deleted lines.

Yes, the AI did this. Yes, I guided it from a place of experience.

Bitch about how clueless LLMs are about our work. Sure, unlike Junior Devs, you can't teach an LLM more than its already capable of (and that is part of the fun of working with Juniors—watching those lightbulbs turn on and having them rock your world when they see something that you can't because of all of your earned biases). However, the LLMs out now? They make pretty darn good pair programmers, if you give them half a chance.

And Cursor is pretty f'ing impressive. And it is one of the earliest arrivals.

We live in interesting times...

developer.apple.comUI Design Dos and Don’ts - Apple Developer
#swift#swiftui#ai