Part 1 of a series on comparison between programming languages: C, C++, Java, Python, R, Rust, Scala & C# compiled from WIKIPEDIA
C:
- Invented in 1970s
- Used widely in operating systems and driver programming
- Imperative, procedural, compiled and structured with low level access to memory
- Cross platform capability
- Has had influence on C++, Java, C# and other languages
- Concepts: Functions, Data Structures, Input Output, Pointers, Run-Time polymorphism, Recursions, Static data types
- Limited keywords
- Directly compiles to machine instructions
- Static, automatic & dynamic memory allocation possible
- Runtime problems can happen in memory and other areas
- No support for object orientation & functional programming
C++:
- C with classes, extension of C
- Support for object oriented, generics & functional programming
- Compiled & low level memory access
- Systems programming, embedded systems, games, servers and more
- Standardized by ISO
- Inherits & builds on top of most of the syntax of C
- Static, automatic, thread & dynamic memory management
- Templates with implementation of generics concept is possible
- Operator overloading
- Compile time & runtime polymorphism possible
- Support for lambda expressions
- Enum data type
- Core & standard library with multi-threading, regular expressions, smart pointers
- STL – Standard template library
- Criticism: Overtly complex
Java:
- General purpose, high level, object oriented, write once run anywhere
- Java -> ByteCode -> JVM
- Automatic memory management & garbage collection
- Generics, Spring, Functional, JavaEE, Scala, Kotlin and many other projects have come out from Java
- Mostly used for application programming
- Used in Android and as a base for many other frameworks & programming langauges
Python:
- High level, general purpose
- Focusses on code readability & uses concepts like indentation
- Automatic memory management
- Features from structured, object oriented & functional programming
- Large ecosystem of libraries
- Used in machine learning, web development and many areas of data science
R:
- Focussed on statistics & graphics
- Interpreted, features from procedural & object oriented
- Large ecosystem of libraries / packages
- Commercial options available
RUST:
- Focussed on systems programming & being looked as a replacement for C & C++ by many
- Major focus on type safety, concurrency and memory safety
- Only valid references allowed for memory except few other scenarios
- Object lifecycle & variable scope checking at compile time itself unlike many languages that do this at runtime
- Strongly and statically typed
- Generics
- Ownership & lifetimes concept introduced over objects
- Features of functional programming
Scala:
- Functional & object oriented features
- Many functional features are implemented: No difference between statement & expressions, Lazy evaluation, Currying and Type inference
- Strong & statically typed
- Options to compile & run on JVM or as JavaScript or as native code
C#:
- Multi paradigm
- Static & strong typing
- Functional, generic, object & component oriented features
- Common Language Infrastructure standard driven which helps to get Common Intermediate Language for runtime
- Metaprogramming concept is used
- Garbage collector & detailed memory management techniques exist
References:
- https://en.wikipedia.org/wiki/Comparison_of_programming_languages
- https://en.wikipedia.org/wiki/C_(programming_language)
- https://en.wikipedia.org/wiki/C%2B%2B
- https://en.wikipedia.org/wiki/Java_(programming_language)
- https://en.wikipedia.org/wiki/Python_(programming_language)
- https://en.wikipedia.org/wiki/R_(programming_language)
- https://en.wikipedia.org/wiki/Rust_(programming_language)
- https://en.wikipedia.org/wiki/Scala_(programming_language)
- https://en.wikipedia.org/wiki/C_Sharp_(programming_language)
Email me at Neil@HarwaniSystems.in