Hello World

Hello World

Hello World

It all starts with a Hello World, every developer has ever written a hello world or come across code like that. In programming and in the world of computing, everything must start with a base case to evolve. The term Hello World appeared in 1972 in “The C Programming Language” written by Brian Kernighan in the first chapter and the code contained was:

int main() { printf("Hello World!\n"); return 0; }

“This was the easiest and fastest way to show an example in C language with printf”

Since then, the term has become very common, normally used to teach how to display messages on the screen in a certain language. You will find an example in practically every programming language in the Hacktoberfest-2018/Hello-world] repository.

In this publication I intend to archive my studies about the differences, advantages and disadvantages between programming languages. For illustrative purposes, I will display the Hello World of the language and below the comparisons with its sources. Let's go:

Frontend

##React app.tsx

import * as ReactDOM from "react-dom"; import * as React from "react"; import HelloWorld from "./components/helloWorld";

const rootElement: HTMLElement = document.getElementById("rootElement"); if (rootElement) { ReactDOM.render( , rootElement, ); }

components/helloWorld.tsx

import * as React from "react";

interface IProps { greeting: string; }

export default class HelloWorld extends React.Component<any, any> { public render(): JSX.Element { return ( {this.props.greeting} ); } }

"React (sometimes called React.js or ReactJS) is an open-source JavaScript library for creating user interfaces. It is maintained by Facebook, Instagram, and a community of individual developers and other companies. According to JavaScript analytics service Libscore, React is being used on the websites of Netflix, Imgur, Feedly, Airbnb, SeatGeek, HelloSign, Walmart, and others.[1]." Wikipedia

Advantages

  • Unidirectional data flow
  • Good debugging tools
  • Easy to reuse components
  • Server-side rendering
  • Easy to test and easy to write tests
  • Support for virtual DOM
  • Fast mobile development with React Native
  • Greater freedom to make the right decisions and puts more control in your hands. Unopinionated
  • Independent of the template engine (Template engine)

Disadvantages

  • Verbose
  • Heavy on memory
  • No support for legacy browsers
  • Not a complete solution
  • You have to learn a new syntax

Final Opinion

Additional Information

Size: from 145KB when minified

##VueJS app.vue

components/helloWorld.vue

"Vue.js (commonly referred to as Vue; pronounced /vjuː/, like view) is an open-source JavaScript framework for building user interfaces and single-page applications.[4]" Wikipedia

Advantages

  • Low Learning Curve
  • Easy to Implement in the Project

Disadvantages

  • Big competitors like React (from Facebook) and Angular (from Google)
  • Lots of material in Asian languages

Final Opinion

Additional Information

Size: from 21KB when minified

Angular

app.js

var app = angular.module("app", []); app.controller("HelloController", function($scope) { $scope.helloworld = "Hello World!"; } );

index.html

"Angular (commonly referred to as "Angular 2+" or "Angular 2") is an open-source, front-end web application platform based on TypeScript led by the Angular Team at Google and a community of individuals and corporations. Angular is a complete rewrite of AngularJS, made by the same team that built it." Wikipedia

Advantages

  • Huge ecosystem of third-party components
  • Easy and direct data connection
  • Support for a component-oriented architecture composable with directives
  • Huge community
  • Provides dependency injector

Disadvantages

  • Steep learning curve
  • It is almost mandatory to use Typescript
  • Difficulty using server-side rendering
  • Explicit configuration
  • HTML template does not conform to standards

Final Opinion

Additional Information

Size:

##Backend

C-Lang

int main() { printf("Hello World!\n"); return 0; }

"C[2] is a general purpose, structured, imperative, procedural, compiled programming language standardized by the International Organization for Standardization (ISO), created in 1972 by Dennis Ritchie at AT&T Bell Labs for the development of the Unix operating system (originally written in Assembly).[3]" Wikipedia

Python

print('Hello World!')

"Python is a high-level, [4] interpreted, scripting, imperative, object-oriented, functional, dynamically typed, and strong programming language. It was launched by Guido van Rossum in 1991. [1] It currently has an open, community development model managed by the non-profit Python Software Foundation. Although various parts of the language have formal standards and specifications, the language as a whole is not formally specified." Wikipedia

Node (JavaScript)

window.onload = () => { document.write('Hello World!'); }

"JavaScript is an interpreted programming language.[2] It was originally implemented as part of web browsers so that scripts could be executed on the client side and interact with the user without the need for this script to pass through the server, controlling the browser, performing asynchronous communication and changing the content of the displayed document." Wikipedia

"Node.js is an open source JavaScript code interpreter, focused on migrating client-side Javascript to servers. Its objective is to help programmers create highly scalable applications (such as a web server[1]), with code capable of handling tens of thousands of simultaneous connections, on a single physical machine.[2] " Wikipedia

##Java

public class Main { public static void main(String[] args) { System.out.println("Hello World!"); } }

"Java is an object-oriented programming language developed in the 90s by a team of programmers led by James Gosling, at the company Sun Microsystems. Unlike conventional programming languages, which are compiled to native code, the Java language is compiled to a bytecode that is interpreted by a virtual machine (Java Virtual Machine, better known by its abbreviation JVM). The Java programming language is the conventional language of the Java Platform, but it is not its only language." Wikipedia

Ruby

puts "Hello World!"

"Ruby is a multi-paradigm interpreted programming language that was originally developed in 1995 by Yukihiro "Matz" Matsumoto for use as a scripting language. Matz wanted a scripting language that was more powerful than Perl, and more object-oriented than Python. Perl, Smalltalk, Eiffel, Ada and Lisp, being very similar in many aspects to Python. [5] Ruby is among the 69 oldest languages, according to a survey conducted by RedMonca.

##GoLang

package main

import "fmt"

func main() { fmt.Println("Hello World!") }

"Go is a programming language created by Google and released as open source in November 2009. It is a compiled language focused on productivity and concurrent programming,[4] based on work done on the operating system called Inferno.[5] The initial design of the language was done in September 2007 by Robert Griesemer, Rob Pike and Ken Thompson.[4] Currently, there are implementations for Windows, Linux, Mac OS

##PHP

"PHP (a recursive acronym for "PHP: Hypertext Preprocessor", originally Personal Home Page) is a free interpreted language, originally used only for the development of applications present and active on the server side, capable of generating dynamic content on the World Wide Web. which also generates the web page to be viewed on the client side. The language has evolved, now offering command-line functionality, and in addition, it has gained additional features, which have enabled additional uses of PHP, not related to web sites. It is possible to install PHP on most operating systems, free of charge. Wikipedia

Here is the expanded list of languages, maintaining the same layout and organization as the original file. I added new languages with examples, advantages, disadvantages and additional information to maintain consistency:


Knowing More Languages

In addition to the languages already presented, there are others that also deserve to be highlighted in modern development. Below, we explore some of them in detail.

Rust

Rust is a modern programming language focused on security, especially critical systems. It offers precise control over system resources without sacrificing performance.

Example of Hello World

fn main() { println!("Hello World!"); }

Context and Applications:
Created in 2010 by Graydon Hoare, Rust was designed to be a safe alternative to C and C++, with an emphasis on preventing common bugs like memory leaks and unsafe concurrency.

Advantages of Rust

  • Memory Security: Eliminates problems such as null pointers or invalid accesses.
  • High Performance: Combines low-level efficiency with modern abstractions.
  • Resource Management: Does not require a garbage collector, reducing overheads.
  • Active Community: Great support from the open source community.

Disadvantages of Rust

  • High Learning Curve: Its initial complexity can be challenging for beginners.
  • Minor Ecosystem: Although growing, it still has fewer libraries compared to older languages.

Additional Information

  • Size: Generated binaries are generally optimized and compact.

Kotlin

Kotlin is a modern language developed by JetBrains, designed to be interoperable with Java. It is widely used in Android development due to its simplicity and robustness.

Example of Hello World

fun main() { println("Hello World!") }

Context and Applications:
Officially launched in 2016, Kotlin was quickly adopted by the Android ecosystem, becoming the official mobile development language for this platform.

Advantages of Kotlin

  • Interoperability with Java: Facilitates the migration of legacy projects.
  • Clean Syntax: Reduces verbosity and increases readability.
  • Type Safety: Prevents many types of errors during compilation.
  • Official Support: Endorsed by Google for Android development.

Disadvantages of Kotlin

  • Learning Curve: For experienced Java developers, there may be an adaptation period.
  • Initial Performance: In some cases, startup time may be longer.

Additional Information

  • Size: Small overhead compared to Java, but with better long-term performance.

##Swift

Swift is a programming language created by Apple, mainly aimed at developing iOS, macOS, watchOS and tvOS applications.

Example of Hello World

print("Hello World!")

Context and Applications:
Launched in 2014, Swift was designed to gradually replace Objective-C as the main development language for Apple devices.

Advantages of Swift

  • Easy to Learn: Its simple syntax attracts beginner developers.
  • Superior Performance: Better performance compared to Objective-C.
  • Security: Significantly reduces common programming errors.
  • Interactive Playgrounds: Ideal tool for learning and rapid prototyping.

Disadvantages of Swift

  • Apple exclusivity: Limited to Apple platforms, restricting its use in other environments.
  • Rapid Evolutions: Frequent changes may require constant code updates.

Additional Information

  • Size: Generated binaries are highly optimized for mobile devices.

TypeScript

TypeScript is a JavaScript extension that adds static typing and advanced features, making it easier to develop large, complex applications.

Example of Hello World

function greet(name: string): string { return `Hello, ${name}!`; } console.log(greet("World"));

Context and Applications:
Developed by Microsoft, TypeScript is widely used in frontend and backend projects, especially in frameworks like Angular.

Advantages of TypeScript

  • Static Typing: Helps identify errors before execution.
  • JavaScript integration: Fully compatible with existing JavaScript code.
  • Advanced Tools: Robust support for IDEs and development tools.
  • Rich Ecosystem: Wide variety of compatible libraries and frameworks.

Disadvantages of TypeScript

  • Initial Complexity: It can be confusing for those used to pure JavaScript.
  • Extra Compilation: Requires an additional step to transpile to JavaScript.

Additional Information

  • Size: Variable depending on the dependencies used.

Scala

Scala is a hybrid language that combines object orientation and functional programming, running on the JVM.

Example of Hello World

object Main extends App { println("Hello World!") }

Context and Applications:
Designed to be an elegant alternative to Java, Scala is widely used in big data and distributed systems.

Advantages of Scala

  • Functional Programming: Allows you to write more concise and modular code.
  • Java Compatibility: Easily integrates with Java libraries.
  • Simple Competition: Models like Akka make it easy to create concurrent systems.
  • High Performance: Executed on the JVM, it guarantees high performance.

Disadvantages of Scala

  • Steep Learning Curve: Its complexity can be challenging for beginners.
  • Limited Documentation: Fewer features available compared to Java.

Additional Information

  • Size: Depending on the project, it may vary significantly.

Elixir

Elixir is a functional language built on the Erlang virtual machine (BEAM), ideal for distributed and highly scalable systems.

Example of Hello World

IO.puts "Hello World!"

Context and Applications:
Created in 2011 by José Valim, Elixir is known for its ability to handle millions of simultaneous connections, being widely used on web servers.

Advantages of Elixir

  • Native Competition: Actor model allows you to create resilient systems.
  • Robustness: Inherits the stability of the Erlang virtual machine.
  • Modern Syntax: More readable and productive than Erlang.
  • Rich Ecosystem: Frameworks like Phoenix facilitate web development.

Disadvantages of Elixir

  • Limited Adoption: Less popular than other languages, resulting in less support.
  • Learning Curve: Functional programming may be new to many developers.

Additional Information

  • Size: Efficient in terms of memory and CPU.

##R

R is a programming language focused on statistics and data analysis. It is widely used in data science, academic research, and machine learning.

Example of Hello World

cat("Hello World!\n")

Context and Applications:
Developed in the 1990s by Ross Ihaka and Robert Gentleman, R has become indispensable for data scientists and analysts, offering powerful tools for manipulating and visualizing data.

Advantages of R

  • Robust Libraries: Packages like ggplot2, dplyr and tidyverse facilitate data analysis and visualization.
  • Academic Community: Great support in areas of research and statistics.
  • Advanced Charts: Ability to create complex visualizations with ease.
  • Integration with Other Languages: Can be combined with Python, SQL and other technologies.

Disadvantages of R

  • Limited Performance: Compared to languages like Python or C++, it can be slower on large volumes of data.
  • Learning Curve: Its specific syntax can be challenging for beginners.

Additional Information

  • Size: Depending on the installation, it varies depending on the packages used.

Julia

Julia is a high-performance language designed for scientific computing and data analysis. It combines the simplicity of Python with the speed of C.

Example of Hello World

println("Hello World!")

Context and Applications:
Launched in 2012, Julia was created to solve high-performance problems in mathematics, physics and engineering, being ideal for intensive numerical calculations.

Advantages of Julia

  • Speed: Code compiled in real time with performance similar to C.
  • Simple Syntax: Easy to learn for those familiar with Python or MATLAB.
  • Native Parallelism: Built-in support for parallel and distributed computing.
  • Integration with Other Languages: Can call C, Python, Fortran code and more without significant overhead.

Disadvantages of Julia

  • Smaller Ecosystem: Although growing, it still has fewer libraries than Python or R.
  • Limited Adoption: Less popular in certain industrial sectors.

Additional Information

  • Size: Generated binaries are optimized for efficiency.

Dart

Dart is a language developed by Google designed to create web, mobile and desktop applications in an efficient and modular way.

Example of Hello World

void main() { print('Hello World!'); }

Context and Applications:
Created in 2011, Dart gained prominence with the emergence of the Flutter framework, allowing high-quality cross-platform development.

Advantages of Dart

  • Flutter Integration: Ideal for creating native mobile applications.
  • Static Typing: Helps identify errors before execution.
  • Multiplatform Compilation: Generates native code for Android, iOS, web and desktop.
  • Modern Tools: Built-in IDEs and debuggers make development easier.

Disadvantages of Dart

  • Limited Adoption: Less popular outside the Flutter ecosystem.
  • Specific Documentation: Many features are documented only in the context of Flutter.

Additional Information

  • Size: Flutter framework may be large, but the final code is highly optimized.

Haskell

Haskell is a pure functional language known for its elegance and mathematical rigor. It is often used in education and research.

Example of Hello World

main = putStrLn "Hello World!"

Context and Applications:
Created in 1990, Haskell is mainly adopted in universities and companies that value code robustness and correctness.

Advantages of Haskell

  • Pure Functional Programming: Promotes a clean and mathematically accurate coding style.
  • Lazy Evaluation: Lazy evaluation allows you to work with infinite data structures.
  • Type Safety: Significantly reduces type errors during compilation.
  • Academic Community: Great support in advanced research areas.

Disadvantages of Haskell

  • High Learning Curve: Functional concepts can be difficult for beginners.
  • Smaller Ecosystem: Fewer libraries available compared to imperative languages.

Additional Information

  • Size: Efficient in terms of memory and processing.

Moon

Lua is a lightweight and flexible language, widely used in games and embedded applications.

Example of Hello World

print("Hello World!")

Context and Applications:
Developed in 1993 by PUC-Rio, Lua is known for its simplicity and easy integration with other languages.

Advantages of Lua

  • Lightness: Small footprint, ideal for systems with limited resources.
  • Easy Integration: Easy to incorporate into applications written in C or C++.
  • Simple Syntax: Easy to learn and use, even for beginners.
  • Popularity in Games: Widely used in engines such as Unity and Unreal Engine.

Disadvantages of Lua

  • Limited Performance: In some cases, it may not be as fast as compiled languages.
  • Smaller Ecosystem: Fewer libraries available compared to more popular languages.

Additional Information

  • Size: Generated binaries are compact and efficient.

Erlang

Erlang is a functional language designed for distributed and concurrent systems and is widely used in telecommunications.

Example of Hello World

-module(hello). -export([start/0]). start() -> io:fwrite("Hello World!~n").

Context and Applications:
Created in 1986 by Ericsson, Erlang is known for its ability to handle millions of simultaneous connections.

Advantages of Erlang

  • Native Competition: Actor models allow you to create resilient systems.
  • Robustness: Project focused on high availability and failure recovery.
  • Horizontal Scalability: Ideal for distributed systems.
  • Active Community: Great support in the areas of telecommunications and servers.

Disadvantages of Erlang

  • Learning Curve: Functional programming may be new to many developers.
  • Limited Adoption: Less popular outside the telecommunications sector.

Additional Information

  • Size: Efficient in terms of memory and CPU.

Conclusion

The languages mentioned here reflect the diversity and specific needs of the modern programming world. Each brings its own unique features, allowing developers to choose the best tool for each use case.

Whether you're a beginner or a seasoned professional, experimenting with different languages ​​broadens your repertoire and improves your ability to solve problems efficiently and creatively.

Also read