Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.1.5. Review & Self-Study #77

Open
dev-experience opened this issue Jan 3, 2021 · 4 comments
Open

1.1.5. Review & Self-Study #77

dev-experience opened this issue Jan 3, 2021 · 4 comments

Comments

@dev-experience
Copy link
Collaborator

Review & Self-Study

Study a bit on the different languages available to the programmer. Try to write a line in one language, and then redo it in two others. What do you learn?

@raybags-dev
Copy link

raybags-dev commented Jan 3, 2021

**Features of JavaScript

It's a cross-platform language
It's widely used for client-side and server-side
Strong Testing Workflow
It's easy to learn and to start coding with
Offers added dependencies
Features of Python
Here, are important features of Python

Features of Python

Easy to learn, read, and maintain
It can run on various hardware platforms & using the same interface.
You can include low-level modules to the Python interpreter.
Python offers an ideal structure and support for large programs.
Python offers support for automatic garbage collection.
It supports an interactive mode of testing and debugging.
It offers high-level dynamic data types and also supports dynamic type checking.
Python language can be integrated with Java, C, and C++ programming code
Easy concurrency support via goroutines
Fast compilation times
Statically linked binaries which are simple to deploy

Key differences

Python:

has to be installed 
runs in a development environment [IDE] only 
Python has mutable and immutable data types. 
source code is ASCII
different types of numeric types like int, float, fixed-point decimal and so on....
Has built-in has tables called dictionaries, sets used in hashing with keys and values. 
Uses class based inheritance 
Use indentation 
Will throw if function is called without an incorrect parameter and accepts some additional parameters passing syntax

Javascript:

No installation required
Runs both in IDE and browser. 
Js does not have the concept of mutable and immutable. 
Source code should be encoded as UTF-16 and no built-in support for manipulating raw bytes
Has only  floating point numbers 
Has no built-in has table support
Uses prototype based inheritance. Classes are just syntactical sugar. 
Uses curly brackets
JS doesn't care 

Some code example

  • iterating over a given with python:
_element  = np.arange(15)
for int in element  :
    print(int , end = ' ')_
  • iterating over a given with javascript:
_const print_numbers = () => {
    let element   = 15;
    for(let int = 0; int < element; int++){ console.log( int )}_
}

@dev-experience
Copy link
Collaborator Author

@raybags-web-dev please reformat the code snippets with proper Markdown.

Looks like you created the 1.1.5 task and I created the same task for you at the same time. So, thanks for looking into both of them 👍

@dev-experience
Copy link
Collaborator Author

@raybags-web-dev

I would like to disagree with the following points:

Python

  • runs in a development environment [IDE] only
    You can run it in the command line: python my-script.py or in interactive mode (like browser console)

JavaScript

  • no installation required
    "True" for the browser JavaScript but "false" for server-side or JavaScript running in IDE
  • Js does not have the concept of mutable and immutable.
    There is the Object.freeze() method that can make your object immutable (MDN: Object.freeze())
  • Has only floating-point numbers
    Was "true" before BigInt was introduced (MDN: BigInt)

JS doesn't care

😂

You can master it.


You should keep in mind that there are two different JavaScripts: browser-based JavaScript and server-based JavaScript.

Languages are quite similar but server-side JavaScript has more features and runtimes are different. Server-side JavaScript runs on Node.js.


You have a typo in both mentions of a "hash table".

BTW, please check out what a hash table is. It's quite important data structure. But don't dig very deep into this topic, you can always revisit it later.

https://en.wikipedia.org/wiki/Hash_table

@dev-experience dev-experience removed their assignment Jan 4, 2021
@raybags-dev
Copy link

Definitely. I'll check it out. If I wasn't so deep and invested in JS, I think python is a pretty interesting language as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants