JavaScript and Elixir: Comparing Full-Stack Development Platforms for Modern Applications, Assignments of Computer science

An overview of MeteorJS, a full-stack JavaScript platform for developing modern web and mobile applications, and Elixir, a dynamic functional language designed for building scalable and maintainable applications. the benefits of using these platforms, including ease of development, automatic error checking, and deeper understanding of JavaScript. It also covers the features of each platform, such as Meteor's reactive programming and Elixir's scalability and fault-tolerance.

Typology: Assignments

2020/2021

Uploaded on 02/05/2021

ma-christel-salvador
ma-christel-salvador 🇵🇭

2 documents

1 / 9

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
MA. CHRISTEL L. SALVADOR
KEVIN L . BELVIS
2 WEB TECHNOLOGIES
1. MeteorJS
Meteor is a full-stack JavaScript platform for developing modern web and
mobile applications. Meteor includes a key set of technologies for building
connected-client reactive applications, a build tool, and a curated set of
packages from the Node.js and general JavaScript community.
Meteor allows you to develop in one language, JavaScript, in all
environments: application server, web browser, and mobile device.
Meteor uses data on the wire, meaning the server sends data, not
HTML, and the client renders it.
Meteor embraces the ecosystem, bringing the best parts of the
extremely active JavaScript community to you in a careful and
considered way.
Meteor provides full stack reactivity, allowing your UI to seamlessly
reflect the true state of the world with minimal development effort.
Easy to read code
The same way that you don’t read English sentences one word at a
time, you don’t read code one token at a time. Mostly you just look at
the shape of a certain expression, or the way it highlights in your
editor, and assume what it does. If the style of every bit of code is
consistent, that ensures that bits of code that look the same
actually are the same - there isn’t any hidden punctuation or gotchas
that you don’t expect, so you can focus on understanding the logic
instead of the symbols. One example of this is indentation - while in
JavaScript, indentation is not meaningful, it’s helpful to have all of your
code consistently indented so that you don’t need to read all of the
brackets in detail to see what is going on.
// This code is misleading because it looks like both statements
// are inside the conditional.
if (condition)
firstStatement();
secondStatement();
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download JavaScript and Elixir: Comparing Full-Stack Development Platforms for Modern Applications and more Assignments Computer science in PDF only on Docsity!

MA. CHRISTEL L. SALVADOR

KEVIN L. BELVIS

2 WEB TECHNOLOGIES

1. MeteorJS Meteor is a full-stack JavaScript platform for developing modern web and mobile applications. Meteor includes a key set of technologies for building connected-client reactive applications, a build tool, and a curated set of packages from the Node.js and general JavaScript community.  Meteor allows you to develop in one language, JavaScript, in all environments: application server, web browser, and mobile device.  Meteor uses data on the wire, meaning the server sends data, not HTML, and the client renders it.  Meteor embraces the ecosystem, bringing the best parts of the extremely active JavaScript community to you in a careful and considered way.  Meteor provides full stack reactivity, allowing your UI to seamlessly reflect the true state of the world with minimal development effort. Easy to read code The same way that you don’t read English sentences one word at a time, you don’t read code one token at a time. Mostly you just look at the shape of a certain expression, or the way it highlights in your editor, and assume what it does. If the style of every bit of code is consistent, that ensures that bits of code that look the same actually are the same - there isn’t any hidden punctuation or gotchas that you don’t expect, so you can focus on understanding the logic instead of the symbols. One example of this is indentation - while in JavaScript, indentation is not meaningful, it’s helpful to have all of your code consistently indented so that you don’t need to read all of the brackets in detail to see what is going on. // This code is misleading because it looks like both statements // are inside the conditional. if (condition) firstStatement(); secondStatement();

// Much clearer! if (condition) { firstStatement(); } secondStatement(); Automatic error checking Having a consistent style means that it’s easier to adopt standard tools for error checking. For example, if you adopt a convention that you must always use let or const instead of var, you can now use a tool to ensure all of your variables are scoped the way you expect. That means you can avoid bugs where variables act in unexpected ways. Also, by enforcing that all variables are declared before use, you can catch typos before even running any code! Deeper understanding It’s hard to learn everything about a programming language at once. For example, programmers new to JavaScript often struggle with the var keyword and function scope. Using a community-recommended coding style with automatic linting can warn you about these pitfalls proactively. This means you can jump right into coding without learning about all of the edge cases of JavaScript ahead of time. As you write more code and come up against the recommended style rules, you can take that as an opportunity to learn more about your programming language and how different people prefer to use it. JavaScript style guide Here at Meteor, we strongly believe that JavaScript is the best language to build web applications, for a variety of reasons. JavaScript is constantly improving, and the standards around ES2015 have really brought together the JavaScript community. Here are our recommendations about how to use ES2015 JavaScript in your app today.

2.Elixir

Elixir is a dynamic, functional language designed for building scalable and maintainable applications. Elixir leverages the Erlang VM, known for running low-latency, distributed and fault-tolerant systems, while also being successfully used in web development and the embedded software domain. Platform features Scalability All Elixir code runs inside lightweight threads of execution (called processes) that are isolated and exchange information via messages: current_process = self() # Spawn an Elixir process (not an operating system one!) spawn_link( fn -> send(current_process, {:msg, "hello world"}) end ) # Block until the message is received receive do

{:msg, contents} -> IO. puts(contents) end Due to their lightweight nature, it is not uncommon to have hundreds of thousands of processes running concurrently in the same machine. Isolation allows processes to be garbage collected independently, reducing system- wide pauses, and using all machine resources as efficiently as possible (vertical scaling). Processes are also able to communicate with other processes running on different machines in the same network. This provides the foundation for distribution, allowing developers to coordinate work across multiple nodes (horizontal scaling). Fault-tolerance The unavoidable truth about software running in production is that things will go wrong. Even more when we take network, file systems, and other third-party resources into account. To cope with failures, Elixir provides supervisors which describe how to restart parts of your system when things go awry, going back to a known initial state that is guaranteed to work: children = [ TCP. Pool, {TCP. Acceptor, port: 4040 } ] Supervisor. start_link(children, strategy: :one_for_one)

Extensibility and DSLs Elixir has been designed to be extensible, letting developers naturally extend the language to particular domains, in order to increase their productivity. As an example, let's write a simple test case using Elixir's test framework called ExUnit: defmodule MathTest do use ExUnit. Case, async: true test "can add two numbers" do assert 1 + 1 == 2 end end The async: true option allows test s to run in parallel, using as many CPU cores as possible, while the assert functionality can introspect your code, providing great reports in case of failures. Those features are built using Elixir macros, making it possible to add new constructs as if they were part of the language itself. Tooling features A growing ecosystem Elixir ships with a great set of tools to ease development. Mix is a build tool that allows you to easily create projects, manage tasks, run tests and more:

$ mix new my_app $ cd my_app $ mix test . Finished in 0.04 seconds (0.04s on load, 0.00s on tests) 1 tests, 0 failures Mix is also able to manage dependencies and integrates with the Hex package manager, which performs dependency resolution, fetches remote packages, and hosts documentation for the whole ecosystem. Interactive development Tools like IEx (Elixir's interactive shell) are able to leverage many aspects of the language and platform to provide auto-complete, debugging tools, code reloading, as well as nicely formatted documentation: $ iex Interactive Elixir - press Ctrl+C to exit (type h() ENTER for help) iex> h String.trim # Prints the documentation for function iex> i "Hello, World" # Prints information about the given data type