{"id":607,"date":"2018-02-15T08:05:11","date_gmt":"2018-02-15T08:05:11","guid":{"rendered":"http:\/\/buklijas.info\/blog\/?p=607"},"modified":"2018-03-10T13:17:04","modified_gmt":"2018-03-10T13:17:04","slug":"should-you-learn-c-in-2018","status":"publish","type":"post","link":"http:\/\/buklijas.info\/blog\/2018\/02\/15\/should-you-learn-c-in-2018\/","title":{"rendered":"Should you learn C\/C++ in 2018 ?"},"content":{"rendered":"

Published on:<\/strong> 15.02.2018<\/p>\n

Conclusion<\/h4>\n

I would not recommend learning C\/C++ as your first programing language<\/strong> just for learning to programme, better go with Python<\/strong>.<\/p>\n

Also, if you do not know why you want to learn C\/C++, better do not spend time on it.<\/p>\n

My C\/C++ background<\/h4>\n

Most of my professional programming career, around 10 years I have spent writing C\/C++ programs<\/strong>.<\/p>\n

By professional programming career, I mean that other people have paid me to write code.<\/p>\n

I have spent more time in C\/C++, altho I would say that I know Python better than C\/C++.<\/p>\n

My knowledge of Python is better because Python has fewer features than C\/C++ and you do not need to do memory management<\/strong>.<\/p>\n

Why C\/C++ is hard<\/h4>\n

IMHO C\/C++ is hard due to many features and memory management.<\/p>\n

By the time you understand memory management, you can learn 80% of Python.<\/p>\n

Just look at this image of code that is concentrating 2 strings in C vs. Python<\/strong>.<\/p>\n

\"\"<\/a><\/p>\n

Yes, there can be less C code (error checking, free, few const less) and the code would still work.<\/p>\n

But then I would be showing bad C production code and not be demonstrating how real-world C code should be written<\/strong>.<\/p>\n

It is not fun to debug segmentation fault<\/strong> and that is what you get if there is no proper error checking in C.<\/p>\n

Python code could, and in real life should also have if __name__ == \"__main__\":<\/code>, but I have removed it to because it is not necessary like in C.<\/p>\n

Point is that higher level programing language (Python in this example) is doing a lot of low-level things automatically<\/strong>.<\/p>\n

So, you need fewer lines of code<\/strong>, what means fewer possible bugs, resulting in increased developer productivity<\/strong>.<\/p>\n

The tradeoff is more CPU and memory for faster time to market<\/strong>.<\/p>\n

C and C++ are two different programming languages<\/h4>\n

Here I am using a language construct C\/C++.<\/p>\n

Because most of the code bases (at least that I have seen in a corporate environment) are some hybrid of C and C++.<\/p>\n

My theory is that the older code was written in C and then later they added object-oriented programming (C++).<\/p>\n

But C and C++ are not the same programming languages, mental programming models are quite different<\/strong>.<\/p>\n

C code is about structure, functions, and pointers.<\/p>\n

In C++ you have object-oriented programming and lot of other features.<\/p>\n

In the real world, you need to know C and C++<\/strong>, so that is why I use C\/C++.<\/p>\n

When you should learn C\/C++<\/h4>\n

The only positive thing that I can see that person will learn from learning C\/C++ is manual memory management and pointers<\/strong>.<\/p>\n

Basically better understanding how the computer (on software level) is working.<\/p>\n

If your only reason is to have a better understanding how the computer (on software level) is working, better learn C programing language.<\/p>\n

C has fewer features than C++.<\/p>\n

It is easier to learn C++ if you know C<\/strong> because then you should know manual memory management and pointers.<\/p>\n

But for anything else than few niches (system, embedded, banking, game engines, etc), I do not see a much practical use of C\/C++ in the year 2018.<\/p>\n

Probably you ain’t gonna use C\/C++<\/h4>\n

I am not saying C\/C++ is not in use anywhere in 2018<\/a>.<\/p>\n

I personally (almost every month) get some interview requests for C\/C++ positions.<\/p>\n

Usually, they are either for embedded software (C) or banking industries (C++).<\/p>\n

I am just arguing that beginners (persons that do not know any programing language) should not start with C\/C++<\/strong>.<\/p>\n

The only exception is if you are planning to get a job (or start your business) in C\/C++ environment.<\/p>\n

If it is not for the job\/business, I do not see why you should learn C\/C++, except for hobby.<\/p>\n

But even then, get a better hobby \ud83d\ude42<\/strong>.<\/p>\n

P.S. If you, dear reader, think that I am missing some point, please add it in comments.<\/p>\n","protected":false},"excerpt":{"rendered":"

Published on: 15.02.2018 Conclusion I would not recommend learning C\/C++ as your first programing language just for learning to programme, better go with Python. Also, if you do not know why you want to learn C\/C++, better do not spend time on it. My C\/C++ background Most of my professional programming career, around 10 years […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"Should you learn C\/C++ in 2018 ? #C #C++ #C\/C++ #programming #Python","jetpack_is_tweetstorm":false},"categories":[27],"tags":[37,4],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"yoast_head":"\nShould you learn C\/C++ in 2018 ? - Sasa Buklijas<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/buklijas.info\/blog\/2018\/02\/15\/should-you-learn-c-in-2018\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Should you learn C\/C++ in 2018 ? - Sasa Buklijas\" \/>\n<meta property=\"og:description\" content=\"Published on: 15.02.2018 Conclusion I would not recommend learning C\/C++ as your first programing language just for learning to programme, better go with Python. Also, if you do not know why you want to learn C\/C++, better do not spend time on it. My C\/C++ background Most of my professional programming career, around 10 years […]\" \/>\n<meta property=\"og:url\" content=\"http:\/\/buklijas.info\/blog\/2018\/02\/15\/should-you-learn-c-in-2018\/\" \/>\n<meta property=\"og:site_name\" content=\"Sasa Buklijas\" \/>\n<meta property=\"article:published_time\" content=\"2018-02-15T08:05:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-03-10T13:17:04+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/buklijas.info\/blog\/wp-content\/uploads\/2018\/02\/C_vs_Python_3s-1024x403.jpg\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\">\n\t<meta name=\"twitter:data1\" content=\"Sasa Buklijas\">\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data2\" content=\"3 minutes\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"http:\/\/buklijas.info\/blog\/#website\",\"url\":\"http:\/\/buklijas.info\/blog\/\",\"name\":\"Sasa Buklijas\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"http:\/\/buklijas.info\/blog\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"http:\/\/buklijas.info\/blog\/2018\/02\/15\/should-you-learn-c-in-2018\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/i0.wp.com\/buklijas.info\/blog\/wp-content\/uploads\/2018\/02\/C_vs_Python_3s.jpg?fit=1147%2C451\",\"width\":1147,\"height\":451},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/buklijas.info\/blog\/2018\/02\/15\/should-you-learn-c-in-2018\/#webpage\",\"url\":\"http:\/\/buklijas.info\/blog\/2018\/02\/15\/should-you-learn-c-in-2018\/\",\"name\":\"Should you learn C\/C++ in 2018 ? - Sasa Buklijas\",\"isPartOf\":{\"@id\":\"http:\/\/buklijas.info\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/buklijas.info\/blog\/2018\/02\/15\/should-you-learn-c-in-2018\/#primaryimage\"},\"datePublished\":\"2018-02-15T08:05:11+00:00\",\"dateModified\":\"2018-03-10T13:17:04+00:00\",\"author\":{\"@id\":\"http:\/\/buklijas.info\/blog\/#\/schema\/person\/780025d597f1c5df3cc156eaffc8c561\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/buklijas.info\/blog\/2018\/02\/15\/should-you-learn-c-in-2018\/\"]}]},{\"@type\":\"Person\",\"@id\":\"http:\/\/buklijas.info\/blog\/#\/schema\/person\/780025d597f1c5df3cc156eaffc8c561\",\"name\":\"Sasa Buklijas\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"http:\/\/buklijas.info\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"http:\/\/0.gravatar.com\/avatar\/9f6f7de5a4882517ca0e4a8ebd607925?s=96&d=mm&r=g\",\"caption\":\"Sasa Buklijas\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5YHGV-9N","_links":{"self":[{"href":"http:\/\/buklijas.info\/blog\/wp-json\/wp\/v2\/posts\/607"}],"collection":[{"href":"http:\/\/buklijas.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/buklijas.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/buklijas.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/buklijas.info\/blog\/wp-json\/wp\/v2\/comments?post=607"}],"version-history":[{"count":10,"href":"http:\/\/buklijas.info\/blog\/wp-json\/wp\/v2\/posts\/607\/revisions"}],"predecessor-version":[{"id":647,"href":"http:\/\/buklijas.info\/blog\/wp-json\/wp\/v2\/posts\/607\/revisions\/647"}],"wp:attachment":[{"href":"http:\/\/buklijas.info\/blog\/wp-json\/wp\/v2\/media?parent=607"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/buklijas.info\/blog\/wp-json\/wp\/v2\/categories?post=607"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/buklijas.info\/blog\/wp-json\/wp\/v2\/tags?post=607"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}