[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Which should I learn first /g/? Is C actually better / more

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 21
Thread images: 2

File: cplusplus.png (48KB, 750x272px) Image search: [Google]
cplusplus.png
48KB, 750x272px
Which should I learn first /g/?

Is C actually better / more efficient than C++, or is it just used for operating systems because they were created before C++ was a thing and no one can be bothered to rewrite?

Are modern projects likely to use one over the other?
>>
modern projects are likely to use neither because people rarely write new operating systems
>>
>>62095537
What are you looking to do?

If you want to program for a hobby, C, C++, Python.

If you want to work as a programmer and earn a good salary: Java, JavaScript, C#.

But anyways if you're just starting I recommend learning to program with Python. Then move on to whatever.
>>
>>62095639
>programming
>good salary
what did the new fag meant by this
>>
>>62095639
I already know Java, lua, bash, and some python, this post is just about which out of C or C++ I should learn first, not where I should start programming for the first time.
>>
>>62095537
>>62095680
"C++: nice functionality, let's scotch-tape it to the next version
C: low-medium level, you have to use char arrays instead of strings\0"
>>
>>62095815
Would you say it's better to learn C first then to understand the basics and then learn the extra functionality of C++ ontop? (I know C isn't an exact subset of C++)
Or would you start higher level and work down?
>>
>>62095885
You want to do low level stuff,MCU, writing OS etc.:C
Writing PC applications: c++
The tool depends of what do you want to do
>>
>>62095919
>Writing PC applications: c++
That's far too general

>>62095537
You don't need to learn a language, you need to learn how to program. The question you should be asking is how to do this.

I recommend learning basic programming flow with Python then learning how a computer works by expanding in C. After that you'll have a much better idea of where you want to go next, which will more-likely-than-not mean OOP. Again, the specific language you choose doesn't matter too much but C++ is a pretty typical OOP language.

Asking which programming language to learn, as if you intend to only learn one and use that knowledge to solve any problems you come across, is admitting defeat before you start.

In the time since you've started this thread, you could have learnt control structures and made good progress on practising them.
>>
>>62096486
>Which should I learn """first"""
Also see >>62095680

I appreciate the reply anon but you could have at least read the thread properly
>>
There's no point in learning either of them anymore. Rust is their modern replacemenet.
>>
>>62097354

> muh modern

retarded buzzword.
>>
>>62097354
I wonder if Rust fanboys have actually ever written anything other than fizzbuzz
>>
File: c_vs_c++.png (740KB, 1834x1200px) Image search: [Google]
c_vs_c++.png
740KB, 1834x1200px
>>62095537

Like the name implies, C++is meant as the successor of C, so C is (almost) a true subset of C++.

You can apply pretty much everything that you learn from C in C++, but not the other way around. Also you can learn the basics of C in a couple of weeks. C++ takes a long time to halfway productive, because there are so many gadgets..
Just one example: The C++ template system is a turing-complete language of it's own! Of course you can use C++ without the darker magic, but sooner or later you want to make use of the advanced features.

Long story short:
Start with C. If you really like it, C++ might be interesting for you.

Just work yourself through K&R (google it up, if you don't know what I'm talking about). If you're done with it, implement a few simple data structures (doubly linked list) and play around with sockets and maybe one graphical library of your choice..
As I said, you can do this in a few months and be a halfway decent C programmer. (Linux Kernel, Robotics and complex graphical stuff being the more advanced topics).


Now C++ is really a nice language, don't get me wrong. But it takes a lot of (more complex) books to really get it. It has a lot of syntax and features. C++ is the "one size fits all" language, there's really nothing it can't do. But today many people prefer using languages for specific purposes, because with C++ you buy the whole cow for a glass of milk.
>>
>>62097530
Thanks anon, great reply, just what I was looking for.
I'll buy a copy of K&R and start working through that, and then try some of the things you mentioned.
>>
C is superior in performance critical and small applications because it has better low level facilities. For example, OS kernels and embedded systems are written in C almost 100% of the time.
C++ is better in large and complex applications because of its object oriented nature and lots of new features. However, C is often used in conjunction with it when its precision and efficiency is required, as C++ contains many costly abstractions that may help workflow but result in very large binaries.
>>
>>62095537
c for gnu, kernel, low level userland and embedded, small to medium projects
c++ for gui, games, large with high performance projects
>>
>>62097530
The creator of your picrelated probably can't define all those C++ features correctly.
>>
>>62095537
>Is C actually better / more efficient than C++
Depends on how you write it. It's possible to write C++ that is nearly identical to C and compiles down the same way. Most people don't write C++ that way.
>>
>>62097818
it takes less effort to write a complex C app than to write an efficient well designed C++ app
>>
>>62097212
And you could learn how English works and what the word first implies brainlet
Thread posts: 21
Thread images: 2


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.