3 ms·
What's your experience with Vapor? Suppose I've got a Linux box with a MySQL database, setup with a couple of tables. Maybe like a messageboard with Users, Post
by bartvk 6y ago
What's your experience with Vapor? Suppose I've got a Linux box with a MySQL database, setup with a couple of tables. Maybe like a messageboard with Users, Posts and Comments. How many days would it take to implement a REST API for that? And a couple of simple web admin screens?
- mrtksn 6y agoNot much, unfortunately. Some of the integrations that I need, like firebase, don't have official frameworks for Swift beyond iOS. For example, I need to be able connect to Firestore and listen continuously for new data and changes so I can fetch them, do some calculations and put the results back on Firestore. I am doing it with NodeJS because of the official support but I have to tell you that it melts my brain when I have to switch to NodeJS way of thinking and back again. If I could have used Vapor, I would have been able to just use some the already implemented algorithms in the user facing App instead of re-implementing everything in again but this time in a NodeJS way.
- alexashka 6y agoIt's a joke compared to the ruby on rails or node ecosystem. It is about ecosystems, not languages. Swift's ecosystem is Apple products. If you're not doing that, don't use Swift. You will have to learn and use multiple languages and multiple ecosystems regardless because each ecosystem insists on using its own language and tools. So just use the most popular one for each - it will be the most polished with the fewest number of gotchas. At this point, the clear winners for each ecosystem are Kotlin, Swift, Typescript, C# and C++ if you're doing games. If you write a todo app on each platform, you'll realize you're using the same set of language features with different syntax - that should lessen the anxiety of learning a new language. Once you're free and nimble, you'd have to be nuts to choose anything but the right tool for the job or when in doubt, the most popular.
- deleted 6y ago[deleted]
- bartvk 6y agoWhy do you say it's a joke? Is it because of your experience with it, did you compare features, etc., what is the reason?
- pjbster 6y agoI am in the process of learning Vapor. You need to be comfortable with Swift closures as Vapor uses them everywhere. The SwiftNIO EventLoopFuture is prevalent too and there's a rich API over that which I'm still getting to grips with. To my mind, the best learning resource is Tim Condon et. al.'s Server-Side Swift with Vapor (Ray Wenderlich publishing) but this book needs to be updated. Vapor 4 was released in April but the ORM (Fluent) and template engine (Leaf) weren't upgraded at the same time (June and November, respectively). The first half of the book was updated in September but everything else has been on hold waiting for the Leaf release. My progress through latter part of the book has been slow whilst I translate the examples and wrestle with the compiler errors brought on by my unamiliarity with the above concepts. Tim C. is on the case and is very active and helpful on the forums so I expect the new version of his book will be finished quickly. Anyway, to answer the question: Vapor should be nearly as productive as Rails once you become familiar with it. There's an offically supported MySQL driver for Fluent but no admin screen builder like you might find on Django, for example, so you'd have to put those together yourself.