News for hackers. Stuff that matters.
Re:30k lines of SwiftUI in production later by jalino23 on Saturday January 28, 2023 @07:02AM (#34556912)
I also fell in love with swift when I had to learn it trying metal. it just succs how you have to use xcode with it.
Re:30k lines of SwiftUI in production later by mrtksn on Saturday January 28, 2023 @07:24AM (#34557016)
What's wrong with Xcode? Is it the usual "iPhone is preparing for development" type of annoyances? Is it the bugs that sometimes prevent you from compiling? Or is it something more fundamental like even when everything works fine you don't like it?
Re:30k lines of SwiftUI in production later by jalino23 on Saturday January 28, 2023 @07:36AM (#34557081)
its the I'm used to vim and transitioned to helix and kinda like everything in terminal. it feels heavy
Re:30k lines of SwiftUI in production later by mrtksn on Saturday January 28, 2023 @08:25AM (#34557394)
Have you tried Swift Playgrounds? All the heaviness of an IDE goes away, it feels light as a toy but can do all the basics very well. It has some annoyances but the "opened a file and start writing my code, didn't bother with anything else" vibe is there.
Re:30k lines of SwiftUI in production later by parker_mountain on Saturday January 28, 2023 @07:32AM (#34557054)
The first, yes.

The second, also yes.

The third, also, also yes.

Re:30k lines of SwiftUI in production later by mrtksn on Saturday January 28, 2023 @07:36AM (#34557080)
Okay, can you give some details on what's wrong for you? Like what is the better way to do it?
Re:30k lines of SwiftUI in production later by hombre_fatal on Saturday January 28, 2023 @07:56AM (#34557192)
Xcode doesnt even support features like format on save nor does it have powerful enough api to support a mod ecosystem to fill in its gaps.

It has all sorts of bugs and weird fail cases.

Honestly you should just search the internet for testimonials because anyone who uses Xcode can create a list of issues rather than rehash them all here in response.

Re:30k lines of SwiftUI in production later by mrtksn on Saturday January 28, 2023 @08:20AM (#34557358)
I grew to dislike mods and ever growing features. Lately I'm experimenting with Swift Playgrounds and I start liking it very much precisely because lacks a lot of features but its still capable do a lot.

So many features and linters and tools end up building a huge cognitive overhead, which is the primary reason I haven't been touching JS since a few years. The JS world piled up so me sh*t in order to make the working with JS something that is not, that I found myself not having energy and time to do something other that setting up tools and frameworks.

What I want is to be able to start coding like start writing an article in a Word document and Swift Playgrounds is getting there. XCode was good too but wasn't anything special, Swift Playgrounds is amazing.

I'm especially excited for WASM, so maybe I can just write everything in Swift eventually.

Re:30k lines of SwiftUI in production later by jb1991 on Saturday January 28, 2023 @08:39AM (#34557480)
For starters, that Xcode's "vim" emulation doesn't even support arguably the most useful, common, and productive operator in vim -- the dot -- is embarrassing. So many developers depend on vim-like interaction for significant gains in productivity, but Xcode only got about halfway there, and not the better half.
Re:30k lines of SwiftUI in production later by Zanfa on Saturday January 28, 2023 @09:50AM (#34557946)
1) It's sloooooooooow

2) It's extremely buggy, like on a daily basis where something just doesn't work for any apparent reason that is usually either fixed by killing Xcode or removing derived data & then killing Xcode

3) Lack of plugins for even the most primitive of features like autoformatters

4) XML for build configs inside .xcodeproj

5) Why does it take half a day to update through the App Store?

I mean it has some nice features functionality-wise, such as the metal debugging toolkit, but the experience of actually coding in it is abysmal. Like so bad that I've been doing as much of my Swift work in VSCode as possible, which Xcode actually prevented for a while due to a bug in how it handled local Swift packages.

Re:30k lines of SwiftUI in production later by ezfe on Saturday January 28, 2023 @10:39AM (#34558422)
1) I use IntelliJ for my day job and find it much slower than Xcode

2) yes

3) I don't really use plugins in IntelliJ either - I do in VSCode but only because it's pretty useless without them

4) Not sure what the problem is with this, but I will say I prefer Package.swift projects for anything that isn't targeting a UI runtime

5) App Store update process just doesn't play well with 8GB applications. Either delete it and re-install from App Store or use something like Xcodes.app

Re:30k lines of SwiftUI in production later by mrtksn on Saturday January 28, 2023 @10:15AM (#34558196)
On Apple Silicon it's quite performant, I'm sure there are faster things but I don't have complaints on speed o M1 Air. I had complaints on my Intel based mac though.

The bugs can be annoying but they usually go away after restart and cleaning the junk.

> 5) Why does it take half a day to update through the App Store?

But this one is really annoying. Also for some reason in downloads and installs TWICE.

Re:30k lines of SwiftUI in production later by Pulcinella on Saturday January 28, 2023 @12:16PM (#34559379)
It’s way, way faster and easier to just download new versions of Ccode from the developer website. I have no idea why doing it through the AppStore is so slow. If you pull up the console log you can see the AppStore app not actually doing anything for 20-30 minutes (even though it’s displaying the download spinner) before it finally decides it’s time to start downloading.
Re:30k lines of SwiftUI in production later by nodemaker on Saturday January 28, 2023 @11:30AM (#34558931)
For C/C++ Xcode is way better than VSCode in my opinion.

Although I miss github copilot a bit when I do it.

Re:30k lines of SwiftUI in production later by kitsunesoba on Saturday January 28, 2023 @10:01AM (#34558042)
I spend most of my day in Xcode and for a while the main frustration was SourceKit being slow/crashy. That’s improved a fair deal over years, but I’ve found that the best thing one can do to improve that, as strange as it sounds, is to avoid code smells.

SourceKit can get really grumpy with things like deeply chained optionals, deeply nested blocks, and lots of casting or otherwise fighting against the type system. Not doing those things makes it run significantly more smoothly. So if Xcode starts bogging down or SourceKit is crashing, it means there are probably cleaner ways to write whatever I’m currently working on.

Re:30k lines of SwiftUI in production later by drclau on Saturday January 28, 2023 @10:08AM (#34558117)
> What's wrong with Xcode?

I still have no idea how I can quickly switch back and forth between open files. Either the feature is entirely missing, or completely unintuitive to discover and/or use.

For the record, I am writing this message in 2023.

Re:30k lines of SwiftUI in production later by allenu on Saturday January 28, 2023 @01:06PM (#34559881)
There’s definitely a ton of features in it that aren’t obvious.

These days I typically use cmd-control-left/right to navigate the open file history and then cmd-shift-[/] to navigate open tabs.

Also worth noting that you can find these in the Navigate menu if you want to peruse all the options.

Re:30k lines of SwiftUI in production later by politician on Saturday January 28, 2023 @11:53AM (#34559147)
Xcode sometimes takes 20-60 seconds to recover from errors in the syntax. It’s so odious that when I have to use it, I build everything in VSCode and then do the final mandatory testing pass in XCode.

It’s extremely slow on high-spec MBP.

It sometimes takes developers over 14 hours to update.

It interferes with other command line tools, forcing itself into the middle — if you’ve ever tried to run git on a fresh MBP and run into the xcode-select install step, you know this one. It’s a bad citizen.

Installing XCode will cause a perfectly functional machine heavily used for development in VSCode to experience several full crashes until it fully takes over the machine. MacOS with and without XCode appear to be two fundamentally different operating systems.

Having XCode running for any amount of time saps battery like nothing else. You can run VSCode for 24 hours on a MacBook Air with M1 for maybe 3 hours in XCode.

The git integration is so utterly crap and broken that it’s safer to turn it off rather than fighting the secret intermediate repo cache that it hides from you and sometimes forgets to update.

For some idiotic reason, creating a new file in XCode prepends the file with a comment block including the name of the file, the date, and the name of the user. Who asked for that? For a file that’s part of a repo that’s going to be touched by multiple people over a long period of time and likely renamed, this is just obnoxious noise.

Re:30k lines of SwiftUI in production later by mrtksn on Saturday January 28, 2023 @12:03PM (#34559233)
Some valid points, thanks.

However you might have some other issues with your system because I practically never close Xcode and I’m having like +10 hours of battery life on my M1 air. This includes actual work being done in Xcode.

Re:30k lines of SwiftUI in production later by politician on Saturday January 28, 2023 @12:17PM (#34559384)
That’s probably true, but also I’ve experienced these issues on two different machines (high spec Intel MBP, highest spec M1 MBA).

I do regularly find that mDNSresponder has been sending and receiving 100’s of GB over the network and must be force killed. When that process goes off the rails, it also saps battery.

I wish that I didn’t have to keep Activity Monitor open at all times on both machines just to keep ahead of the problems. It’s not like effectively running top is cheap.

Re:30k lines of SwiftUI in production later by quesera on Saturday January 28, 2023 @01:05PM (#34559868)
> creating a new file in XCode prepends the file with a comment block including the name of the file, the date, and the name of the user. Who asked for that?

This is standard corporate policy at most/all big software shops. Apple uses Xcode internally, so the format and contents probably reflect their policy.

The block can be customized for your policies -- or removed completely, if preferred.

Re:30k lines of SwiftUI in production later by silh on Saturday January 28, 2023 @07:04AM (#34556919)
AFAIK, you can also use VS code or CLion.
Re:30k lines of SwiftUI in production later by _corvo_ on Saturday January 28, 2023 @07:14AM (#34556971)
I’m assuming you meant AppCode. It’s been discontinued: https://www.jetbrains.com/objc/

With VSCode, do you get live preview?

Re:30k lines of SwiftUI in production later by StewardMcOy on Saturday January 28, 2023 @11:46AM (#34559076)
The Swift team released a VS Code plugin recently. As far as I'm aware, it doesn't do live preview, but considering how often Xcode fails to render live previews, I'm not seeing that as much of a loss.
Re:30k lines of SwiftUI in production later by meindnoch on Saturday January 28, 2023 @08:25AM (#34557385)
You don't have to use Xcode. You can use any IDE that can drive swiftc.