Is C++ getting RUSTed?

Is C++ getting RUSTed?

A StackOverFlow survey marked Rust as the most loved programming language, sitting at the number 1 spot with 78.9% preferred, with the later sitting in 22nd spot at 46.7%.

Both Rust and C++ are system programming languages which means they can be used to write low-level code like operating system Kernels or firmware for micro-controllers.

Also, both of them provide a high level of abstraction which helps in building applications like games and web applications.

Both overcome the problems of memory management which were present in C language like segmentation fault and undefined behaviors. They both do not have the garbage collector to manage the unused memory which makes the code more efficient and predictable.

No alt text provided for this image

In modern C++ to handle the problem of memory leak while using pointer operations there is a powerful concept introduced known as smart pointers. With using smart pointers, we do not need to explicitly call delete rather it will be automatically deleted. But still there are significant limitations to the use of this smart pointers. Rust takes it step further an introduces the concept of Borrow-Checker, a component bundled inside the compiler itself which makes sure that reference is not allowed to outlive the data they refer to. It also solves the problem of racing.

Rust also provides the functionality of Sync and Send which determines that a multithreading operation is safe or not. Although sharing memory between the threads is possible but if some thread tries to do it unsafely then Rust will stop you from doing so providing data races at an early stage.

Also, unlike C++ where every variable is mutable by default and we can make it immutable by adding a keyword Const, in Rust every variable is immutable by default, and we can make them mutable by adding mut keyword.

One more additional feature is managing the packages in Rust, Cargo is the official package manager of Rust. With the help of Cargo installing a package in Rust is a very simple task that is done by just adding a line of code in the dependency file.?



Ishaak Mall

Digital Specialist Engineer | Azure PAAS Transformation | AKS | Azure Devops | Containerization

3 年

Insightful! Off course StackOverFlow does represent a major part of the programming industry but for such comparisons I think the TIOBE index is also something to be considered! As it covers far more ground than any possible survey can cover.

要查看或添加评论,请登录

Utkarsh Sharma的更多文章

  • reCAPTCHA: The Turing Test We Use Daily

    reCAPTCHA: The Turing Test We Use Daily

    It is amazing that we use some things so frequently that we forget to understand the mechanism behind them, like for…

  • Enable Machines to Feel: Sentiment Analysis

    Enable Machines to Feel: Sentiment Analysis

    Have you ever got a text from someone and couldn't tell if they were kidding or not? Unless we clearly tell the person…

  • Introduction to Time Series Analysis

    Introduction to Time Series Analysis

    Time series is a sequence of data points organized in time order. Forecast of data by analyzing time-based data is Time…

    1 条评论
  • Dimensionality Reduction by PCA using Orange

    Dimensionality Reduction by PCA using Orange

    The curse of dimensionality haunts every data scientist dealing with a dataset containing a large number of attributes.…

    1 条评论
  • Model Drift in Machine Learning

    Model Drift in Machine Learning

    “Change is the only constant in life.”- Heraclitus (Greek philosopher).

  • Principal Component Analysis????

    Principal Component Analysis????

    What is PCA? Principal Component Analysis, or PCA, is a dimensionality-reduction method that is often used to reduce…

    3 条评论
  • Curse of Dimensionality

    Curse of Dimensionality

    Yes, data scientists and the data handling community do suffer from this well-known curse. So, is it really a curse or…

  • Market Basket Analysis:- What will I buy next?

    Market Basket Analysis:- What will I buy next?

    Have you ever wondered, while entering a shopping store that how they organize or stack the things in a particular…

  • What do Data Engineer Do?

    What do Data Engineer Do?

    So, to define it very shortly a data engineer is that person who is responsible to collect the data from various…

    4 条评论
  • A beginner’s Guide to data mining : RapidMiner

    A beginner’s Guide to data mining : RapidMiner

    RapidMiner studio is a data science and data mining platform that lets users extract transform and load data to draw…

社区洞察

其他会员也浏览了