• Guest
HabraHabr
  • Main
  • Users

  • Development
    • Programming
    • Information Security
    • Website development
    • JavaScript
    • Game development
    • Open source
    • Developed for Android
    • Machine learning
    • Abnormal programming
    • Java
    • Python
    • Development of mobile applications
    • Analysis and design of systems
    • .NET
    • Mathematics
    • Algorithms
    • C#
    • System Programming
    • C++
    • C
    • Go
    • PHP
    • Reverse engineering
    • Assembler
    • Development under Linux
    • Big Data
    • Rust
    • Cryptography
    • Entertaining problems
    • Testing of IT systems
    • Testing Web Services
    • HTML
    • Programming microcontrollers
    • API
    • High performance
    • Developed for iOS
    • CSS
    • Industrial Programming
    • Development under Windows
    • Image processing
    • Compilers
    • FPGA
    • Professional literature
    • OpenStreetMap
    • Google Chrome
    • Data Mining
    • PostgreSQL
    • Development of robotics
    • Visualization of data
    • Angular
    • ReactJS
    • Search technologies
    • Debugging
    • Test mobile applications
    • Browsers
    • Designing and refactoring
    • IT Standards
    • Solidity
    • Node.JS
    • Git
    • LaTeX
    • SQL
    • Haskell
    • Unreal Engine
    • Unity3D
    • Development for the Internet of things
    • Functional Programming
    • Amazon Web Services
    • Google Cloud Platform
    • Development under AR and VR
    • Assembly systems
    • Version control systems
    • Kotlin
    • R
    • CAD/CAM
    • Customer Optimization
    • Development of communication systems
    • Microsoft Azure
    • Perfect code
    • Atlassian
    • Visual Studio
    • NoSQL
    • Yii
    • Mono и Moonlight
    • Parallel Programming
    • Asterisk
    • Yandex API
    • WordPress
    • Sports programming
    • Lua
    • Microsoft SQL Server
    • Payment systems
    • TypeScript
    • Scala
    • Google API
    • Development of data transmission systems
    • XML
    • Regular expressions
    • Development under Tizen
    • Swift
    • MySQL
    • Geoinformation services
    • Global Positioning Systems
    • Qt
    • Dart
    • Django
    • Development for Office 365
    • Erlang/OTP
    • GPGPU
    • Eclipse
    • Maps API
    • Testing games
    • Browser Extensions
    • 1C-Bitrix
    • Development under e-commerce
    • Xamarin
    • Xcode
    • Development under Windows Phone
    • Semantics
    • CMS
    • VueJS
    • GitHub
    • Open data
    • Sphinx
    • Ruby on Rails
    • Ruby
    • Symfony
    • Drupal
    • Messaging Systems
    • CTF
    • SaaS / S+S
    • SharePoint
    • jQuery
    • Puppet
    • Firefox
    • Elm
    • MODX
    • Billing systems
    • Graphical shells
    • Kodobred
    • MongoDB
    • SCADA
    • Hadoop
    • Gradle
    • Clojure
    • F#
    • CoffeeScript
    • Matlab
    • Phalcon
    • Development under Sailfish OS
    • Magento
    • Elixir/Phoenix
    • Microsoft Edge
    • Layout of letters
    • Development for OS X
    • Forth
    • Smalltalk
    • Julia
    • Laravel
    • WebGL
    • Meteor.JS
    • Firebird/Interbase
    • SQLite
    • D
    • Mesh-networks
    • I2P
    • Derby.js
    • Emacs
    • Development under Bada
    • Mercurial
    • UML Design
    • Objective C
    • Fortran
    • Cocoa
    • Cobol
    • Apache Flex
    • Action Script
    • Joomla
    • IIS
    • Twitter API
    • Vkontakte API
    • Facebook API
    • Microsoft Access
    • PDF
    • Prolog
    • GTK+
    • LabVIEW
    • Brainfuck
    • Cubrid
    • Canvas
    • Doctrine ORM
    • Google App Engine
    • Twisted
    • XSLT
    • TDD
    • Small Basic
    • Kohana
    • Development for Java ME
    • LiveStreet
    • MooTools
    • Adobe Flash
    • GreaseMonkey
    • INFOLUST
    • Groovy & Grails
    • Lisp
    • Delphi
    • Zend Framework
    • ExtJS / Sencha Library
    • Internet Explorer
    • CodeIgniter
    • Silverlight
    • Google Web Toolkit
    • CakePHP
    • Safari
    • Opera
    • Microformats
    • Ajax
    • VIM
  • Administration
    • System administration
    • IT Infrastructure
    • *nix
    • Network technologies
    • DevOps
    • Server Administration
    • Cloud computing
    • Configuring Linux
    • Wireless technologies
    • Virtualization
    • Hosting
    • Data storage
    • Decentralized networks
    • Database Administration
    • Data Warehousing
    • Communication standards
    • PowerShell
    • Backup
    • Cisco
    • Nginx
    • Antivirus protection
    • DNS
    • Server Optimization
    • Data recovery
    • Apache
    • Spam and antispam
    • Data Compression
    • SAN
    • IPv6
    • Fidonet
    • IPTV
    • Shells
    • Administering domain names
  • Design
    • Interfaces
    • Web design
    • Working with sound
    • Usability
    • Graphic design
    • Design Games
    • Mobile App Design
    • Working with 3D-graphics
    • Typography
    • Working with video
    • Work with vector graphics
    • Accessibility
    • Prototyping
    • CGI (graphics)
    • Computer Animation
    • Working with icons
  • Control
    • Careers in the IT industry
    • Project management
    • Development Management
    • Personnel Management
    • Product Management
    • Start-up development
    • Managing the community
    • Service Desk
    • GTD
    • IT Terminology
    • Agile
    • Business Models
    • Legislation and IT-business
    • Sales management
    • CRM-systems
    • Product localization
    • ECM / EDS
    • Freelance
    • Venture investments
    • ERP-systems
    • Help Desk Software
    • Media management
    • Patenting
    • E-commerce management
    • Creative Commons
  • Marketing
    • Conferences
    • Promotion of games
    • Internet Marketing
    • Search Engine Optimization
    • Web Analytics
    • Monetize Web services
    • Content marketing
    • Monetization of IT systems
    • Monetize mobile apps
    • Mobile App Analytics
    • Growth Hacking
    • Branding
    • Monetize Games
    • Display ads
    • Contextual advertising
    • Increase Conversion Rate
  • Sundry
    • Reading room
    • Educational process in IT
    • Research and forecasts in IT
    • Finance in IT
    • Hakatonas
    • IT emigration
    • Education abroad
    • Lumber room
    • I'm on my way

What I don't like in C and C ++

 3r33300. 3r3-31. Please do not read professional C /C ++ programmers).
 3r33300.
 3r33300. In the article, I express my point of view, if you disagree - justify in the comments.
 3r33300. The purpose of this article is to point out the shortcomings of C and C ++, which I really dislike and encourage you to use the new version of the language or maybe even offer some ideas for improving the standard.
 3r33300.
 3r33300. Well, it's time to rekindle the holivar.
 3r33300. 3r314. 3r3188.
 3r33300. I think everyone knows that it’s awesome strings in C ++. Especially if we are talking about the old type, in the new string a lot has been fixed and improved, but there is still no support for Unicode (!).
 3r33300.
 3r33300. In the standard C ++ 2? it seems like they are going to enter unicode strings.
 3r33300.
 3r33300. C ++ 20! And this is despite the fact that C ++ [b] exists since 1983 3r33282. .
 3r33300.
 3r33300. Open your favorite IDE and try to compile the following code:
 3r33300.
 3r33300.
#include
3r33300. #include
3r33300. 3r33300. int main ()
{
char string[256]; 3r33300. std :: cout "Hi:"; 3r33300. gets (string); 3r33300. std :: cout "Output:" string; 3r33300. return 0; 3r33300.}

 3r33300. UPD1: the commentator says that krakozyabry only on Windows. That's for sure, I forgot to write about it.
 3r33300. But still unpleasant.
 3r33300.
 3r33300. I compiled in Dev Cpp, the GCC compiler.
 3r33300.
 3r33300. Compile and see:
 3r33300.
 3r33300. What I don't like in C and C ++  3r33300.
 3r33300. Good screen output, huh?
 3r33300.
 3r33300. Now let's replace the char string[256]on char * string.
 3r33300.
 3r33300. I’m not saying that this should work, but the compiler should have thrown the error out as a maximum.
 3r33300.
 3r33300. We got a work program that hung.
 3r33300. It would be better if the compiler threw an error.
 3r33300. And the whole garbage is that the compiler is not enough to compile it, it is not
 3r33300. brought a warning.
 3r33300.
 3r33300. Here's another joke:
 3r33300.
 3r33300.
#include
3r33300. using namespace std; 3r33300. int main () {
int arr[100]= {}; 3r33300. coutarr[101]endl; 3r33300. return 0; 3r33300.}

 3r33300. What do we expect? The compiler will tell us that it is impossible to refer to 101 array elements, since there are only 100 elements. But we compile, run and see 32765 (at least on my hardware).
 3r33300.
 3r33300. Hmm.
 3r33300.
 3r33300. Now let's test this code here:
 3r33300.
 3r33300.
int i = 5; 3r33300. i = ++ i + ++ i; 3r33300. std :: couti; 3r33300.
 3r33300. What do you think he will bring?
 3r33300.
 3r33300. The correct answer depends on the compiler.
 3r33300.
 3r33300. In GCC, this will be 1? but depending on the optimization flags.
 3r33300.
 3r33300. And in another compiler it can easily be 12
 3r33300.
 3r33300. I think everyone knows that in C and in the pluses a bunch of syntactic sugar, which is not always needed.
 3r33300.
 3r33300. For example, std :: cout4["string"]; This is the valid code
 3r33300. It outputs n, as well as std :: cout "string"[4];
 3r33300.
 3r33300. Great, huh?
 3r33300.
 3r33300. And now about the patient.
 3r33300. C ++ and network.
 3r33300. These are 2 sooo badly matched concepts.
 3r33300. Try to just download the image of the cat from your favorite site using the standard C ++ library.
 3r33300. This was not possible until the adoption of standard C ++ 17.
 3r33300. In the same standard library you cannot work with JSON.
 3r33300. Excellent comment about this.
 3r33300.

In general, working with JSON in C ++ is like a nightmare.
 3r33300.
3r3187. Source 3r3188. .
 3r33300. Do you think the condition will always be false?
 3r33300.
 3r33300.
    if (sizeof ('a')! = sizeof (char)) {
//do something
}

 3r33300. No, you are mistaken.
 3r33300.
 3r33300. If you compile it as a c ++ project, then the condition is likely to fail.
 3r33300. Should not.[1]
 3r33300. And if like a C project, then in that case sizeof ('a') == sizeof (int).
 3r33300. That's it.
 3r33300.[1]In general, many different C and C ++ compilers are also a problem.
 3r33300. Because a lot of solutions are non-standardized and they will work only in certain compilers.
 3r33300.
 3r33300. For example, 128 bit numbers in C ++. In gcc and clang there is a type __int12? while in Visual Studio it is not, because it is not a standard. Or, for example, strings in Visual Studio.
 3r33300.
 3r33300.
    String ^ MyString3 = "Hello, world!"; //try compiling into GCC

 3r33300. Or, for example, in the old Borland C ++ Builder, you can code written in Object Pascal.
 3r33300. And there are many such moments.
 3r33300.
 3r33300. Of particular pain is the lack of a list of C and C ++ packages.
 3r33300.
 3r33300. What follows from this? Use the new version of C ++, for example C ++ 17 and some problems will be solved.
 3r33300.
 3r33300. I must say that in the nearest competitor C ++ - Rust there are not most of the problems from this list, for example, there is a wonderful cargo, but of course it is not perfect either.
 3r33300.
 3r33300. And what problems C and C ++ do you know?
 3r33300. Write in the comments.
 3r33300.
 3r33300. UPD: Many people seem to have misunderstood my article:
 3r33300.
In no case do I want to criticize C /s ++ and say write on the plant.
 3r33300. Just pointing out the flaws in s /s ++, because they got a bit of themselves.
 3r33300. Everything has its drawbacks, I just shared my thoughts.
 3r33300. UPD2:
 3r33300.
 3r33300. In the comments, many people write that OS works this way and in general it is a feature. You guys are wrong.
 3r33300. The same proof that you can make a system programming language in which it is not so easy to shoot yourself in the foot.
 3r33300.
 3r33300. It’s just that C /C ++ is full of solutions that nobody can fix, because it can break backward compatibility.
 3r33300.
 3r33300. And yes, this is my opinion, it is [b] subjectively 3r33282. .
 3r33300.
 3r33300. If you do not agree - better comment, and not stupidly minus, because the opinion of all of us is
 3r33300. subjectively.
3r33300. 3r33300. 3r33300.
3r33300.
3r33300. 3r33300. 3r33300. 3r33300.

It may be interesting

  • Comments
  • About article
  • Similar news
This publication has no comments.

weber

Author

10-12-2018, 23:17

Publication Date

Development / Rust

Category
  • Comments: 0
  • Views: 249
Models Sequence-to-Sequence Part 1
xonsh - python as a replacement for
How to create procedural art in less
Digital events in Moscow from October
Honey, we kill free text content
Liquid cooling brakes. System
Write a comment
Name:*
E-Mail:


Comments
I know your aptitude on this. I should say we ought to have an online discourse on this. Composing just remarks will close the talk straight away! What's more, will confine the advantages from this data. 審計 報告

Today, 15:43

nushra45

Great job for publishing such a beneficial web site. Your web log isn’t only useful but it is additionally really creative too. There tend to be not many people who can certainly write not so simple posts that artistically. Continue the nice writing香港利得稅

Today, 15:02

nushra45

I definitely enjoying every little bit of it. It is a great website and nice share. I want to thank you. Good job! You guys do a great blog, and have some great contents. Keep up the good work. 먹튀
Today, 14:46

seo servise

If you are looking for more information about flat rate locksmith Las Vegas check that right away.  best front load washing machine in india
Today, 13:15

jacksonseo


Here we introduce our top coupons that will help you for online shopping at discountable prices.Revounts bring you the best deals that slash the bills.If you are intrested in online shopping and want to save your savings then visit our site for best experience.
Today, 08:41

Emma Taylor

Adv
Website for web developers. New scripts, best ideas, programming tips. How to write a script for you here, we have a lot of information about various programming languages. You are a webmaster or a beginner programmer, it does not matter, useful articles will help to make your favorite business faster.

Login

Registration Forgot password