Skip to content

Instantly share code, notes, and snippets.

@anhtranbk
Last active January 12, 2020 03:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anhtranbk/2e61a1784cb47aee3eaedd158ec4a4f5 to your computer and use it in GitHub Desktop.
Save anhtranbk/2e61a1784cb47aee3eaedd158ec4a4f5 to your computer and use it in GitHub Desktop.
Features Java Scala Python Golang C++
Type Inference No Yes Yes Yes No
Function Must be in class Must be in class or object. Function is first-class object Can be at anywhere. Function is object Always outside struct. Function is object Can be at any where
Optional parameters No Yes Yes No No
Tuple No Full-features include unpack Full-features include unpack No No
Multiple return values No Support via tuple, must pack/unpack manually Support auto pack/unpack via tuple Support but return value is not first-class object like tuple in Scala/Python No
Class Support Support Missing scope-limit feature (private/protected), final method Do not have class, only have term struct, support ony some basic features when extends struct (updating...) Support
Class constructor Standard OOP Constructor is in the class signature, contructor overload via optional parameters Contructor is init(self) method, support overload via optional parameters No, use function return reference to a struct Standard OOP
Interface Interface support default methods Trait supprt default methods and default fields Support via multiple interitance but isn't necessary because Python is dynamic language Support OOP standard, can be used to define anonymous struct Support via multiple interitance classes
Method/function overloading Yes Yes Yes, via optional parameters No Yes
Operator overloading No Support Support No Support
Generic Yes Yes Not necessary No Yes
Exception Try/catch/finally Try/catch/finally Try/except/finally No, return error instead Try/catch
Concurrency Support native-thread Support Java-thread but recommend use Actor model and functional programing style Support native thread, support async-await model Support via goroutine Support native thread
Advanced features Case-class, Pattern matching, Actor-based model Dynamic-langue Goroutine Memory management by hand
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment