Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts

Thursday, July 04, 2024

Efficiency of React Applications Through Props, State and Context Component Development

Before we dive into this interesting topic, let's recap what we learned in the previous lesson, which you can view here. We were introduced to JSX, JSX rendering, and created a simple React component, a Book List. We also explained the folder and file structure that React creates for you whenever you create a new React application. This wasn't explained in the first lesson, which you can view here; to avoid overwhelming you with too much information right alongside the necessary installation steps. However, through practical examples, React development is so straightforward that you might wonder what you were doing all these years without React components. Due to this simplicity, starting from this lesson, we will focus more on practice and coding with simple examples that will speed up your learning and understanding.

But we won't leave you without explanations of what you're using while creating amazing things in such simple ways. Efficiency is a key factor in React application development, and one of the most important elements influencing it are Props, State, and Context. These are the basic building blocks of React components. Understanding how each of these elements works and how to use them correctly can significantly improve your application's performance and maintainability. What you've learned so far in this tutorial can only bring you to this level of React. For the next level, you need data that will fill the structure of your React components. The next lesson in the React tutorial will introduce you to working with Hooks.

A developer learns the basic building blocks, Props, State and Context in the React library

A developer learns the basic building blocks, Props, State and Context in the React library

As we mentioned, the basic building blocks of React components are Props, State, and Context. When developing React applications, it is important to balance the use of Props, State, and Context to achieve optimal efficiency and maintainability. Too many Props can lead to unnecessary application load, while excessive use of State can result in performance loss. Context should be used where it is truly necessary, avoiding excessive complexity and code clutter. Ultimately, a proper understanding and use of Props, State, and Context will help you develop efficient and maintainable React applications that provide a fast and intuitive user experience.

  • Props – properties or attributes, sometimes called the same, are a way for React components to pass data to each other. Simply put, through Props, React components can communicate and share information, facilitating modularity and code reuse. However, care must be taken when passing large objects via Props, as this can lead to unnecessary application load and reduced performance. It is always advisable to pass only the necessary data via Props and avoid passing complex data structures when not required.
  • State – represents the internal status of a component that can change over time. Proper State management is crucial for efficiently managing the application state and reactively updating the user interface. However, excessive use of State can lead to excessive re-rendering of components and performance loss. Therefore, it is important to use State only where it is truly necessary and to avoid over-expanding it.
  • Context – is a mechanism that allows data to be shared between components in the component tree without the need to pass Props through every level. This can be useful when you want certain information to be available to all components within a specific part of the application, such as user information or theme settings. However, caution should be exercised when using Context, as overuse can lead to code clutter and reduced readability.

In this lesson, we will go through three practical examples that will illustrate each of the basic building blocks of React components in a practical way.

Props: How Do I Create a User Component That Passes Data?

How to Use JSX for Powerful Rendering in React Projects, Example Book List

In the previous lesson of our React tutorial, watch it here; we covered the necessary installations and everything you need to start creating some interesting React components. You learned what React and React Native are. You created your first "Hello World" JSX application. During this process, you might have noticed how React shares many similarities with our Node.js tutorial, watch it here. In this lesson, we will explain what JSX is, what JSX rendering is, expand on the previous lesson with some details we didn't want to overwhelm you with, and help you code a simple component that demonstrates how to add a list of books to an HTML page. This lesson will definitely clarify and simplify the creation of your future React projects. If you asked developers what JSX is, you would probably get at least three different answers.

  • JSX - JavaScript Syntax eXtension, informally JavaScript XML, is a JavaScript extension that allows creating a DOM - Document Object Model tree using syntax similar to XML.
  • JSX is an XML/HTML-like syntax embedded in JavaScript code used to declare React components. It is a language used to describe the UI - User Interface created with React.
  • JSX - JavaScript XML is an extension of the JavaScript programming language that allows HTML-like code within JavaScript.

All three answers are correct even though they define JSX in a total of three different ways.

The developer uses the JSX rendering of the react project

The developer uses the JSX rendering of the react project

Pay attention and see the difference between JSX and JavaScript:

JavaScript:

const element = React.createElement('h1', null, 'Hello, world!');

JSX:

const element <h1> Hello, world! </h1>;

The simplicity of JSX is evident. But what is JSX rendering? JSX rendering is the process of converting JSX code into JavaScript objects that can then be interpreted and displayed in a web browser. When a React application runs, JSX is translated into React.createElement calls that create a virtual DOM - Document Object Model. The virtual DOM is an internal representation of the user interface structure in React. When the application's state changes, React compares the virtual DOM to the real DOM and updates only the parts that have changed, improving the application's performance. In short, JSX makes writing the user interface in React easier, while JSX rendering allows React to efficiently manage updates and maintain a fast and responsive user experience. To avoid getting lost in general theory, it's simpler to understand this entire concept through a practical example.

A Simple Way to Create a Book List Component in React

Wednesday, July 03, 2024

Learn React Quickly and Efficiently, Tips for Beginners

If you are involved in JavaScript programming, whether you're in college or working with people who have extensive experience with React, including exceptional professors and lecturers, don't be surprised if you hear statements like: “ReactJS is the best JavaScript framework!” ReactJS or React.js are just names for the same thing, which is React. Sometimes developers use these names to precisely indicate that React is used for Internet applications, but React is not a framework. React is an open-source JavaScript library used to create interfaces. It is mainly used for web interfaces, but you can also use React to create interfaces for other devices.

However, if we are talking about React Native, then we are talking about a framework that uses the React library to create mobile applications. The working principles of React Native are almost identical to React, except that React Native does not manipulate the DOM - Document Object Model via the Virtual DOM. It runs in a background process, using JavaScript directly on the end device. We will discuss React Native in a future tutorial on this blog, but for now, I hope we have clarified what React is and that things are much clearer to you. It's true that React is developed by Facebook, Instagram, and the community, but its creator is Jordan Walke, a software engineer at Facebook.

A girl learns React

A girl learns React 

Due to React's great popularity and its application in robust and large projects, many developers who haven't worked with React often have the misconception that it is also robust, complex, and difficult to learn. However, this is not true. React, an open-source JavaScript library, is simple and easy to use for creating interfaces, especially if you have a basic knowledge of HTML, CSS, and JavaScript. In fact, React doesn't have many complex concepts but rather focuses on creating and using simple components that are easily reusable. It doesn't matter whether you are creating components for large or simple small projects. Your JSX - JavaScript XML component can be a simple button on a web page or it can represent an entire page.

One thing is for sure: when you call that component, you won't need to refresh the web page. React allows you to make changes to the page while sending only one request to the server, instead of many, as is the case with PHP, Django, or the Java programming language. Just imagine how long you would have to wait and refresh each web page for every click on Facebook if Facebook didn't use React! Another point in favor of React's simplicity is the fact that it is divided into only two main APIs: the React Component API, which is responsible for parts of the web page displayed by React DOM, and React DOM, which is responsible for rendering on the web page. Everything else is just details!

Getting started with React, how to start learning React?

Wednesday, June 05, 2024

Key Differences in Code Organization, CommonJS and ES6 Module Formats in Node.js

For every beginner starting to learn and use the Node.js platform, regardless of their level of JavaScript knowledge, it can be very confusing that Node.js uses both CommonJS and ES6 module formats. And when you're asked about the ES7 specification of the scripting language, I think that's the first thing that needs to be explained. CommonJS initially emerged as a project to standardize the module ecosystem for the JavaScript programming language outside of web browsers. The CommonJS specification on how modules should work is widely used today for JavaScript on the server-side with the Node.js platform, but it is also used for JavaScript on the client-side. However, that code needs to be bundled with a transpiler since browsers do not support CommonJS. So, CommonJS is an older standard used in the Node.js platform for the module format and is now treated as the default.

Most built-in modules are created in the CommonJS module format. With the advent of ECMAScript 2015, or ES6, the module format became a significant improvement for the entire JavaScript programming language world, as well as for newer versions of the Node.js platform. Today, Node.js supports both CommonJS and ES6 module formats, and although both module formats are conceptually similar, they differ significantly in practice. Regarding the newer ES7 module format in the Node.js platform, such a thing does not exist because ES7 did not bring any new changes to the module format; rather, ES7 mainly focuses on other language features. What will change in the future, we can only speculate for now; but until then, the current support for the Node.js platform relies exclusively on CommonJS and ES6 module formats. The ES6 module format is becoming increasingly popular and a better choice for newer projects, especially in newer Node.js versions, but CommonJS is definitely still in use.

A Programmer Drinks Coffee and Thinks Before Continuing Coding

A Programmer Drinks Coffee and Thinks Before Continuing Coding

Regarding the difference between CommonJS and ES6 module formats in Node.js, the first difference is that CommonJS modules must be loaded from a module repository, such as npm. Secondly, CommonJS modules can only be accessed from the context of a Node.js application. CommonJS modules do not have exports or prototypes like ES6 modules do. Finally, the `require` function in CommonJS is not equivalent to the `import` function in ES6 modules. The main difference between CommonJS and ES6 modules is the folder structure. With CommonJS, all project dependencies are stored in a single folder called `node_modules`. With ES6 modules, each dependency is stored in its own files. This allows developers to better control how their dependencies are used and facilitates software versioning. But you should also know that CommonJS is a module system inspired by Microsoft’s AMD API.

It allows modules to be written similarly to AMD modules, with the main difference being that CommonJS modules can be loaded in any Node.js environment. ES6 modules are a new module system developed by Google that enables greater modularity and reusability across different programming languages. The advantage of using ES6 modules is that they can be translated into native code, making them faster and more efficient than CommonJS modules. However, the most important thing for any beginner regarding the Node.js platform is simply that CommonJS supports dynamic module loading, meaning you can import modules during program execution. Module loading in CommonJS is synchronous, which means it is blocking. This can lead to performance issues in some situations. Variables defined within a module are private and invisible outside the module, achieving local scope.

However, ES6 represents a significant update to the JavaScript programming language, bringing numerous new functionalities and improvements. Notably, arrow functions provide a shorter and more readable way to define functions while maintaining the value of `this` within the function to the value that was current when the function was defined. ES6 allows for the destructuring of objects and arrays to easily extract data and also introduces promises for better handling of asynchronous operations instead of using callback functions. We could list differences endlessly, but it’s best to recognize them through practice and using both module formats in Node.js.

Step by Step: How to efficiently port CommonJS code to ES6 modules

Building Node.js Modules, From Concept to Implementation

If you have familiarized yourself with what Node.js is and what it isn't, take a look here; and if you have already installed Node.js on your computer; completed lesson 1; created a small Hello World program. Additionally, if you are using a Linux operating system, such as the Ubuntu distribution, even on a virtual machine, and you have Visual Studio Code installed; then you are definitely ready to learn and code in the JavaScript programming language globally using the Node.js platform. We say globally because not every JavaScript code will work on the Node.js platform. Some things are coded differently. Yes, it is true that you can follow our Node.js tutorial on any operating system; similarly, instead of Visual Studio Code, you can use any IDE - Integrated Development Environment, our recommendation remains Ubuntu and Visual Studio Code.

Of course, the choice is always yours. Unlike various frameworks, when we talk about Node.js, we are talking about a platform, more precisely a multi-platform environment. The Node.js platform allows us to execute JavaScript programming language on the server side or completely outside of the web browser. Node.js has an event-driven architecture capable of performing asynchronous input and output. Which essentially also means that the entire Node.js ecosystem is based on modules through which such events are executed. But what are modules? You can easily understand modules as smaller building blocks of code that divide an application into smaller parts or can even be used in entirely different parts of a program and other programs.

A Programmer Create Node.js Modules

A Programmer Create Node.js Modules

Modules in the Node.js platform mostly contain some functionality coded in the JavaScript programming language, but in such a way that they hide the implementation and provide an explicitly declared API - Application Programming Interface for the module. There are two basic types of modules in Node.js. The first is built-in or Core modules, while the second is non-standard or Custom modules. When it comes to built-in modules, they can also be produced by various other manufacturers. Built-in modules are usually installed into the project you are working on, and the installed module is called a package.

The npm package repository is a vast library of modules available to you to create and develop your Node.js application more easily, better, and faster. As for non-standard modules, you can create and use them in your own project. These modules are user-defined and are not built into Node.js by default. They are used when you want to organize your code into multiple files for better readability and maintenance. However, you can also publish your own packages, which other developers can then use. When Node.js was created, the ES6 module format did not exist, and only the CommonJS module format was used.

Today, both are used. You can recognize the ES6 module format by the *.mjs file extension, although Node.js can be configured to recognize *.js files as ES6 module format. Both types of modules are conceptually similar but differ significantly in practical terms. Working with modules in Node.js is a vast concept that extends throughout the entire Node.js tutorial, and only through practical work with many lessons will you gain a true insight into modules in Node.js. Therefore, consider this lesson just the beginning of the journey through modules in Node.js. It's time to move to the practical level and, through small practical steps, get to know the great possibilities and features that Node.js offers.

From scratch to modules: How to create and run your first Node.js module?

Monday, June 03, 2024

Node.js from Scratch, Getting Started with Backend Development

What is Node.js? Before we answer this question, it’s better to first clarify what it is not. Node.js is not an enhanced JavaScript programming language, nor is it a framework for JavaScript developers. In short, Node.js is a platform for developing web applications, application servers, any type of network server or client, and a general-purpose development environment based on JavaScript that executes on the server side and is built on asynchronous events. When we say platform, we mean much more than a platform; we mean cross-platform, which has no equivalent translation for many foreign languages, but it means that Node.js works on different operating systems like Windows, MacOS, Linux, and others.

It is an open-source platform, of course, free under the MIT license. It is a platform that is not a framework; frameworks are just a part of this platform, like Express.js. With Node.js, you create highly scalable and highly performant web applications. It is a wrapper around the Chrome V8 browser engine. With Node.js, you can easily create desktop GUI applications in JavaScript. Visual Studio Code, Atom, Postman, etc., are based on Node.js. It is also very popular for developing micro servers and in the world of IoT - Internet of Things. It is simply incredible how powerful this platform is, how it simplifies complexity, and what you can do with it; we simply don’t know how to explain all this in brief to a programming beginner.

Node.js is otherwise intended for experienced programmers who are proficient in coding applications, developing web applications, and knowing the JavaScript programming language. But there is no need for this to discourage you; you will just have to roll up your sleeves much more than when you are learning the JavaScript programming language. Even if you know JavaScript, it doesn’t mean you can fully use all JavaScript commands in Node.js. For example, this simply won't work in Node.js:

document.getElementById('');

Simply put, HTML DOM is not built into Node.js. You cannot use the document or window objects. Instead of this line of code, you would use Puppeteer, a Node.js library that provides a high-level API. But, not to complicate things now, Node.js is also not a new programming language; it uses the JavaScript programming language but does some things differently.

Node.js Application

 Node.js Application

If we go back in time, to 1995, a new programming language called LiveScript appeared under the code name Mocha. But due to the popularity of the Java programming language, it was renamed JavaScript. On May 27, 2009, Node.js was released. The Java programming language has the motto "Write once, run anywhere!" And now, Node.js has the motto "JavaScript for everything!" It's clear that both programming languages tend to be used everywhere. Node.js made it possible for JavaScript to overcome some limitations of the Java programming language in such a way that you can use the Java programming language within Node.js.

Do you now understand the capabilities of Node.js we are talking about here? As early as 2009, Node.js literally gave wings to the JavaScript programming language, allowing JavaScript to be executed on the server side and outside the scope of any browser, which is not the case with the JavaScript programming language itself. Node.js is an extremely popular choice for creating and developing command-line tools used in software development. Babel is often used to transpire modern ES-2016 code to run old code for viewing on older browsers. Node.js allows you to easily test web user interfaces.

The Puppeteer library provides control over a headless instance of the Chrome web browser. Electron and NW.js are frameworks for developing desktop applications on Windows, MacOS, and Linux operating systems. Applications use HTML5, CSS3, JavaScript, and frameworks like Bootstrap, React, Vue.js, or AngularJS. With Node.js, you can also create mobile applications. But note that Apple's App Store rules do not allow JIT capabilities. Regarding IoT - Internet of Things; Node.js runs on most computers that support ARM.

What Makes Node.js So Special: Benefits That Can Change Your Approach to Programming

Saturday, May 04, 2024

Discover the Potential of Operators in the JavaScript Programming Language

Before you move on to learning operators in the JavaScript programming language, it is assumed that you are already familiar with variables in JavaScript, see here; and that you have already started a JavaScript project js_tutorial. Operators in the JavaScript programming language, as in other programming languages, are symbols used to perform various operations on values, variables, and expressions. They play a key role in calculating and manipulating data in the JavaScript programming language because they allow programmers to calculate values, control the flow of the program, and create complex logical expressions.

Understanding how operators work and how they are used is essential for developing JavaScript applications. Operators in JavaScript are not significantly different from operators in other programming languages. Most programming languages have similar basic operators, but there are some differences in behavior and syntax. As far as basic operators are concerned, the JavaScript programming language does not lag behind much more developed programming languages at all.

Students learn operators in the JavaScript programming language

Students learn Operators in the JavaScript programming language

JavaScript supports various types of operators, including the following:

  • Arithmetic operators
  • Assignment operators
  • Unary (Increment and Decrement) operators
  • Comparison operators
  • Logical operators
  • Comma operator
  • Ternary (Conditional) operator
  • Nullish Coalescing operator
  • Optional Chaining operator
  • Bitwise shift operators
  • Etc.

When it comes to ternary, nullish coalescing, optional chaining, bitwise shift operators, and so on; we will cover them in other future posts of this tutorial as they come up in practical examples. For now, it would be great to learn and familiarize yourself with the most basic operators that you will frequently use in your projects. First, let’s start with arithmetic operators and introduce other fundamental operators in the JavaScript programming language on a single web page. Meanwhile, we’ll create another web page to showcase a simple calculator. So, your project will have two new lessons. Our calculator creation will definitely demonstrate true mastery in CSS styling, which is so straightforward that we won’t use Bootstrap at all in the fourth lesson.

Arithmetic Operators: Basic Mathematical Operators on Numbers

Thursday, May 02, 2024

Learn JavaScript Like an Expert, How to Use Variables, Data Types and Constants Effectively?

Variables are fundamental elements in every programming language that allow storage and manipulation of data. They represent memory locations used to store various types of information, including numbers, text, logical values, objects, and more. In JavaScript, variables enable programmers to store data in computer memory and manipulate it based on program requirements. For example, variables are used in programs to:

  • Store user data
  • Perform mathematical operations
  • Manage user interface elements

When learning any programming language, understanding the importance of variables is crucial. Imagine variables as memory boxes. Each box can hold different types of data, and you cannot put letters into a box meant for numbers. In JavaScript, the type of memory box, variable; you use depends on the value assigned to it. Here’s an example:

let myVariable = 10;

In this case, the variable myVariable is assigned the value 10, and the JavaScript interpreter treats it as a number. Note that variable names can be any combination of letters, numbers, and underscores. It’s a good practice to start variable names with a lowercase letter, CamelCase notation and avoid using special symbols or keywords. Descriptive variable names help make your code more readable and maintainable. Remember not to name variables with single letters like a, b, or c. Instead, develop a habit of choosing meaningful names that convey the purpose of the variable. This practice benefits both you and anyone who reviews your code.

A programmer learns and codes in the JavaScript programming language

A programmer learns and codes in the JavaScript programming language

The JavaScript programming language is case-sensitive, which means it distinguishes between uppercase and lowercase letters. This means that myVariable and myvariable are two different variables. Data types in JavaScript are not strictly typed like, for example, in the C# programming language. JavaScript uses dynamic typing, which means you do not declare a variable as you would in C#, and the data type is determined during program execution, not at the declaration of the variable. Dynamic typing allows for flexibility and faster development but can lead to errors if the programmer is not careful with the variable types in their code.

Precisely because JavaScript is not a strictly typed language, it is not the best choice for most financial and other calculations. That’s why TypeScript was created, which uses static typing. However, this does not mean you should immediately switch to TypeScript. JavaScript has a lot to teach and offer you. Unlike other programming languages, JavaScript has far fewer variable types. And unlike, for example, the PHP programming language, which has different data types like undefined and symbol, JavaScript uses the number type for all kinds of numbers, including hexadecimal ones.

Data Types in the JavaScript Programming Language

Wednesday, May 01, 2024

From Beginner to Pro, First Steps to Professional JavaScript Coding

Before you even think about learning the JavaScript programming language, it is essential that you are familiar with HTML5 and CSS3, or at least read and study the posts on this blog related to the mentioned topic; see here or check in the navigation toolbar Content. JavaScript is the most popular programming language that turns web pages into client-side web applications. It is usually at the top of all the top lists of programming languages due to its ease of learning and use, and I would add that JavaScript developers are exceptionally well-paid compared to other programmers. The first thing you need to know about the JavaScript programming language is that it has nothing to do with the Java programming language and its syntax is based on C syntax.

It is interpreted, which means it is not compiled like the C# programming language. It supports variables for storing information, operators for performing operations and comparisons, functions that can be called multiple times, conditional expressions, programming loops, and the ability to create objects with properties, methods, and events. We say that JavaScript is an event-driven execution model. Otherwise, JavaScript is used in combination with DOM – Document Object Model and BOM – Browser Object Model to make the web page look dynamic.

The girl codes in JavaScript, the most popular programming language

The girl codes in JavaScript, the most popular programming language

There are colleagues who do not take this programming language seriously because it is often learned as part of another programming language, for example, it is assumed that a C# programmer knows the JavaScript programming language, as well as the jQuery library and AJAX. But also, in foreign companies, there are positions where programmers deal exclusively with the JavaScript programming language professionally, without knowing other programming languages. In any case, our advice to you is to take the JavaScript programming language seriously and to master it well because it is extremely present in almost every internet project and in the job market. It will also make your websites much better.

But for now, let’s go back a bit to see how JavaScript was created. First, a programmer named Brendan Eich from Netscape developed LiveScript in 1995. Then, with the appearance of Microsoft Internet Explorer version 3.0 in 1996, support was included in this browser for Jscript, which was the basis of JavaScript. Although Jscript was similar to JavaScript, their application was totally different. Just a year later, ECMA-European Computer Manufacturers Association built the first language specification ECMAScript, better known as ECMA-262 or what we call JavaScript today, which then became the standard primarily for Microsoft browsers, and then others.

But the problem arose because each browser applied this standard in its own way, making it incompatible. There are many newer editions of ECMA-262, but still, as a programmer, you must take into account the differences between ECMA-262 and other JavaScript implementations. Of course, this should not scare you or compromise your JavaScript code, but it is necessary to test it on browsers from different manufacturers. Today, the JavaScript standard is closely linked to the DOM – Document Object Model standard regulated by the W3C – World Wide Web Consortium, and with their participation, life has been made easier for developers.

The benefits of JavaScript: How this language is changing the web

Thursday, May 25, 2023

Naučite kako započeti sa TypeScript-om, iskoristite potencijal JavaScript-a uz nadogradnju

Ako pitate nekog od mnogobrojnih programera šta je to TypeScript, definitivno ćete dobiti mnogo konfuznih odgovora. Ako posetite zvaničnu prezentaciju TypeScript-a, pogledajte ovde; možete pročitati da je TypeScript programski jezik sa snažnim tipiziranjem koji se nadograđuje na JavaScript  programski jezik, pružajući vam bolje alate za rad u bilo kojoj razmeni. Znači TypeScript jeste programski jezik, koji za razliku od JavaScript-a koristi statički tipizirane promenjive ali je takođe i alat koji kompajlira i nadograđuje JavaScript sa mnogim stvarima koje JavaScript-u nedostaju. Možete li bar pokušati zamisliti kako to izgleda u praksi? Za početak, interesantno. Definitivno, nije nešto što ste do sada radili. Postoji jedna šala, kad vas neko pita koji programski jezik da uči; onda mu kažete  TypeScript jer je sve ostalo zastarelo. Činjenica je da TypeScript postoji još od 2012 godine, ali tek zadnjih godina je stekao sve veću popularnost. Da, iza njega stoji Microsoft korporacija; što programerima daje neku sigurnost, još bolja stvar je što je TypeScript besplatan programski jezik otvorenog kôda. Ako tu dodate jedno čuveno ime danskog softver inženjera Anders Hejlsberg-a, arhitektu C# programskog jezika, koji je takođe imao svoj ogroman doprinos kao tvorac Turbo Pascal-a. Onda za TypeScript možete biti sigurni da je to nešto genijalno i ozbiljna stvar koju jednostavno morate znati. Ali prvo da pogledamo šta je to sa JavaScript-om što je nateralo pametne ljude da stvore  TypeScript. Poznata je ogromna moć i sveprisutnost JavaScript programskog jezika na Internetu; ali sve više i na drugim uređajima; upravo zbog svoje jednostavnosti i što je zaista lak za učenje. Međutim, izazovi su nastali kad radite na velikim i složenim projektima.


( TypeScript nije samo programski jezik, već i alat i nadogradnja JavaScript-a )

Kad spojite interpreter i greške u sintaksi, pa čak i sa PHP programskim jezikom koji radi na strani servera, dobijete noćnu moru. Morate pokrenuti celu aplikaciju da bi ste otkrili grešku u sintaksi.  JavaScript koristi objekte i prati principe OOP - objektnog orjentisanog programiranja, ali to postiže korišćenjem čistih funkcija, što je svojstvo PF - paradigme funkcionalnog programiranja. On jednostavno prati i OOP i FP principe, ali zapravo je proceduralni jezik. TypeScript jednostavno generiše JavaScript. On jednostavno kompajlira TypeScript programski jezik u čisti JavaScript. Da, može zvučati kome treba taj dodatni posao, ali sa time se dobijaju neverovatne stvari. TypeScript na ovaj način ne treba novo radno okruženje već radi na svakom JavaScript okruženju. Ovo otvara mogućnost da se postojeći JavaScript projekti migriraju postepeno na TypeScript bez potrebe za pisanjem novog kôda. Dok JavaScript koristi određen ECMAScript standard, TypeScript kompajler ima parametar koji omogućava da prebacujete kôd između različitih ECMAScript standarda. Ipak, glavna karakteristika TypeScript-a je statičko tipiziranje, što znači da programerima omogućava da deklarišu vrste podataka. To pomaže otkrivanju grešaka i pruža bolju podršku za refaktorisanje kôda, automatsko završavanje kôda; kao i pravljenje poboljšane dokumentacije. TypeScript podržava napredne koncepte programiranja poput interfejsa, klasa, modula i generika. Jednostavno, TypeScript pomaže  programerima da pišu čistiji, pouzdaniji i lakše održavaju velike JavaScript projekte bez pisanja novog JavaScript kôda zahvaljujući naprednim programsko jezičkim konstrukcijama i funkcionalnosti koje nemate u JavaScript programskom jeziku. Nadam se da vam je sada jasnije zašto treba da učite i koristite TypeScript. Imajte samo na umu, sve ovo što ste pročitali u  praksi je mnogo jednostavnije.

Šta mi treba da počnem sa TypeScript programskim jezikom?