#nest js vs express js
Explore tagged Tumblr posts
Text
Sugarcube, flat stats and setter links
As I spent an unspecified time trying to figure it out, maybe it will spare someone the trouble or build towards intuition for how stats work. Or maybe this is bait to see if anyone knows a better solution 😏
First of all, flat stats vs fairmath stats. Fairmath stat accumulation is designed to represent stat gain as inversely relative: the higher your stat value, the smaller your absolute gain would be expressed by the same relative number. E.g. 10% gain at 90 is different from 10% at 15. A bonus (and very important) effect of this is that the stat value increased or decreased via fairmath will never fall below 0 or rise above 100, doing all the stat clamping for you.
Fairmath is easy to test and observe in ChoiceScript, where you can run thousands of tests automatically. You cannot do that in Twine. This is my primary motivation for going with flatmath for my SugarCube project. Which means that someone has to handle clamping, as a gain of 10 at stat value 95 will set the value above 100.
The frequent code for handling that is during change:
<<set $stat to Math.clamp($stat + 5, 0, 100)>>
which, in this example, increases variable $stat by 5 and makes sure the result is not smaller than 0 and not greater than 100: clamping.
My problem with it is how much code repetition is there and how incredibly copy paste error prone this is. You will no doubt be copy pasting this code all over your game files and will need to make sure you are replacing the variable name twice each time, lest one variable will end up with the value of another in an oversight that is way too easy to miss. Ideally we want to specify not only the name of the variable, but also our bounds (0 and 100 respectively) only once.
There are two answers to this problem: widgets and JavaScript. A widget for this is one and done, but it is more fuss to integrate it into code, I found. In the JS solution you would need to figure out a function that works for your variable storage schema.
Let's cover the widget solution first:
<<widget "modify">> <<print '<<set ' + $args[0] + ' to Math.clamp(' + $args[0] + ' + ' + $args[1] + ', 0, 100)>>'>> <</widget>>
Not only will the above check that each resulting value is within the [0; 100] range, it accepts the variable name as a parameter, meaning it will work for any stat (though you would need to pass the variable name as a String) and for subtraction too:
<<modify "$stat" -18>>
Now to problems. For my links between passages in the format for Twine I use, SugarCube, I strongly prefer the structure of setters:
[[Link text|NextPassageName][stat modifications]]
Calling a widget is not possible inside a setter link though. You would either need to do that in the next passage, which is inconvenient if you do not need that passage for anything else, or to marry two syntaxes in this unholy matrimony:
<<link [[Link text|NextPassageName]]>> <<set $otherstat to "wowza">> <<modify "$stat" -18>> <</link>>
And this is just one link/option.
Now, for the price of extra JS code you can avoid all this. Depending on how you store your game variables, flat or in objects, you can employ tricks to save you time and code lines.
window.modifyStatA = function(value) { State.variables.StatA = Math.clamp(State.variables.StatA + value, 0, 100); }
This anywhere in your custom JS file for the game will allow to do the following:
[[Link text|NextPassageName][modifyStatA(-18), $otherstat to "wowza"]]
and will change the value of $StatA by subtracting 18 upon clicking that link/option.
You can also do the following:
window.modifyStat = function(statName, value) { State.variables[statName] = Math.clamp(State.variables[statName] + value, 0, 100); }
which creates a more generic function:
[[Link text|NextPassageName][modifyStat("StatA", -18), $otherstat to "wowza"]]
As you can see, this is suitable for flat stat storage (which I personally do not do). I suppose for the nested stats you could specify the object names as inputs in their order of hierarchy and access them so for a generic function, but I am not sure yet how to do that for a variable number of levels, e.g. Parent.StatGroup.statA vs Parent.statB
I believe this is geared to the very specific way I personally structure my passages and links, so I am ready to be proven wrong 😅
Cheers!
#twine#sugarcube#twine tutorial#I realized the generic JS function solution as I was typing this so for this alone it was a very useful exercise lmao#I feel like there should be a way to modify the prototype of the JS object but everything I tried led to an error
22 notes
·
View notes
Text
We are an experienced Node JS development company in India, and using our working experience we will explain NestJS vs. Express. Our blog revolves around the concrete comparison between NestJS and ExpressJS along with their features.
#node js development company#nest js development#express js development#software developer#web development#express js#nest js vs express js#hire node js developers india
0 notes
Photo
hydralisk98′s web projects tracker:
Core principles=
Fail faster
‘Learn, Tweak, Make’ loop
This is meant to be a quick reference for tracking progress made over my various projects, organized by their “ultimate target” goal:
(START)
(Website)=
Install Firefox
Install Chrome
Install Microsoft newest browser
Install Lynx
Learn about contemporary web browsers
Install a very basic text editor
Install Notepad++
Install Nano
Install Powershell
Install Bash
Install Git
Learn HTML
Elements and attributes
Commenting (single line comment, multi-line comment)
Head (title, meta, charset, language, link, style, description, keywords, author, viewport, script, base, url-encode, )
Hyperlinks (local, external, link titles, relative filepaths, absolute filepaths)
Headings (h1-h6, horizontal rules)
Paragraphs (pre, line breaks)
Text formatting (bold, italic, deleted, inserted, subscript, superscript, marked)
Quotations (quote, blockquote, abbreviations, address, cite, bidirectional override)
Entities & symbols (&entity_name, &entity_number,  , useful HTML character entities, diacritical marks, mathematical symbols, greek letters, currency symbols, )
Id (bookmarks)
Classes (select elements, multiple classes, different tags can share same class, )
Blocks & Inlines (div, span)
Computercode (kbd, samp, code, var)
Lists (ordered, unordered, description lists, control list counting, nesting)
Tables (colspan, rowspan, caption, colgroup, thead, tbody, tfoot, th)
Images (src, alt, width, height, animated, link, map, area, usenmap, , picture, picture for format support)
old fashioned audio
old fashioned video
Iframes (URL src, name, target)
Forms (input types, action, method, GET, POST, name, fieldset, accept-charset, autocomplete, enctype, novalidate, target, form elements, input attributes)
URL encode (scheme, prefix, domain, port, path, filename, ascii-encodings)
Learn about oldest web browsers onwards
Learn early HTML versions (doctypes & permitted elements for each version)
Make a 90s-like web page compatible with as much early web formats as possible, earliest web browsers’ compatibility is best here
Learn how to teach HTML5 features to most if not all older browsers
Install Adobe XD
Register a account at Figma
Learn Adobe XD basics
Learn Figma basics
Install Microsoft’s VS Code
Install my Microsoft’s VS Code favorite extensions
Learn HTML5
Semantic elements
Layouts
Graphics (SVG, canvas)
Track
Audio
Video
Embed
APIs (geolocation, drag and drop, local storage, application cache, web workers, server-sent events, )
HTMLShiv for teaching older browsers HTML5
HTML5 style guide and coding conventions (doctype, clean tidy well-formed code, lower case element names, close all html elements, close empty html elements, quote attribute values, image attributes, space and equal signs, avoid long code lines, blank lines, indentation, keep html, keep head, keep body, meta data, viewport, comments, stylesheets, loading JS into html, accessing HTML elements with JS, use lowercase file names, file extensions, index/default)
Learn CSS
Selections
Colors
Fonts
Positioning
Box model
Grid
Flexbox
Custom properties
Transitions
Animate
Make a simple modern static site
Learn responsive design
Viewport
Media queries
Fluid widths
rem units over px
Mobile first
Learn SASS
Variables
Nesting
Conditionals
Functions
Learn about CSS frameworks
Learn Bootstrap
Learn Tailwind CSS
Learn JS
Fundamentals
Document Object Model / DOM
JavaScript Object Notation / JSON
Fetch API
Modern JS (ES6+)
Learn Git
Learn Browser Dev Tools
Learn your VS Code extensions
Learn Emmet
Learn NPM
Learn Yarn
Learn Axios
Learn Webpack
Learn Parcel
Learn basic deployment
Domain registration (Namecheap)
Managed hosting (InMotion, Hostgator, Bluehost)
Static hosting (Nertlify, Github Pages)
SSL certificate
FTP
SFTP
SSH
CLI
Make a fancy front end website about
Make a few Tumblr themes
===You are now a basic front end developer!
Learn about XML dialects
Learn XML
Learn about JS frameworks
Learn jQuery
Learn React
Contex API with Hooks
NEXT
Learn Vue.js
Vuex
NUXT
Learn Svelte
NUXT (Vue)
Learn Gatsby
Learn Gridsome
Learn Typescript
Make a epic front end website about
===You are now a front-end wizard!
Learn Node.js
Express
Nest.js
Koa
Learn Python
Django
Flask
Learn GoLang
Revel
Learn PHP
Laravel
Slim
Symfony
Learn Ruby
Ruby on Rails
Sinatra
Learn SQL
PostgreSQL
MySQL
Learn ORM
Learn ODM
Learn NoSQL
MongoDB
RethinkDB
CouchDB
Learn a cloud database
Firebase, Azure Cloud DB, AWS
Learn a lightweight & cache variant
Redis
SQLlite
NeDB
Learn GraphQL
Learn about CMSes
Learn Wordpress
Learn Drupal
Learn Keystone
Learn Enduro
Learn Contentful
Learn Sanity
Learn Jekyll
Learn about DevOps
Learn NGINX
Learn Apache
Learn Linode
Learn Heroku
Learn Azure
Learn Docker
Learn testing
Learn load balancing
===You are now a good full stack developer
Learn about mobile development
Learn Dart
Learn Flutter
Learn React Native
Learn Nativescript
Learn Ionic
Learn progressive web apps
Learn Electron
Learn JAMstack
Learn serverless architecture
Learn API-first design
Learn data science
Learn machine learning
Learn deep learning
Learn speech recognition
Learn web assembly
===You are now a epic full stack developer
Make a web browser
Make a web server
===You are now a legendary full stack developer
[...]
(Computer system)=
Learn to execute and test your code in a command line interface
Learn to use breakpoints and debuggers
Learn Bash
Learn fish
Learn Zsh
Learn Vim
Learn nano
Learn Notepad++
Learn VS Code
Learn Brackets
Learn Atom
Learn Geany
Learn Neovim
Learn Python
Learn Java?
Learn R
Learn Swift?
Learn Go-lang?
Learn Common Lisp
Learn Clojure (& ClojureScript)
Learn Scheme
Learn C++
Learn C
Learn B
Learn Mesa
Learn Brainfuck
Learn Assembly
Learn Machine Code
Learn how to manage I/O
Make a keypad
Make a keyboard
Make a mouse
Make a light pen
Make a small LCD display
Make a small LED display
Make a teleprinter terminal
Make a medium raster CRT display
Make a small vector CRT display
Make larger LED displays
Make a few CRT displays
Learn how to manage computer memory
Make datasettes
Make a datasette deck
Make floppy disks
Make a floppy drive
Learn how to control data
Learn binary base
Learn hexadecimal base
Learn octal base
Learn registers
Learn timing information
Learn assembly common mnemonics
Learn arithmetic operations
Learn logic operations (AND, OR, XOR, NOT, NAND, NOR, NXOR, IMPLY)
Learn masking
Learn assembly language basics
Learn stack construct’s operations
Learn calling conventions
Learn to use Application Binary Interface or ABI
Learn to make your own ABIs
Learn to use memory maps
Learn to make memory maps
Make a clock
Make a front panel
Make a calculator
Learn about existing instruction sets (Intel, ARM, RISC-V, PIC, AVR, SPARC, MIPS, Intersil 6120, Z80...)
Design a instruction set
Compose a assembler
Compose a disassembler
Compose a emulator
Write a B-derivative programming language (somewhat similar to C)
Write a IPL-derivative programming language (somewhat similar to Lisp and Scheme)
Write a general markup language (like GML, SGML, HTML, XML...)
Write a Turing tarpit (like Brainfuck)
Write a scripting language (like Bash)
Write a database system (like VisiCalc or SQL)
Write a CLI shell (basic operating system like Unix or CP/M)
Write a single-user GUI operating system (like Xerox Star’s Pilot)
Write a multi-user GUI operating system (like Linux)
Write various software utilities for my various OSes
Write various games for my various OSes
Write various niche applications for my various OSes
Implement a awesome model in very large scale integration, like the Commodore CBM-II
Implement a epic model in integrated circuits, like the DEC PDP-15
Implement a modest model in transistor-transistor logic, similar to the DEC PDP-12
Implement a simple model in diode-transistor logic, like the original DEC PDP-8
Implement a simpler model in later vacuum tubes, like the IBM 700 series
Implement simplest model in early vacuum tubes, like the EDSAC
[...]
(Conlang)=
Choose sounds
Choose phonotactics
[...]
(Animation ‘movie’)=
[...]
(Exploration top-down ’racing game’)=
[...]
(Video dictionary)=
[...]
(Grand strategy game)=
[...]
(Telex system)=
[...]
(Pen&paper tabletop game)=
[...]
(Search engine)=
[...]
(Microlearning system)=
[...]
(Alternate planet)=
[...]
(END)
4 notes
·
View notes
Photo



‘MONKEY KING’, Greatmetal, Beijing, China.
One thing that wasn’t foreseen for the Japan VS America Giant Robot Duel, yet speaks positively for the potential of an international mech-fighting league, was the possibility of other countries wanting in on the action.
In April of 2017, MegaBots received a challenge of their own, from a metalworking outfit called Greatmetal, located in Beijing, China. They wanted to fight robots too. And they had their own Chinese-stylized mech ready to go, the ‘Monkey King’.
Led by builder Sun Shiqian, Greatmetal managed to put their robot together in as little as two months, spending ‘A few hundred million yuan’ to pull all its components together. Sun himself is no stranger to metal art projects, having made a living building and welding numerous mobile displays and sculptures. With his expertise, Monkey King came together rather quickly.
The mech weighs in the neighborhood of four tons, and like the Megabot Mark II, its height can vary, topping out as an estimated 14 feet. One of the things that makes Monkey King stand out is the fact that it actually possesses a four-legged walk, and is capable of transitioning from that to a stationary bipedal form, the front arms freed up for combat. A large metal rod mounted on the bot’s back is its primary weapon, as it’s intended to reach back, grasp, and then wield it against its opponents, just like the legendary figure that inspired the mech’s name and form, Son Wukong.
It is a single-seater, and the cockpit rests in the chest, with a single pane allowing the pilot to look outside. It’s not known just yet what the head houses, other than a potential camera system. It is capable of rotation, at the very least.
As of this writing, the full list of abilities the Monkey King possesses is not known. In a native-language interview, Sun speaks about potential add-ons such as a napalm spray, or ‘iron palms’. He’s even hinted that some of the mech’s abilities, he wants to keep as a surprise to his opponents until they’re revealed in the heat of battle.
In any case, the mech has the attention of the MegaBots team. They even flew the Mark II Megabot in to China to be displayed side by side with the Monkey King during G-Fest at Beijing’s Bird’s Nest Stadium. Currently the match with the Mark III and the Kuratas still takes priority, but then afterwards, both teams have expressed interest in taking on the Chinese newcomer, potentially setting the stage for an international mecha fighting league.
WHERE ARE THEY NOW?
It’s currently believed that the Monkey King is still being housed at Greatmetal’s headquarters in Beijing. Sun has admitted that the robot isn’t fully complete yet, and so is currently undergoing more work, especially after the reveal of the Mark III Megabot Eagle Prime. This could set the tone of the potential future sport, as teams race to match and outdo their opponents, one match at a time.
This article will be updated if more information becomes available.
Videos of the Monkey King in action.
youtube
youtube
References:
Nerdist, ‘China’s ‘Monkey King’ Mech Set to Enter Giant Fighting Robot League’, circa May 2, 2017. http://nerdist.com/chinas-monkey-king-mech-set-to-enter-giant-fighting-robot-league/
Engadget, ‘China takes its turn at a giant fighting robot’, circa April 30, 2017. https://www.engadget.com/2017/04/30/china-giant-fighting-robot/
C|net News, ‘Chinese mech Monkey King wants in on MegaBots fighting fray‘, circa May 1, 2017. https://www.cnet.com/news/chinese-monkey-king-fighting-robot-megabots-kuratas/
Tencent News, ‘Chinese and American giant mech debut exclusive heroes behind the hero’, circa April 24, 2017. https://translate.google.com/translate?sl=auto&tl=en&js=y&prev=_t&hl=en&ie=UTF-8&u=http%3A%2F%2Fview.inews.qq.com%2Fa%2F20170424A08QTK00&edit-text=&act=url
#mecha#mech spotting#Greatmetal#Monkey King#Sun Shiqian#real life mecha#Mech Profile#mech video#Japan VS America Robot Duel#entertainment
2 notes
·
View notes
Link
Just from being a simple client-side scripting language, JavaScript has evolved over the years to turn out to be a powerful programming language. Today you can use JavaScript for developing server-side applications apart from just working on client-side applications. Both Angular.js and Node.js are open source JavaScript-based technologies which are widely used today. Here Node.js is a cross-platform runtime environment while AngularJS is one of the top JavaScript framework. Angular helps the developers to build web applications which are dynamic in nature using HTML template language and following the MVC design pattern. On the other hand, programmers can make use of Node.js to build server-side applications that are scalable in nature by making use of JavaScript as the programming language for server-side coding. In short, by using Node.js platform and Angular framework, you can work towards building powerful server-side and client-side for applications. Such a cross-platform application will be feature-rich and interactive in nature and will be build using the JavaScript language. However, both technologies are different from each other in terms of many factors. So, here let’s see them in detail. What is Node.js? Node.js is a cross-platform runtime environment and library. It is used to run JavaScript applications outside the web browser. You can use it to build server-side applications and, it is free to use and open source in nature. The applications in Node.js are written in JavaScript. Here the Node.js applications can run in the Node.js runtime on Microsoft Windows and Linux. In order to simplify the web development process, this framework offers a rich library which contains a number of different JavaScript modules. What is Angular? If you want to develop dynamic web apps with a structural framework, you need to go for Angular. Angular lets the developers make use of HTML as the template language in the project and here the components of the application get expressed clearly and briefly using HTML syntax. Here the main goal is to achieve simplification and Node.js is a full-featured JavaScript framework. It supports the MVC structure and helps in the development of single page web apps that are dynamic in nature. Google Trends Let’s see how Angular and Node.js are performing out there. According to similartech survey here are the number of sites used both technologies Features of Node.js It is fast It is asynchronous and event driven No buffering Highly scalable single Threaded No buffering Open source Features of Angular The MVC framework HTML user interface Access to POJO model Filtering Unit testing facilities Behaviour with directives Templates Pros and Cons of Node.js Pros of Node.js Node.js offers Scalability One of the main reasons why developers go ahead with Node.js is that it helps them scale the application in any direction with ease. Just by adding nodes in the existing system, it is possible to scale the application horizontally. Moreover, during the vertical scaling of the application, it is possible with Node.js to add in extra resources to the single nodes. So compared to other JavaScript servers, Node.js is highly scalable. It is used as a single programming language Node.js can be called as the right solution to right JavaScript codes for server-side applications. This means using the runtime environment, Node.js developers can easily write codes for frontend and backend web applications. This means there is no need to have any other server-side programming language to use. It is easy to learn Most of the front-end developers have a good understanding of JavaScript as it is one of the most popular programming languages out there. This makes it easy for them to start using Node.js quickly in the backend. Node.js needs less to work on and it is easier to learn. The support of an active and large community Node.js enjoys amazing support of large and active developers through its community who keep on contributing to the JavaScript technology continuously for further development and improvement. The JavaScript programmers offer strong support to the groups of developers by offering them easy and ready-made solutions in GitHub along with codes. It is expected that the developers will find it encouraging and will contribute to the community in the coming years. Offers high performance Node.js makes use of the Google V8 JavaScript engine to interpret the JavaScript code. This way the JavaScript code gets directly compiled to the machine code. This way, it becomes possible to implement the code faster and easier in an effective manner. As the runtime environment enjoys the support of non-blocking I/O operations, the speed of code execution gets better too. Offers advantage of caching Node.js comes with an open source runtime environment which provides the facility of caching single modules. The moment a request comes for the first module, it gets cached in the memory of the application. With caching, it becomes possible to load the app quickly and get back to the user faster, thus saving the developers from re-executing the codes. Benefits of Fullstack JS With Node.js, you can easily serve the client and server side applications, which make it a full-stack JavaScript. This way, there is no need for you to hire separate developers for frontend and backend development, which saves you a lot of time and money. Freedom to develop apps For the developers, Node.js offers the freedom to develop software and apps. In the case of Ruby on Rails, you will not find this feature due to the presence of some guidelines. While with app development, you can start everything from scratch. Support for tools that are used commonly It is possible for developers to get support for a number of commonly used tools with Node.js. Cons of Node.js A strong library support system is absent Compared to other programming languages, JavaScript does not come with a robust and well-equipped library system. This way for executing different tasks like processing the images, ORM, XML parsing, handling database operations, etc. developers are forced to take the support of the common library. For developers working on Node.js, it becomes difficult even to implement common tasks. API is not stable One of the main issues that developers encounter is the instability of API. Sometimes, the new API comes with issues of being incompatible to changes backward. This way the developers have to work towards making necessary changes in the accessible code bases so that it achieves compatibility with the latest version API of Node.js. Asynchronous programming model Adopting the asynchronous programming, a model can be considered as the main requisite for adding scalability in the applications. Compared to the linear blocking I/O programming, a number of developers find Node.js to be more difficult. With asynchronous programming, chances are more than the codes become clumsier and this way, the developers are more inclined towards working on nested calls. Pros and cons of Angular Pros of Angular Two-way data binding With AngularJS, it is possible to have data binding in an easier and faster manner without the involvement of a developer. With the two-way data binding, it becomes possible to see any changes made in the view directly in the model at the same time and vice versa. DOM manipulation Compared to other JavaScript frameworks, the duty of the developer to manipulate DOM ends conveniently with Angular. This becomes possible because of the two-way data binding that it supports. This way the time and effort needed to code, translate and update the elements in the DOM gets saved. Faster application prototyping Rapid prototyping is actually a kind of a buzzword which is taking rounds around us. It is possible to build app prototypes with great functionality in no time with fewer amounts of codes. Once it is out, you can collect user feedback to make necessary changes without getting irritated. Use of directives In order to keep the HTMP pages and scripts clean and properly organized, AngularJS makes use of directives. This helps you bring together some specific functions and write independent codes and use them repeatedly. The framework also lets the developers build custom directives apart from offering a set of pre-defined directives. Responsive web It is possible to offer outstanding user experience with the use of AngularJS. It does by offering fast-loading, responsive and easily navigating apps and websites. Improved server performance The burden from the server CPUs gets reduced because of the support for caching and other processes. So because of the reduced traffic, the server is said to function well and it responds to the API calls and serves only the static files. The MVVM architecture AngularJS brings on table the MVC and MVVM design patterns so as to implement in projects, strong base for app performance. Such kind of design divisions keeps the design and visual presentation separate from data and so it becomes easy to carry out the development of complex projects with ease. The plain HTML templates Another good thing you can have from the framework is the use of plain HTMP templates. As DOM elements the templates are passed to the compiler and this itself offers some advantage in terms of better workflow. Moreover, with it, you can easily carry out extension, reusability, and manipulation of templates. Highly testable products One of the best things about choosing Angular is that you get to build applications and websites which are highly testable. By offering end-to-end testing and unit testing, Angular makes testing and debugging a simple process more than what you can imagine. It is possible to isolate and mock various components by using dependency injections. Fast development Getting familiar with AngularJS is not tough if you are a fast learner. Once you have learned to work on it, you will be able to experience that the development efforts and time has come down. Cons of Angular JavaScript support is mandatory Just think about a situation where your PC can access the server, but the support for JavaScript is not available. So the users who are associated will not be able to access your web apps or websites. If the number of such users increases significantly, then the web properties of your Angular-based solution become less useful. With plain HTML-based web, you will not face this issue. Less experience with MVC If the developer has no idea of the MVC design pattern and follows the traditional approach, then it can be time-consuming to use Angular. Again, if you have no time to experiment the choosing Angular will not be wise. Still, if you want to put it to work, then it would be wise you hire experts for the job. Other difficult features In the case of Angular, using directives can be difficult. In addition, Angular comes with features like factories and dependency injections, which can prove to be an issue for traditional developers. So you get to either learn them by putting efforts and time or plan to hire experts who can handle it gracefully. The Scopes Arranged hierarchically and quite layered, it can be challenging to handle scopes, if you are working with Angular for the first time. Debugging the scopes can be one of the main issues you will be facing. For More Detailed Analysis visit our article Pros and Cons of Angular Js When to use Node and Angular? Applications of Node.js are for: Single page applications I/O bound applications Data streaming applications JSON APIs based applications Data Intensive Real-time applications Applications of AngularJS are for: Single page applications Video streaming apps User-generated content portals eCommerce Portals User-review apps Conclusion If we talk in terms of JavaScript, AngularJS and Node.js are two of the best technologies which you can have used when building your project. However, you need to understand that both of them have different features to offer and so take care of different areas differently during development. So, based on what your project demands, choose the right technology wisely.
0 notes
Text
What is the MEAN stack? JavaScript web applications
The MEAN stack is a software stack—that is, a set of the technology layers that make up a modern application—that’s built entirely in JavaScript. MEAN represents the arrival of JavaScript as a “full-stack development” language, running everything in an application from front end to back end. Each of the initials in MEAN stands for a component in the stack:
MongoDB: A database server that is queried using JSON (JavaScript Object Notation) and that stores data structures in a binary JSON format
Express: A server-side JavaScript framework
Angular: A client-side JavaScript framework
Node.js: A JavaScript runtime
A big part of MEAN’s appeal is the consistency that comes from the fact that it’s JavaScript through and through. Life is simpler for developers because every component of the application—from the objects in the database to the client-side code—is written in the same language.
This consistency stands in contrast to the hodgepodge of LAMP, the longtime staple of web application developers. Like MEAN, LAMP is an acronym for the components used in the stack—Linux, the Apache HTTP Server, MySQL, and either PHP, Perl, or Python. Each piece of the stack has little in common with any other piece.
This isn’t to say the LAMP stack is inferior. It’s still widely used, and each element in the stack still benefits from an active development community. But the conceptual consistency that MEAN provides is a boon. If you use the same language, and many of the same language concepts, at all levels of the stack, it becomes easier for a developer to master the whole stack at once.
Most MEAN stacks feature all four of the components—the database, the front end, the back end, and the execution engine. This doesn’t mean the stack consists of only these elements, but they form the core.
MongoDB
Like other NoSQL database systems, MongoDB uses a schema-less design. Data is stored and retrieved as JSON-formatted documents, which can have any number of nested fields. This flexibility makes MongoDB well-suited to rapid application development when dealing with fast-changing requirements.
Using MongoDB comes with a number of caveats. For one, MongoDB has a reputation for being insecure by default. If you deploy it in a production environment, you must take steps to secure it. And for developers coming from relational databases, or even other NoSQL systems, you’ll need to spend some time getting to know MongoDB and how it works. InfoWorld’s Martin Heller dove deep into MongoDB 4 in InfoWorld’s review, where he talks about MongoDB internals, queries, and drawbacks.
As with any other database solution, you’ll need middleware of some kind to communicate between MongoDB and the JavaScript components. One common choice for the MEAN stack is Mongoose. Mongoose not only provides connectivity, but object modeling, app-side validation, and a number of other functions that you don’t want to be bothered with reinventing for each new project.
Express.js
Express is arguably the most widely used web application framework for Node.js. Express provides only a small set of essential features—it’s essentially a minimal, programmable web server—but can be extended via plug-ins. This no-frills design helps keep Express lightweight and performant.
Nothing says a MEAN app has to be served directly to users via Express, although that’s certainly a common scenario. An alternative architecture is to deploy another web server, like Nginx or Apache, in front of Express as a reverse proxy. This allows for functions like load balancing to be offloaded to a separate resource.
Because Express is deliberately minimal, it doesn’t have much conceptual overhead associated with it. The tutorials at Expressjs.com can take you from a quick overview of the basics to connecting databases and beyond.
Angular
Angular (formerly AngularJS) is used to build the front end for a MEAN application. Angular uses the browser’s JavaScript to format server-provided data in HTML templates, so that much of the work of rendering a web page can be offloaded to the client. Many single-page web apps are built using Angular on the front end.
One important caveat: Developers work with Angular by writing in TypeScript, a JavaScript-like typed language that compiles to JavaScript. For some people this is a violation of one of the cardinal concepts of the MEAN stack—that JavaScript is used everywhere and exclusively. However, TypeScript is a close cousin to JavaScript, so the transition between the two isn’t as jarring as it might be with other languages.
For a deep dive into Angular, InfoWorld’s Martin Heller has you covered. In his Angular tutorial he’ll walk you through the creation of a modern, Angular web app.
Node.js
Last, but hardly least, there’s Node.js—the JavaScript runtime that powers the server side of the MEAN web application. Node is based on Google’s V8 JavaScript engine, the same JavaScript engine that runs in the Chrome web browser. Node is cross-platform, runs on both servers and clients, and has certain performance advantages over traditional web servers such as Apache.
Node.js takes a different approach to serving web requests than traditional web servers. In the traditional approach, the server spawns a new thread of execution or even forks a new process to handle the request. Spawning threads is more efficient than forking processes, but both involve a good deal of overhead. A large number of threads can cause a heavily loaded system to spend precious cycles on thread scheduling and context switching, adding latency and imposing limits on scalability and throughput.
Node.js is far more efficient. Node runs a single-threaded event loop registered with the system to handle connections, and each new connection causes a JavaScript callback function to fire. The callback function can handle requests with non-blocking I/O calls and, if necessary, can spawn threads from a pool to execute blocking or CPU-intensive operations and to load-balance across CPU cores.
Node.js requires less memory to handle more connections than most competitive architectures that scale with threads—including Apache HTTP Server, ASP.NET, Ruby on Rails, and Java application servers. Thus, Node has become an extremely popular choice for building web servers, REST APIs, and real-time applications like chat apps and games. If there is one component that defines the MEAN stack, it’s Node.js.
Advantages and benefits of the MEAN stack
These four components working in tandem aren’t the solution to every problem, but they’ve definitely found a niche in contemporary development. IBM breaks down the areas where the MEAN stack fits the bill. Because it’s scalable and can handle a large number of users simultaneously, the MEAN stack is a particularly good choice for cloud-native apps. The Angular front end is also a great choice for single-page applications. Examples include:
Expense-tracking apps
News aggregation sites
Mapping and location apps
MEAN vs. MERN
The acronym “MERN” is sometimes used to describe MEAN stacks that use React.js in place of Angular. React is a framework, not a full-fledged library like Angular, and there are pluses and minuses to swapping React into a JavaScript-based stack. In brief, React is easier to learn, and most developers can write and test React code faster than they can write and test a full-fledged Angular app. React also produces better mobile front ends. On the other hand, Angular code is more stable, cleaner, and performant. In general, Angular is the choice for enterprise-class development.
But the very fact that this choice is available to you demonstrates that MEAN isn’t a limited straitjacket for developers. Not only can you swap in different components for one of the canonical four layers; you can add complementary components as well. For example, caching systems like Redis or Memcached could be used within Express to speed up responses to requests.
MEAN stack developers
Having the skills to be a MEAN stack developer basically entails becoming a full-stack developer, with a focus on the particular set of JavaScript tools we’ve discussed here. However, the MEAN stack’s popularity means that many job ads will be aimed at full-stack devs with MEAN-specific skills. Guru99 breaks down the prerequisites for snagging one of these jobs. Beyond familiarity with the basic MEAN stack components, a MEAN stack developer should have a good understanding of:
Front-end and back-end processes
HTML and CSS
Programming templates and architecture design guidelines
Web development, continuous integration, and cloud technologies
Database architecture
The software development lifecycle (SDLC) and what it’s like developing in an agile environment[Source]-https://www.infoworld.com/article/3319786/what-is-the-mean-stack-javascript-web-applications.html
62 Hours Mean Stack Training includes MongoDB, JavaScript, A62 angularJS Training, MongoDB, Node JS and live Project Development. Demo Mean Stack Training available.
0 notes