JavaScript vs Swift

JavaScript
JavaScript

41.7K
13.2K
7.3K
Swift
Swift

4.2K
2K
1.1K
Add tool

JavaScript vs Swift: What are the differences?

What is JavaScript? Lightweight, interpreted, object-oriented language with first-class functions. JavaScript is most known as the scripting language for Web pages, but used in many non-browser environments as well such as node.js or Apache CouchDB. It is a prototype-based, multi-paradigm scripting language that is dynamic,and supports object-oriented, imperative, and functional programming styles.

What is Swift? 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.

JavaScript and Swift can be categorized as "Languages" tools.

"Can be used on frontend/backend", "It's everywhere" and "Lots of great frameworks" are the key factors why developers consider JavaScript; whereas "Ios", "Elegant" and "Not Objective-C" are the primary reasons why Swift is favored.

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.

reddit, Slack, and StackShare are some of the popular companies that use JavaScript, whereas Swift is used by Slack, Lyft, and Zillow. JavaScript has a broader approval, being mentioned in 5034 company stacks & 6258 developers stacks; compared to Swift, which is listed in 979 company stacks and 526 developer stacks.

- No public GitHub repository available -

What is JavaScript?

JavaScript is most known as the scripting language for Web pages, but used in many non-browser environments as well such as node.js or Apache CouchDB. It is a prototype-based, multi-paradigm scripting language that is dynamic,and supports object-oriented, imperative, and functional programming styles.

What is Swift?

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.

Want advice about which of these to choose?Ask the StackShare community!

Why do developers choose JavaScript?
Why do developers choose Swift?
What are the cons of using JavaScript?
What are the cons of using Swift?
What companies use JavaScript?
What companies use Swift?
What are some alternatives to JavaScript and Swift?
Java
Java is a programming language and computing platform first released by Sun Microsystems in 1995. There are lots of applications and websites that will not work unless you have Java installed, and more are created every day. Java is fast, secure, and reliable. From laptops to datacenters, game consoles to scientific supercomputers, cell phones to the Internet, Java is everywhere!
Python
Python is a general purpose programming language created by Guido Van Rossum. Python is most praised for its elegant syntax and readable code, if you are just beginning your programming career python suits you best.
TypeScript
TypeScript is a language for application-scale JavaScript development. It's a typed superset of JavaScript that compiles to plain JavaScript.
jQuery
jQuery is a cross-platform JavaScript library designed to simplify the client-side scripting of HTML.
HTML5
HTML5 is a core technology markup language of the Internet used for structuring and presenting content for the World Wide Web. As of October 2014 this is the final and complete fifth revision of the HTML standard of the World Wide Web Consortium (W3C). The previous version, HTML 4, was standardised in 1997.
See all alternatives
What tools integrate with JavaScript?
What tools integrate with Swift?
    No integrations found
    Decisions about JavaScript and Swift
    Nicolas Theck
    Nicolas Theck
    Student at RocketPlay · | 3 upvotes · 7.5K views
    atRocketPlayRocketPlay
    HTML5
    SendGrid
    Node.js
    OVH
    PM2
    JSON Web Token
    PostgreSQL
    Sequelize
    ExpressJS
    CloudFlare
    nginx
    npm
    Ubuntu
    GitLab CI
    GitLab
    Webpack
    Vue.js
    JavaScript
    #Ns
    #Passport
    #Pulsejs
    #Backend
    #Frontend

    We use JavaScript in both our #Frontend and #Backend. Front-End wise, we're using tools like Vue.js , Webpack (for dev & building), pulsejs . For delivering the content, we push to GitLab & use GitLab CI (running on our own Ubuntu machine) to install (with npm) our packages, build the app trough Webpack and finally push it to our nginx server via a folder. From there, use accessing the website will get cached content thanks to CloudFlare. Back-End wise, we again use JavaScript with tools such as ExpressJS (http server), Sequelize (database, server running on PostgreSQL ) but also JSON Web Token with passport to authenticate our users. Same process used in front-end is used for back-end, we just copy files to a dist where PM2 watches for any change made to the Node.js app. Traffic doesn't go trough CloudFlare for upload process reasons but our nginx reverse proxy handles the request (which do go trough CloudFlare SSL-wise, since we're using their ns servers with our OVH domain.) Other utils we use are SendGrid for email sending & obviously HTML5 for the base Vue.js app. I hope this article will tell you more about the Tech we use here at RocketPlay :p

    See more
    Gustavo Muñoz
    Gustavo Muñoz
    Web UI Developer at Globant · | 2 upvotes · 3.9K views
    CoffeeScript
    JavaScript
    Flow (JS)
    React
    TypeScript
    Angular 2
    #ECMA
    #Angular

    Long ago when Angular 2 evolved I had to decide between the new #Angular and TypeScript or React. I really love typing my code, but forced to use TypeScript was a bit too much. I prefer the new #ECMA standard and the evolution of the old and reliable JavaScript. So finding Flow (JS) was an incredible milestone in my career as a developer. Finally, I could use types in my code, and JavaScript with the new standard. I already had the experience of CoffeeScript, so TypeScript was not an option.

    See more
    Pedro Arnal Puente
    Pedro Arnal Puente
    CTO at La Cupula Music SL · | 7 upvotes · 2.4K views
    atLa Cupula Music SLLa Cupula Music SL
    JavaScript
    ES6
    Babel
    ESLint
    Webpack
    Vue.js
    jQuery UI
    jQuery

    We are phasing out jQuery and jQuery UI in favour or Vue.js and @Vue-cli so we can support building a modern, well-architectured frontend.

    The JavaScript build pipeline is supported by Webpack , and includes tools like ESLint and Babel , so we can properly support the latest ES/JS versions, with ES6 as the minimum baseline.

    See more
    Interest over time
    Reviews of JavaScript and Swift
    Avatar of Bessalitskykh
    Software Development Consultan at MLSDev Inc.
    Review ofSwiftSwift

    The performance of Swift is almost the same as that of C++, which is considered the fastest in algorithm calculation arithmetics. Apple had this idea in mind and worked to improve the speed of Swift. For example, Swift 2.0 has beaten C++ in several computation algorithms, such as Mandelbrot algorithm. Objective-C is slower because it contains C API legacy.

    Swift is faster than Objective-C, because it removed the limitations of C language and has been improved with the help of advanced technologies that were unavailable when C was developed. As mentioned by Apple, Swift was originally designed to operate faster.

    Despite the fact that languages are different, they both integrate, and work with Cocoa and Cocoa Touch APIs, for all Apple platforms. Therefore, a regular app-user would not recognize the difference in operating speed between Objective-C vs Swift. Speed also depends on a programmer’s level and capabilities, since a slow app can be written in Swift as well.

    Learn more here https://mlsdev.com/blog/51-7-advantages-of-using-swift-over-objective-c

    Avatar of Bessalitskykh
    Software Development Consultan at MLSDev Inc.
    Review ofSwiftSwift

    Its performance approaches the one of C++ which is considered the fastest algorithm calculation arithmetics. And Apple strives to improve the speed of Swift. Learn more here https://mlsdev.com/blog/51-7-advantages-of-using-swift-over-objective-c

    Review ofJavaScriptJavaScript

    excellent!!

    How developers use JavaScript and Swift
    Avatar of Andrew Faulkner
    Andrew Faulkner uses JavaScriptJavaScript

    Almost the entire app was written in Javascript, with JSON-based configuration and data storage. The following components were written and/or configured with Javascript:

    • Most server-side scripts, all unit tests, all build tools, etc. were driven by NodeJS.
    • ExpressJS served as the 'backend' server framework.
    • MongoDB (which stores essential JSON) was the main database.
    • MongooseJS was used as the main ORM for communicating with the database, with KnexJS used for certain edge cases.
    • MochaJS, ChaiJS, and ExpectJS were used for unit testing.
    • Frontend builds were done with Gulp and Webpack.
    • Package management was done primarily with npm - with a few exceptions that required the use of Bower (also configured with JSON).
    • "Templating" was done with Javascript dialect JSX.
    • The frontend was build primarily with ReactJS (as the View) and Redux (as the Controller / Store / frontend model).
    • Configuration was done with json files.

    The only notable exceptions were the use of SCSS (augmented by Compass) for styling, Bash for a few basic 'system chores' and CLI utilities required for development of the app (most notably git and heroku's CLI interface), and a bit of custom SQL for locations where the ORM extractions leaked (the app is DB-agnostic, but a bit of SQL was required to fill gaps in the ORMs when interfacing with Postgres).

    Avatar of OutSystems
    OutSystems uses JavaScriptJavaScript

    Read more on how to extend the OutSystems UI with Javascript here.

    OutSystems provides a very simple to use AJAX mechanism. However, developers can also use JavaScript extensively to customize how users interact with their applications, to create client side custom validations and dynamic behaviors, or even to create custom, very specific, AJAX interactions. For example, each application can have an application-wide defined JavaScript file or set of files included in resources. Page-specific JavaScript can also be defined.

    Avatar of Gorka Llona
    Gorka Llona uses JavaScriptJavaScript

    This GNU/GPL licensed Javascript library allows you to draw complex organizational charts that can't be drawn using Google's tool or equivalents. Orgchart structures are specified with JSON and can be generated on-the-fly by server-side scripts and databases. Events can be attached to clicks over the boxes. Multiple options can be defined; look at the repo for examples. This 1300-code-lines software component with contributors from 8 countries (and others for which I have to integrate their works) appears in the first page of Google Search results when searching for "Javascript Organizational Chart Library".

    Avatar of Cloudcraft
    Cloudcraft uses JavaScriptJavaScript

    JavaScript gets a bad rep, quite undeservedly so in my opinion. Today, JS is closer to functional languages than to the traditional-OO languages, and when used as such provides a great development experience. The pace of development is just picking up with transpilers like Babel making future advanced language features available to the masses today. At Cloudcraft.co, we write 100% of both the front-end (with React) and the backend (with Node.js) in Javascript, using the latest ES6 and even some ES7 features. This is not your grandfather's Javascript!

    Avatar of Lawrence Cheuk
    Lawrence Cheuk uses SwiftSwift

    iPhone app, a new born language, it may good but the IDE, xcode is bad compare with Visual Studio. It just like a baby. playground can only use without connect to other library...you can not do a simply refactor of renaming a variable. You can go to definition and find reference, but you can not go to implementation....I should write them on xcode not here basically it is not the fault of swift, but it tightly to it, unless you want to use a notepad to write it.

    Avatar of MOKA Analytics
    MOKA Analytics uses JavaScriptJavaScript

    The application front-end is written in JavaScript (ES6). We originally selected it over TypeScript because many library typings at the time were still flaky and the transpilation time was slow.

    We are now re-considering TypeScript because 1) the tooling has improved significantly, and 2) and the root cause of the majority of our front-end bugs are related to typing (despite having PropTypes).

    Avatar of Refractal
    Refractal uses SwiftSwift

    Most of our newer apps are written completely in swift, with our older ones and some special cases using a mix of Swift and Objective-C, but with Swift 2, the language is pretty much a must-use. "guard" is <3.

    Avatar of Flutter Health Inc.
    Flutter Health Inc. uses SwiftSwift

    Flutter is coded with Swift v.2.3 and can be run with Xcode v.8.2.1. To launch in Xcode 9.3, the code needs to be migrated to Swift 4.1

    Avatar of Maxim Ananov
    Maxim Ananov uses SwiftSwift

    Most of the app code was gradually rewritten in Swift for better performance and code maintenance.

    Avatar of JINJA Ltd.
    JINJA Ltd. uses SwiftSwift

    Our native iOS app is built on Swift, and most of the basic function is still written in Swift

    How much does JavaScript cost?
    How much does Swift cost?
    Pricing unavailable
    Pricing unavailable