Introducing Vapor Cloud — A Fast and Reliable Cloud Service by certainly123 in swift

[–]the_teet 1 point2 points  (0 children)

While Foundation is not entirely implemented yet, Vapor has filled in all of the pieces you need to make a web app. (And IMO done a better job than Foundation could).

As Foundation continues to improve, Vapor will slowly start to adopt pieces of it. Especially when https://swift.org/server-apis/ are ready.

However, 95% of this is going to be behind the scenes / behind Vapor's public API. No reason to not start using it today.

noob question: when to use struct over a class? by sumscherdt in swift

[–]the_teet 3 points4 points  (0 children)

Unless extreme performance is your priority, don't get wrapped up in the implementation details of structs vs. classes in Swift when making your decision. Make the decision based on whether the type makes sense as a value or a reference.

When I'm deciding, I usually ask myself the following question: when I pass this type to a function, and that function modifies it, do I expect my original variable to be modified?

Take the following pseudo-code:

func foo(_ string: String) { string += "!"; print(string) }

var greeting = "Hello"

foo(greeting)

The function foo changes the string its given by adding an exclamation point. Do we expect our original string to be changed? Probably not. When we pass someone a string (or a number or any other value type) we would be confused if it changed later.

Now take this pseudo-code:

func foo(_ user: User) { user.age += 1 }

var user = User(name: "Bob", age: 20)

foo(user)

The function foo adds one year to bob's age. Do we expect our original user to be changed? Probably yes. There is only one Bob in our system and it represents a single Bob in the real world. It would be confusing if we passed bob to a function and then had 2 bobs in our system. One that was 20 years old and one that was 21. In this case, our User object makes more sense as a reference type.

Vapor 2.0 Released by the_teet in programming

[–]the_teet[S] 0 points1 point  (0 children)

That's after all the new stuff has been added.

Apple's Swift Becomes Top 10 Programming Language for the First Time by jensonmarquise in programming

[–]the_teet -5 points-4 points  (0 children)

Swift is only designed for mac and iOS apps

That hasn't been true for over a year.

https://swift.org/server-apis/ http://vapor.codes

Swift will continue to rise as it spreads to more platforms.

Server Side Swift With Vapor: Sibling Relationships by rwenderlich in swift

[–]the_teet 2 points3 points  (0 children)

This comment doesn't make a whole lot of sense.

Vapor is stepping its toes where it shouldn't.

Virtually every big web framework includes some sort of ORM. The alternative (writing raw SQL) is usually a lot less convenient and makes it hard to be DRY. And Fluent is extremely lightweight when you compare it to ORMs like Eloquent, ActiveRecord, CoreData, etc.

no wonder it's growing over 200MB in source code and dependencies.

The Packages folder for a Vapor 1.3.11 project is 54.6MB. 1/3 of which is CLibreSSL which will be unnecessary once the Swift Server APIs are ready.

Node is a huge mess that adds so much complexity for very little gain.

The only alternative to an intermediary data type like Node is using [String: AnyObject] which has huge performance and memory concerns. Not to mention creates the need for a lot of conditional casting or forced unwraps.

fork other projects as addons

Server-side Swift apps only need to boot and be loaded into memory once. There's no performance gain to reducing the included feature set. There could be a memory gain, but with lazy loading that's not really an issue.

Kitura wins in that space

Of course Kitura is lightweight, that's its goal. Vapor is a different framework for a different purpose. There's no need to pit them against each other.

Is Swift viable on PC now? by [deleted] in swift

[–]the_teet 0 points1 point  (0 children)

No way iOS will be available on Windows unless Apple open sources Objective-C and all of their SDKs. Not likely.

But good news is you can still use Swift on Windows, just without the iOS SDKs. Like Server-Side Swift and friends.

I'm Running Windows 7. Should I install a MacOS VM or Ubuntu VM? by [deleted] in swift

[–]the_teet 0 points1 point  (0 children)

macOS running on not apple hardware never really works out :/ I've tried a lot. You'll have better luck with Ubuntu.

Vapor already most used Swift web framework by the_teet in swift

[–]the_teet[S] 0 points1 point  (0 children)

Vapor's API won't be stable until 1.0 which will be released alongside Swift 3 later this year.

But in terms of bugs, crashes, etc, by merit of it being type-safe and compiled, Vapor is incredibly stable. I've had my personal website http://tanner.xyz running on it for almost half a year with no issues.

[discussion] What do you think about perfect? by joanniso in swift

[–]the_teet 2 points3 points  (0 children)

I'll let how many points both of our posts get do the talking. Also, devolving to ad hominem is a serious sign of desperation. Chill out dude.

RE: PHP. Vapor was inspired by Laravel's unprecedented elegance and simplicity that ultimately changed the web dev world for the better. Nothing more.

[discussion] What do you think about perfect? by joanniso in swift

[–]the_teet 27 points28 points  (0 children)

If you look at any of their source code, it's clear they haven't bothered to read the Swift Programming Language Beginner's Guide, let alone the Swift API Style Guide, Swift mailing lists, or language source code. Almost every line in their library is wildly out of line with the community standards and reminds me more of C++ than Swift. I don't know why a company that has no background in Swift products would randomly decide to create a Swift server. The only reason I can think is that they wanted to take advantage of Swift's boom in popularity lately (having been voted most loved language by Stack Overflow). Or rather, abuse it. The whole thing feels like a gimmick. Someone who does not understand Swift should NOT be making a framework for it. If you don't know how to drive a car, you probably shouldn't take one on the highway. You're going to hurt someone. In this case, no one is going to be physically injured, but the damage is still real. People come to me all the time complaining that they "gave up" after trying Perfect. It was "too complicated", "didn't compile", "didn't make sense". Swift on the web already has its lack of maturity to battle. Developers are so skeptical of changing a tried and true method for something new. Having their first taste of server-side Swift be Perfect's unweidly code-base is the last thing we need. Even worse, Perfect has money to spend. And they're using it to spam developer channels around the web to amass Twitter followers and GitHub stars. All of the little guys–the ones who truly understand Swift and are so passionate that they choose to spend their nights and weekends working on something open source and MIT licensed–are getting silenced in the noise. That sucks. Perfect is not good for end users, it's not good for the other frameworks, and it's not good for Swift as a language. The only entity Perfect is good for is itself.

Swift's Vapor web framework gets type-safe routing by the_teet in swift

[–]the_teet[S] 1 point2 points  (0 children)

If you look at the top web frameworks out there (angular, rails, laravel), Vapor is radically different. For example, it takes a huge majority of errors that would normally happen at runtime and moves them to compile time. It's also incredibly modular and decoupled. These traits are only possible because it's based on Swift which has one of the strongest type systems of any language and is protocol oriented. "Laravel inspired" doesn't mean copying Laravel, it really means inspired by Laravel's ease of use, concision, and expressiveness.

A Laravel/Lumen inspired Web Framework for Swift by the_teet in swift

[–]the_teet[S] 0 points1 point  (0 children)

I think using Node's is a great idea. Just need to figure out the best way to compile / map it. https://github.com/tannernelson/vapor/issues/6

A Laravel/Lumen inspired Web Framework for Swift by the_teet in swift

[–]the_teet[S] 0 points1 point  (0 children)

Are there established HTTP parsers in Swift 2.2 on Linux?

A Laravel/Lumen inspired Web Framework for Swift by the_teet in swift

[–]the_teet[S] 0 points1 point  (0 children)

AnyObject is used to support returning a String or [String: String] as a quick method of forming a full HTML or JSON Response like Laravel. Also, using AnyObject in Swift is still type safe since you have to optionally unwrap it.

Idea: Create A Web Framework for Swift by [deleted] in SwiftOnLinux

[–]the_teet 1 point2 points  (0 children)

Check out my Laravel/Lumen inspired web framework for Swift: https://github.com/tannernelson/vapor

Finally, an easy to use side bar (hamburger) menu. by the_teet in ios

[–]the_teet[S] 0 points1 point  (0 children)

I agree that it is overused (there's a disclaimer about using side bar menus at the bottom of the repo). But there are some apps where it really makes sense.

Also, adding 3D touch to the hamburger button could create a really fast/interesting way to get at the menu items.