Need advice about which tool to choose?Ask the StackShare community!
ES6 vs Swift: What are the differences?
Developers describe ES6 as "The next version of JavaScript". Goals for ECMAScript 2015 include providing better support for large applications, library creation, and for use of ECMAScript as a compilation target for other languages. Some of its major enhancements include modules, class declarations, lexical block scoping, iterators and generators, promises for asynchronous programming, destructuring patterns, and proper tail calls. On the other hand, Swift is detailed as "An innovative new programming language for Cocoa and Cocoa Touch". Writing code is interactive and fun, the syntax is concise yet expressive, and apps run lightning-fast. Swift is ready for your next iOS and OS X project — or for addition into your current app — because Swift code works side-by-side with Objective-C.
ES6 and Swift can be primarily classified as "Languages" tools.
"ES6 code is shorter than traditional JS" is the top reason why over 98 developers like ES6, while over 241 developers mention "Ios" as the leading cause for choosing Swift.
Swift is an open source tool with 48.2K GitHub stars and 7.71K GitHub forks. Here's a link to Swift's open source repository on GitHub.
ebay, Asana, and Intuit are some of the popular companies that use ES6, whereas Swift is used by Uber Technologies, 9GAG, and Asana. ES6 has a broader approval, being mentioned in 1440 company stacks & 1659 developers stacks; compared to Swift, which is listed in 979 company stacks and 526 developer stacks.
Hey guys, I learned the basics (OOP, data structures & some algorithms) with Python, but now I want to learn iOS development. I am considering to learn Swift, but I am afraid how the native mobile development will die out because of the cross-platform frameworks and reviews. My idea is to learn web development first and then learn React Native, and after all of that, finally Swift. What do you think about this roadmap? Should I just learn Swift first due to the pros of the native apps?
Native apps are not going to die. Especially not Swift because now Swift can be used to develop cross platform macOS and iOS apps due to the new macs having M1 chips.
I would suggest to bet more on Swift! I have developed act in React and Javascript in the past and played around with Swift a little... the performances of native code vs Javascript are way too slow compared to swift native app!
Now even more than ever M1 chip will give a boost, but if it gives a boost to JS it will give a boost also to native apps. I would seriously consider Swift more than Javascript, React or even Electron!
If asking about employment opportunities, native will never die out. There will always be opportunity for work in native mobile applications. There are also many advantages of using native over cross platform such as always having access to the latest APIs and developer libraries that may not be available to cross-platform without some native development involved or can wait until someone develops a bridge for you.
If you are asking about what you should develop with first? It really depends. React-Native is great for building proto-types or basic MVP application that doesn't require any of the latest and greatest features Apple has to offer at the moment. But if you're asking what to learn? I would say native will always give you a larger advantage as it will give you a good foundation in mobile development and provide you access to the latest native libraries. It is also a useful skill that can give you an edge in cross-platform mobile like react-native because you will most definitely encounter a situation where you will have to go down to the to native side to extend functionality or utilize APIs that are not yet out of the box.
The decision comes down to your goals and needs.
If you want to be able to create any kind of iOS app, simple or complex, learn Swift. It's indispensable if you're building specialised apps like video editing, augmented reality, machine learning or anything that uses iOS-specific APIs such as App Clips.
But if you just want to create apps that make HTTP requests and display static content such as text or basic video and music, React Native would do just fine, and you can publish the same code to Android. This is a no-brainer choice if you're on a low budget.
And if you know both, you can use both in the same app. You can add React Native screens or components inside a Swift app.
"Should I just learn Swift first due to the pros of the native apps?".
React Native builds Native Apps. Technologies like ionic
does NOT build native apps, but React Native does it.
Learning Swift seems to be a really bad idea from my point of view. Learning JavaScript is all what you need. Why? Because then Frontend, Backend, and Mobile Dev, is simple, because it's all JavaScript.
Mobile Native Development Apps will never die. Cross Plataform like React Native only exists to save time and costs for startups mainly, which is extraordinary, and indispensable often of course. But when the App get popular enough, it will probably will move to Native Development. Several improvements.
Less than 20% of the market is IOS, the rest is Android. Any developer must produce for Android and maybe support IOS. If you prototype on IOS you have to restart again for Android. React and JavaScript will run on IOS.
This post is a bit of an obvious one, as we have a web application, we obviously need to have HTML
and CSS
in our stack. Though specifically though, we can talk a bit about backward compatibility and the specific approaches we want to enforce in our codebase.
HTML
: Not much explanation here, you have to interact with HTML for a web app. We will stick to the latest standard: HTML 5
.
CSS
: Again if we want to style any of our components within he web, we have to use to style it. Though we will be taking advantage of JSS
in our code base and try to minimize the # of CSS stylesheets and include all our styling within the components themselves. This leaves the codebase much cleaner and makes it easier to find styles!
Babel
: We understand that not every browser is able to support the cool new features of the latest node/JS features (such as redue, filter, etc) seen in ES6
. We will make sure to have the correct Babel
configuration o make our application backward compatible.
Material UI (MUI)
: We need to make our user interface as intuitive and pretty as possible within his MVP, and the UI framework used by Google will provide us with exactly that. MUI provides pretty much all the UI components you would need and allows heavy customization as well. Its vast # of demos will allow us to add components quickly and not get too hung up on making UI components.
We will be using the latest version of create-react-app
which bundles most of the above along many necessary frameworks (e.g. Jest for testing) to get started quickly.
For our front-end, React is chosen because it is easy to develop with due to its reusable components and state functions, in addition to a lot of community support. Because React is popular, it would be easy to hire for it here at our company MusiCore. Our team also has experience with React already. React can be written with ES6 and ES6 has a lot of popularity and versatility when it comes to creating classes and efficient functions. Node.js will be used as a runtime environment to compile the code. Node.js also has many different types of open-source packages that can help automate some of the tasks we want to do for the application. CSS 3 will be used to style components and is the standard for that.
Optimize-js
I will not describe this tool a lot here, because it's already good done by author on github
I just want to mention that this tool wrap up all immediately-invoked functions or likely-to-be-invoked functions in parentheses what is do a great optimization a JavaScript
file for faster initial execution and parsing (based on my experience).
The performance of application where I've introduced optimize-js
improved on 20% in a common (tested in Chrome
and IE11
).
- Clarification on Readme to the optimize-js
- Some of Nolan thoughts on the virtues of compile-time optimizations can be found in "Parens and Performance" – counterpost
Is it maintaining now? - Unfortunately, no (but feel free to send PR)
Pros of ES6
- ES6 code is shorter than traditional JS109
- Module System Standardized52
- Extremly compact2
- Destructuring Assignment2
Pros of Swift
- Ios259
- Elegant180
- Not Objective-C126
- Backed by apple107
- Type inference93
- Generics61
- Playgrounds54
- Semicolon free49
- OSX38
- Tuples offer compound variables36
- Clean Syntax24
- Easy to learn24
- Open Source22
- Beautiful Code21
- Functional20
- Dynamic12
- Linux12
- Protocol-oriented programming11
- Promotes safe, readable code10
- No S-l-o-w JVM9
- Explicit optionals8
- Storyboard designer7
- Optionals6
- Type safety6
- Super addicting language, great people, open, elegant5
- Best UI concept5
- Its friendly4
- Highly Readable codes4
- Fail-safe4
- Powerful4
- Faster and looks better4
- Swift is faster than Objective-C4
- Feels like a better C++4
- Easy to learn and work3
- Much more fun3
- Protocol extensions3
- Native3
- Its fun and damn fast3
- Strong Type safety3
- Easy to Maintain3
- Protocol as type2
- All Cons C# and Java Swift Already has2
- Esay2
- MacOS2
- Type Safe2
- Protocol oriented programming2
- Can interface with C easily1
- Actually don't have to own a mac1
- Free from Memory Leak1
- Swift is easier to understand for non-iOS developers.1
- Numbers with underbar1
- Optional chain1
- Great for Multi-Threaded Programming1
- Runs Python 8 times faster1
- Objec1
Sign up to add or upvote prosMake informed product decisions
Cons of ES6
- Create Node.js1
- Suffers from baggage1
Cons of Swift
- Must own a mac6
- Memory leaks are not uncommon2
- Very irritatingly picky about things that’s1
- Complicated process for exporting modules1
- Its classes compile to roughly 300 lines of assembly1
- Is a lot more effort than lua to make simple functions1
- Overly complex options makes it easy to create bad code0