> So, rather than writing > > @Test("Strip HTML tags from string") func stripHTMLTagsFromString() {...} > > we can instead write > > @Test func `Strip HTML tags from string`() {...} Maybe I'm just really new at programming, but this seems like an absolutely bad feature, and the example actually perfectly proves it: You really want to name a function "Hello World!" instead of helloWorld, just so your stack traces can…
This is useful for testing. Currently, I need to write both the string name of the text and an identifier based on that name for the function itself. Soon I will only need to write it once. This is not much useful for much else though, and just because you can write code like this, it does not mean you should.
What’s new in Swift 6.2
81–90 of 258 posts
Re: What’s new in Swift 6.2
#82Earlier quoted context omitted.
Generally only useful within the Apple ecosystem is definitely inaccurate. An example: https://vapor.codes/ The problem is that people only think it’s generally useful in the Apple ecosystem.
I don't use Swift not because I think it's not useful outside Apple, but because I believe its developer experience is poor. Some stories that formed my opinions: https://news.ycombinator.com/item?id=9947193 https://news.ycombinator.com/item?id=42803489 Granted, my perception may be wrong, but trying it to know for sure costs time. Swift has not earned my time investment.
Re: What’s new in Swift 6.2
#83Free-form identifiers are neat for test-case naming, but not for `HTTPStatus.`404``. I think having `HTTPStatus.Error404` was a bad idea to begin with. Just use semantic names like `HTTPStatus.NotFound` and you wouldn't have a problem in the first place. Now, a single character typo can easily make a 404, 403 and create a bug. It's less of a problem with semantic names. If you want constrained numeric types in Swift,…
Re: What’s new in Swift 6.2
#84Earlier quoted context omitted.
Generally only useful within the Apple ecosystem is definitely inaccurate. An example: https://vapor.codes/ The problem is that people only think it’s generally useful in the Apple ecosystem.
what advantages does swift offer over go/rust/js/java for server side programming? I always presumed the advantages of swift were native code compilation + top tier integration w/the apple ecosystem.
Re: What’s new in Swift 6.2
#85Re: What’s new in Swift 6.2
#86Honest question. Not trying to troll. One of the pitches in the earlier days was “C/Objective-C OK, but you can’t write safe/next level code with it—-Swift will close that gap.” N years later, it doesn’t feel like there has been a step change in Apple software quality; if anything Apple software feels less solid, and looks cool “look what I did” extension points. I mean, some of the tings you could do with runtime ca…
I feel the same. Apple software quality certainly hasn’t increased . Years back I remember some apps crashing suddenly after updating MacOS. I checked the binary and saw they’d started adding Swift. Half a decade later it seems like it should be better and Swift stuff should be stabilized. But nope, I’ve had more little glitches in both iOS and MacOS. It’s hard to say it’s due to Swift, and not management priorities.…
This could not be furthest for the truth. The entire process of proposing a new language feature to getting it implemented and shipped is out in the open for everyone to participate/see.
Re: What’s new in Swift 6.2
#87Earlier quoted context omitted.
This is useful for testing. Currently, I need to write both the string name of the text and an identifier based on that name for the function itself. Soon I will only need to write it once. This is not much useful for much else though, and just because you can write code like this, it does not mean you should.
A better solution is to have a testing framework that doesn't rely on functions to name tests, especially in a language that has anonymous functions.
Re: What’s new in Swift 6.2
#88Re: What’s new in Swift 6.2
#89Earlier quoted context omitted.
You can't really say a language with a garbage collector (Swift) is an alternative to one without (Rust, C++, etc), because a lot of the time, the reason someone is using a non-GC language is because they don't want a GC. EDIT: Yes, ref. counting is garbage collection, before the replies blow up. haha
> a language with a garbage collector (Swift) You can certainly make the case that reference counting is a form of garbage collection , but it is absolutely false to say Swift has "a garbage collector." There is no runtime process that is responsible for collecting garbage – allocated objects are freed deterministically when their reference count hits zero. The same thing is true of `shared_ptr` instances in C++, and…
Re: What’s new in Swift 6.2
#90Mostly nonsense updates. Swift was my favorite programming language after C++/Java since 2014. I've been faced major updates few times happily. It was one of the most easiest language. But now, I tried to update a project from Swift 5.x to 6.x which has 150+ source files itself and no external libraries which is written by my own use and it has almost all swift 5.x features. They made up Swift as super hard. I decide…
I find 'simple' languages charming. Hence, I still like Objective-C. I also like Lua a lot. I liked Swift when I tried it a couple of years ago, but it seems overloaded with features these days. I haven't tried Swift UI yet, but I did think the Objective-C approach with xibs, struts and such worked fine.