What programming languages do you need for Magento 2?

Before starting learning Magento 2, you must be familiar with some of the programming technologies listed below :

  1. PHP (Hypertext Preprocessor)
  2. HTML (Hypertext Markup Language)
  3. CSS (Cascading Style Sheets)
  4. JS (Javascript)
  5. XML (Extensible Markup Language)

PHP

PHP is a recursive acronym for a “PHP: Hypertext Preprocessor” and is an open-source server-side scripting language widely used in full-stack web development since 1995. 

PHP is also one of the easiest programming languages to learn and has a fast learning curve compared to other languages. PHP has some advantages that have made it so popular, and it's been the go-to language for web servers for a long time now. Here are some of PHP's merits:

  • PHP is an object-oriented programming language; thus, it means that the language uses classes and objects to define the structure of data.
  • PHP has a very supportive online vast community. Also, the official documentation provides guides on how to use the features, and you can quickly get your problem fixed while stuck.
  • PHP is regularly updated to keep abreast with the latest technology trends and updated with the latest security patches to avoid bugs.
  • By default, It is integrated with several popular databases by default, including MySQL, PostgreSQL, Oracle, Sybase, Informix, and Microsoft SQL Server.

Below are some of the references to learn PHP.

  1. PHP Official Site
  2. Wiki Page
  3. Max Pronko PHP Tutorials
  4. W3Schools

HTML

The acronym for HTML is Hypertext Markup Language and is the most widely used language on the web to develop web pages. 

Earlier, HTML was designed as a language for semantically describing scientific documents, but it’s adapted to describe several other types of documents and even applications.

Prerequisites to learn HTML - 

  • It would be best to have a basic understanding of text editors, e.g. Notepad, Notepad++, Sublime or VsCode.
  • Knowledge about HTML tags and different images formats.

You can refer to the below links for more information - 

  1. HTML Official Site
  2. Wiki Page
  3. W3Schools

CSS

CSS stands for Cascading Style Sheets and it is used to design web pages so that it looks more user friendly across all devices with multiple browsers support. CSS  is a standard developed for determining the appearance of text and other elements on a web page.

CSS is the language that will make this information beautiful. It is used to shape the elements of HTML by stylization, formatting, determining the style of a text, a page with a particular background colour or a block wrapped around a border and present it as a new shape in a different browser on different devices.

Some advantages of the CSS are - 

  • Page loads faster by using styles elements instead of HTML tags.
  • Multiple Device Compatibility
  • Global Web Standards

You can refer to the below links for more information - 

  1. CSS Official Site
  2. Wiki Page
  3. W3Schools
  4. CSS Tricks

Javascript

Javascript is commonly abbreviated as JS, and it’s the most used programming language used to implement complex things on web pages. For example, it displays dynamic content or creates animations on the site while rendering web pages in the browser.

Javascript is comparatively more difficult to learn than HTML and CSS as it has more difficult syntax than HTML & CSS. Also, it is the first scripting language to fully conform to ECMAScript, the Web’s only standard javascript.

Some advantages of the javascript are : 

  • Javascript is an interpreted language which means it requires no compilation, so no compiler to run.
  • It is also a platform-independent language and doesn’t require any particular to run, and it can run on any javascript enabled browser.
  • Javascript reduces the server load as it will load on the client-side only.
  • It is also regularly updated to support newer technologies with updated security patches by ECMA.
  • Javascript language has a very vast developer community with rich knowledge worldwide.

You can refer to the below links for more information - 

  1. Javascript Official Site
  2. Wiki Page
  3. W3Schools

XML

XML stands for eXtensible Markup Language, and it is a self-descriptive language. It is called extensible because it doesn’t have any fixed format like HTML. Instead, it is a meta-language that lets you create your custom markup language to make it more understanding concerning the reference.

Some of the advantages of using XML are - 

  • XML is both platform and programming language independent, which means it can be used with any platform and language.
  • It allows us to create different tags with descriptions or language as needed.
  • XML is also used to store and process documents and data online and offline.
  • It also supports Unicode, allowing almost every written human language information to be communicated.

You can refer to the below links for more information - 

  1. Javascript Official Site
  2. Wiki Page
  3. W3Schools

What sections do you need to know to work on Magento 2?

Magento 2 is a codebase that contains multiple files and directories where each directory has subdirectories listed along with multiple hierarchical directories or files. Those files can be of PHP, HTML, CSS, JAVASCRIPT, XML, PHTML. The listing of directories and their subdirectories is managed in an obvious and understandable way.

app - app directory is the important directory that contains all the custom modules and 3rd party extensions, custom themes. Within the app directory, there are three subdirectories: code, design, etc.

  • app/code - This directory is not available by default with the Magento 2 setup. This directory needs to be created when installing a custom extension or any 3rd party extensions. 
  • app/code/VendorName/ModuleName - This directory is a custom module directory with its vendor and unique module name. It contains all required directories and files for that module to work in the admin and frontend area of the Magento 2 site.
  • app/design/frontend - This subdirectory contains the frontend’s custom store theme.
  • app/design/adminhtml- This subdirectory contains the custom theme for admin.

bin - This contains the Magento file for CLI commands to run. These CLI commands work for cache flush, and module enables/disable, module install, deploys theme and all static content for the site. These are the basic and standard commands used for the site. And there are other CLI commands to perform different tasks with the Magento setup.

dev - This directory contains test scripts along with development tools.

generated - This directory stores all the Magento generated code to make sure all the methods are corrected and speed up the process in Magento.

lib- This directory includes all the libraries and non-module based Magento code. This folder contains further two subdirectories, i.e. internal and Web.

  • lib/internal - This contains several server-side libraries and font files used in Magento.
  • lib/web -This directory contains client-side libraries, jquery, modernizr, requirejs, prototype, Scriptaculous and other libraries.

phpserver - This contains the router.php file to use the built-in PHP server for Magento. And it is not recommended to work with this file because it can create big security holes in the website.

pub - This directory includes all the generated static files and media used in the Magento website. This folder should be set as the webroot on the server for Magento. This directory is a security measure in Magento to restrict the public root directory access for additional security.

setup - This directory contains the Magento 2 installation files and performance toolkit for magneto to test the performance.

var  - This directory includes all the raw cache files, logs, reports and sessions. The two essential sub-directories in var folders are -  

  • var/log- This folder stores all the logs files that are generated by Magento or any custom extension, including debug and exception logs.
  • var/cache - This folder stores all the cache generated by Magento to boost the Magento performance. By running this command - bin/magento cache: clean, you can clear the cache.

vendor - This directory contains the Magento framework core generated by the composer using the composer.json file. In addition, it includes all the packages we defined inside the composer.json file in the Magento root directory. Also, all the custom/3rd party extensions or libraries are installed here when installed by the composer.

By the way, Mage Mastery courses are designed for any level of programming languages, so start learning now!