Need advice about which tool to choose?Ask the StackShare community!

C++

16.9K
9.1K
+ 1
845
Django REST framework

1.9K
2K
+ 1
310
Add tool

C++ vs Django REST framework: What are the differences?

Introduction

This article discusses the key differences between C++ and Django REST framework. C++ is a general-purpose programming language that supports both procedural and object-oriented programming paradigms. On the other hand, Django REST framework is a powerful and flexible toolkit for building Web APIs using the Django web framework.

  1. Performance: C++ is known for its high performance and efficiency. It allows low-level manipulations and optimizations, making it suitable for demanding applications that require fast execution. On the other hand, Django REST framework, being built on Django, is a high-level framework that prioritizes ease of development and productivity over raw performance.

  2. Memory Management: C++ provides manual memory management, allowing the programmer to control the allocation and deallocation of memory. This level of control can be beneficial for resource-constrained environments and applications with specific memory requirements. Conversely, Django REST framework, being built on Python, utilizes automatic memory management with garbage collection. This simplifies memory management for the developer, but may introduce some overhead and may not be as efficient as C++ in certain scenarios.

  3. Language Paradigm: C++ supports both procedural and object-oriented programming paradigms. It offers a wide range of features such as templates, multiple inheritance, and operator overloading. This makes it suitable for developing complex systems and high-performance applications. Django REST framework, on the other hand, follows an object-oriented approach and encourages the use of classes and objects to build APIs. It leverages the features and conventions of Django to provide a powerful and consistent development experience.

  4. Tooling and Ecosystem: C++ has a mature tooling ecosystem with powerful compilers, debuggers, and performance profiling tools. It also has a vast collection of libraries and frameworks that cover a wide range of application domains. Django REST framework benefits from the extensive ecosystem of Django, which includes a rich set of third-party libraries, plugins, and community support. It provides a comprehensive set of tools for authentication, serialization, and API documentation out-of-the-box.

  5. Concurrency and Parallelism: C++ provides low-level support for concurrency and parallelism, allowing developers to fine-tune performance through multithreading and multiprocessing. It provides a range of abstractions such as threads, mutexes, and condition variables. Django REST framework, by default, runs on a single-threaded web server and follows a request-response cycle. However, it can be integrated with other tools and libraries such as Celery, Django Channels, or asynchronous frameworks like Gevent to achieve concurrency and handle long-running tasks efficiently.

  6. Integration with Existing Codebase: C++ allows easy integration with existing C and C++ codebases. It supports interoperability with other programming languages through Foreign Function Interfaces (FFIs). This makes it suitable for extending and optimizing legacy systems. Django REST framework, being built on Django, operates within the Python ecosystem. It can leverage the vast array of Python libraries, but integrating with non-Python codebases may require additional steps and tools.

In summary, C++ is a language known for its performance, low-level control, and wide range of features, making it suitable for demanding applications. Django REST framework, on the other hand, prioritizes ease of development, leverages the Django ecosystem, and provides high-level abstractions for building web APIs efficiently.

Advice on C++ and Django REST framework
haydenlingle

I'm going to do an independent study with React for school, and I'm looking to build a full-stack application. I have lots of experience with react, but everything else I'd need is somewhat foreign to me. What I'm looking for is to provide a back-end for a React application.

I'm trying to find a back-end framework that can provide and integrate with almost everything I need (database, API, authentication). I will also need to be able to host everything eventually online rather than just locally on my computer. I don't want to use something that is just click-and-go: I want to learn a lot but find something that has much built in functionality, so I don't have to completely re-invent the wheel.

Does anyone else have experience with a stack you'd recommend that is a happy medium of helpful features while still requiring you to understand and implement the functionality yourself? Something well documented (e.g., it's easy to find documentation regarding putting all the pieces together) would be great.

Thanks in advance!

See more
Replies (7)
Marcelo Escobar
Recommends
on
RailsRails

Greate documentation, lot's of info on StackOverflow and it's easy to learn, a lot of things it's already implemented on the stack. It's based on Ruby which is stable and constantly evolving.

Ruby/Rails have a lot of gems(libraries) that will allow you to connect to many DB systems, implement JWT or use a library for authentication.

I have a lot of API's created in Rails that respond to website and mobile apps, and you can create your first one without a lot of stress, responding with JSON easily.

You can use VSCode has good support for ruby and you will have all syntax help etc, I use Atom but I don't have the syntax support, didn't found a good package for that.

See more
Recommends
on
Node.jsNode.js

The most popular stack that comes to mind for your case if MERN ( Mongo, Express, React and Node) I would use Nodejs + Express for backend. Easy to build dynamic and powerful REST APIs. For DB, it would be Mongo DB and front end can be React + Redux (for global state management). Plus NPM has a ton of packages for most cases. PS : Webstorm (free for students) or VS Code ( free for all) for IDE

See more
Alberto Mazaira
Recommends
on
Node.jsNode.jsRailsRails

I would take either Rails or Node for your problem.

Rails is a great framework: super complete in regards of testing frameworks, authentication libraries, great community support.... but I would say that the latest versions are a bit of a mess for newcomers, because of the way they manage assets: if the assets are served by the framework(Assets Pipeline) vs using Webpack .

If you are already familiar with React, Node is another great framework that will require a bit more effort on selecting the dependencies but for your use case seems a great candidate.

In regards of what you are commenting about learning during the process, both can be Dockerized pretty easy and you can spend some time digging on the lifecycle of putting it into production. Rails has a ridiculous easy way of deploying with Heroku avoiding any kind of work, but if you want to get your hands dirty you can deploy either of the frameworks on a Dockerized environment to any cloud provider you like. That part is really interesting too, and if you are interested on the Devops side, I would say that Node is a bit easier and more convenient(smaller image sizes and times to build) than Rails. All in all:

Rails pros: stable framework, great community support, great testing utilities. Rails cons: How they manage the assets lately(Assets Pipeline vs Webpack), dockerize the app.

Node pros: You are already familiar with Js, simple, easy to put in prod allowing to spend time in the Devops side. Node cons: Dependency management in Js environments is a pain in the ass

See more
Julien DeFrance
Principal Software Engineer at Tophatter · | 4 upvotes · 50.6K views
Recommends
on
RailsRails

Rails is an easy framework to pick up, and you'll get to love all of the magic it does for you. Some of that can be a little confusing at first but once you've got acquainted, this is part of the productivity Rails offers as opposed to other languages or frameworks that sometimes tend to require developers to waste a ton of valuable time setting up their own boilerplate when starting to work on a new project. More pragmatically, Rails is still extremely popular at both startups and at large companies, you can use it to power web applications, or backend APIs, and this will be extremely valuable on your resume. There also is a very large/rich set of libraries (called gems) that will allow you to focus on your actual project/product, rather than rebuilding what already exists. I'd recommend you go with the latest versions of Ruby (3.0) and Rails (6.1.1) so you are from the get-go learning them in their most current form.

See more

Node.js is great if you already know Javascript. If not, JS is pretty easy to learn. There are many resources and tutorials online for JS and Node. ASP.NET (Core) is a good option if you know C# or need high performance. Node.js isn't a complete framework like .NET, so you need to add Express or another HTTP server, and Database connectors etc.

See more
Rogério R. Alcântara
Recommends

Although not entirely confident, as I've never used Django and I've not used ASP.NET since 2.0, but given your requirements, at first thought, I'd go with Rails.

Yet, may I ask if have you considered some BAAS such as Firebase, Hasura and the like? Although I've admittedly suffered a bit with Firebase - I'm not totally sure if I've used it correctly, tho. But I've heard really awesome things about Hasura. This slant compairson shows some Firebase's alternatives that I've never heard. In your position, I would have a look.

Cheers.

See more
Needs advice
on
C++C++JavaScriptJavaScript
and
PythonPython

Hi, I'm just starting to learn code, and I stumbled upon this website. I think I should learn JavaScript, Python, and C++ to begin with. I'm a quick learner so I am only worried about what would be more useful. Suppose my goal is to build an online clothing store or something. Then what languages would be best? I need advice. Please help me out. I'm 13 and just beginning and it's hard to understand when people use technical terms so please keep it simple. Thanks a lot.

See more
Replies (8)
Taimoor Mirza
Associate Software Engineer at Intech Process Automation · | 21 upvotes · 231.1K views
Recommends
on
PythonPython

Go with Python. It's syntax is really simple and less verbose compare to others. You can use Python for basically anything like web dev, task automation, data science, data engineering, cybersecurity etc. At initial level, it's more important to get an understanding of programming fundamentals. Once you get conformable with coding in general, then you can explore other languages.

See more

I would worry less about languages when you're first starting out. If you want to build an online store, then javascript is a great language that is used all over the web! Get comfortable with your first language, learn some computer science concepts and how to build things the right way, and then just work towards a goal and learn as you go!

https://www.w3schools.com/ is a great resource and it's completely free, everything you need to know to build a website is on that page if you have the drive to learn it. Best of luck to you!

Here's a neat roadmap too, in case you find yourself lost on what to learn next https://roadmap.sh/frontend

See more
Recommends
on
JavaScriptJavaScript

I recommend JavaScript to build your first website, for both FrontEnd and BackEnd , even tho I am a BIG fan of C++ it is not well suited yet to create websites, and Python would be just as good for the BackEnd as JavaScript but having everything written in only one language will make your learning curve way easier, so it is easy to recommend JavaScript.

See more
Mukesh Gurpude
Recommends
on
JavaScriptJavaScriptPythonPython

Python is an easy and beginner-friendly language. As you've mentioned about Online Clothing store, you'll need to deal with the website part and you'll need Javascript to make the site accessible and functional. Javascript will be more easy to learn if you learn Python first, so you can just start with Python.

See more
Recommends
on
JavaScriptJavaScript

I have worked with all these a ton. I make ecommerce and enterprise apps now. The only one of these you need is JavaScript. You can use JS on the backend as Node.js in AWS Lambda. You will need HTML and CSS skills, as well as a database. I recommend MongoDB. Please forget about C++ until you built your first company. Python fits the same purpose as Node.js but is currently popular in the Data Science community so skip it until you have a LOT of customers.

See more
Recommends
on
FlaskFlaskPythonPython

Hello Rachel, as a fellow programmer, I am glad that you are planning on expanding your coding knowledge and skills.

I recommend learning python first as it has a very simple syntax (syntax is how your code looks and how simple it is to type) and is also very user-friendly. Once you get to know how to code in python, you can use this thing called Flask.

Flask is what you call a "web application framework" or a WAF, it basically is a tool used to develop websites and other similar things. You don't have to worry much about it's difficulty because it is based on python. You will still have to learn how to use Flask though as it could be a bit complicating in first glance.

If you are looking for simpler ways for making website without having to learn a lot of programming, you can learn HTML and CSS. These 2 will help you in making a basic and functional website. The catch is, from a career perspective, HTML won't get you far, as literally every programmer knows it. So it is best to use programming languages.

I hope this gave you a clear understanding of the ways in which you can build websites. Wishing you the best of luck!

See more
John Akhilomen
Recommends
on
JavaScriptJavaScriptPythonPython

Since you're new, I'd recommend Javascript and Python. With Javascript, just learn React and Node. And with Python, learn Django. With JavaScript, Node, React, Python, and Django; you can accomplish quite a lot for both frontend and backend.

See more
Recommends
on
WordPressWordPress

Hi, When saying that "Suppose my goal is to build an online clothing store or something", I would go for a ready to use platform like Wordpress. it will give you a fast jump into the online world. By using WP you'll have to catch on with PHP\JQuery Goodluck.. Ping me when store is ready, I might buy something....

See more
kristan-dev
Senior Solutions Analyst · | 8 upvotes · 348.5K views

My journey to developing REST APIs started with Flask Restful, and I've found it to be enough for the needs of my project back then. Now that I've started investing more time on personal projects, I've yet to decide if I should move to use Django for writing REST APIs. I often see job posts looking for Python+Django developers, but it's usually for full-stack developers. I'm primarily interested in Data Engineering, so most of my web projects are back end.

Should I continue with what I know (Flask) or move on to Django?

See more
Replies (1)
Rafael Torres
Technical Lead at 4Agile · | 9 upvotes · 338.9K views

If you want to be a Web developer with knowledge in another frontend and NoSql technology, maybe continue with Flask. However, if you want to create very fast solutions to grow up with a new business and merge these with data analysis and other tools, Django is the answer. Basically read more about the service architecture where you feel more comfortable, Microservice or Monolithic, but please will not married with any because they solve issues to different contexts.

See more
Saurav Pandit
Application Devloper at Bny Mellon · | 6 upvotes · 293.6K views

I have just started learning Python 3 weeks ago. I want to create a REST API using python. The API will be used to save form data in an Oracle database. The front end is using AngularJS 8 with Angular Material. In python, there are so many frameworks to develop REST APIs.

I am looking for some suggestions which REST framework to choose?

Here are some features I am looking for:

  • Easy integration and unit testing, like in Angular. We just want to run a command.

  • Code packaging, like in java maven project we can build and package. I am looking for something which I can push in as an artifact and deploy whole code as a package.

  • Support for swagger/ OpenAPI

  • Support for JSON Web Token

  • Support for test case coverage report

Framework can have features included or can be available by extension. Also, you can suggest a framework other than the ones I have mentioned.

See more
Replies (1)
Recommends
on
FlaskFlask
at

For starters flask provides a beautiful and easy way to create REST APIs. Also its supported by excellent beginner docs as well as a very active community. Another good thing with Flask is its widely available list of plugins which allow you to build as you go. Its also good in performance and can scale to a quite decent level. However, if you are sure your project is going to be fairly big, it would be better to start with Django as it provides a lot of features out of the box and is extremely stable in performance. Both these frameworks have support for Swagger, JWT, Coverage Report although you have to install plugins for them. Deploying both of these are fairly simple and there is huge documentation available. Django has one of the best documentations I have come across. I hope I was able to answer your queries.

See more
Decisions about C++ and Django REST framework
Shiqi Lin
Software Developer at BigClarity · | 3 upvotes · 213.6K views

We will use Django to set up our backend and Django REST Framework (DRF) for our API creation. The easiness of performing development tasks (eg. user authentication, URL routing, and schema migration) attracts our attention. Also, Django with PostgreSQL provides many benefits: 1. Some data types in Django will only work with PostgreSQL; 2. Django offers django.contrib.postgres to operate on PostgreSQL; 3. Django supports many features of PostgreSQL. Moreover, Django is compatible with Redis.

See more
Russtopia Labs
Sr. Doodad Imagineer at Russtopia Labs · | 0 upvote · 199.8K views

As a personal research project I wanted to add post-quantum crypto KEM (key encapsulation) algorithms and new symmetric crypto session algorithms to openssh. I found the openssh code and its channel/context management extremely complex.

Concurrently, I was learning Go. It occurred to me that Go's excellent standard library, including crypto libraries, plus its much safer memory model and string/buffer handling would be better suited to a secure remote shell solution. So I started from scratch, writing a clean-room Go-based solution, without regard for ssh compatibility. Interactive and token-based login, secure copy and tunnels.

Of course, it needs a proper security audit for side channel attacks, protocol vulnerabilities and so on -- but I was impressed by how much simpler a client-server application with crypto and complex terminal handling was in Go.

$ sloc openssh-portable 
  Languages  Files    Code  Comment  Blank   Total  CodeLns
      Total    502  112982    14327  15705  143014   100.0%
          C    389  105938    13349  14416  133703    93.5%
      Shell     92    6118      937   1129    8184     5.7%
       Make     16     468       37    131     636     0.4%
        AWK      1     363        0      7     370     0.3%
        C++      3      79        4     18     101     0.1%
       Conf      1      16        0      4      20     0.0%
$ sloc xs
  Languages  Files  Code  Comment  Blank  Total  CodeLns
      Total     34  3658     1231    655   5544   100.0%
         Go     19  3230     1199    507   4936    89.0%
   Markdown      2   181        0     76    257     4.6%
       Make      7   148        4     50    202     3.6%
       YAML      1    39        0      5     44     0.8%
       Text      1    30        0      7     37     0.7%
     Modula      1    16        0      2     18     0.3%
      Shell      3    14       28      8     50     0.9%

https://gogs.blitter.com/RLabs/xs

See more
Get Advice from developers at your company using StackShare Enterprise. Sign up for StackShare Enterprise.
Learn More
Pros of C++
Pros of Django REST framework
  • 202
    Performance
  • 106
    Control over memory allocation
  • 97
    Cross-platform
  • 96
    Fast
  • 84
    Object oriented
  • 57
    Industry standard
  • 47
    Smart pointers
  • 37
    Templates
  • 16
    Gui toolkits
  • 16
    Raii
  • 13
    Generic programming
  • 13
    Control
  • 13
    Flexibility
  • 11
    Metaprogramming
  • 9
    Hardcore
  • 5
    Simple
  • 5
    Full-fledged containers/collections API
  • 5
    Many large libraries
  • 4
    Performant multi-paradigm language
  • 4
    Large number of Libraries
  • 3
    Way too complicated
  • 1
    Close to Reality
  • 1
    Plenty of useful features
  • 66
    Easy to use
  • 65
    Browsable api
  • 53
    Great documentation
  • 50
    Customizable
  • 42
    Fast development
  • 9
    Easy to use, customizable, pluggable, serializer
  • 8
    Python
  • 7
    Django ORM
  • 5
    FastSerialize
  • 3
    Less code
  • 2
    Easy implementation

Sign up to add or upvote prosMake informed product decisions

Cons of C++
Cons of Django REST framework
  • 8
    Slow compilation
  • 8
    Unsafe
  • 6
    Over-complicated
  • 6
    Fragile ABI
  • 5
    No standard/mainstream dependency management
  • 4
    Templates mess with compilation units
  • 3
    Too low level for most tasks
  • 1
    Compile time features are a mess
  • 1
    Template metaprogramming is insane
  • 1
    Segfaults
  • 1
    Unreal engine
  • 2
    Bad documentation
  • 2
    Reimplements Django functionality
  • 1
    No support for URL Namespaces
  • 0
    Bad CSRF handling

Sign up to add or upvote consMake informed product decisions

What is C++?

C++ compiles directly to a machine's native code, allowing it to be one of the fastest languages in the world, if optimized.

What is Django REST framework?

It is a powerful and flexible toolkit that makes it easy to build Web APIs.

Need advice about which tool to choose?Ask the StackShare community!

What companies use C++?
What companies use Django REST framework?
See which teams inside your own company are using C++ or Django REST framework.
Sign up for StackShare EnterpriseLearn More

Sign up to get full access to all the companiesMake informed product decisions

What tools integrate with C++?
What tools integrate with Django REST framework?

Sign up to get full access to all the tool integrationsMake informed product decisions

Blog Posts

May 6 2020 at 6:34AM

Pinterest

JavaScriptC++Varnish+6
5
3366
Oct 24 2019 at 7:43PM

AppSignal

JavaScriptNode.jsJava+8
5
955
GitHubPythonReact+42
49
40728
GitHubPythonNode.js+47
54
72320
GitHubSlackNGINX+15
28
20920
What are some alternatives to C++ and Django REST framework?
C lang
Python
Python is a general purpose programming language created by Guido Van Rossum. Python is most praised for its elegant syntax and readable code, if you are just beginning your programming career python suits you best.
C#
C# (pronounced "See Sharp") is a simple, modern, object-oriented, and type-safe programming language. C# has its roots in the C family of languages and will be immediately familiar to C, C++, Java, and JavaScript programmers.
JavaScript
JavaScript is most known as the scripting language for Web pages, but used in many non-browser environments as well such as node.js or Apache CouchDB. It is a prototype-based, multi-paradigm scripting language that is dynamic,and supports object-oriented, imperative, and functional programming styles.
HTML5
HTML5 is a core technology markup language of the Internet used for structuring and presenting content for the World Wide Web. As of October 2014 this is the final and complete fifth revision of the HTML standard of the World Wide Web Consortium (W3C). The previous version, HTML 4, was standardised in 1997.
See all alternatives