[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
C or C++
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 58
Thread images: 6
File: Difference-btw-C-vs-C-.png (180 KB, 700x350) Image search: [Google]
Difference-btw-C-vs-C-.png
180 KB, 700x350
Should I learn C or C++?
>>
>>54887648
learn c++ because once you learn it well, c will take literally 20 minutes to learn.
>>
Neither because you can't even tell us what exactly you're trying to achieve
>>
>>54887648
as one clearly originated from the other why not learn both?
>>
>>54887675
no, it will take forever to unlearn C++ to get to C
>>
>>54887648
>Should I learn French or German?
You need to tell us more about your circumstances, senpai
>>
>>54887648

learn C well

then take a look at C++ and realize what a clusterfuck it is. decide to learn the useful features of C++ and ditch the rest.
>>
>>54887993
Shalt thou wist ye olde anglosaxon (C), or should you learn modern English? (C++)
>>
>>54888086

>what is false equivalence
>>
File: 71cWa92TMyL.jpg (194 KB, 931x1398) Image search: [Google]
71cWa92TMyL.jpg
194 KB, 931x1398
>>54887648
None of those. You know what you should actually learn.
>>
>>54888113
It's a better analogy than French/German analogy.
>>
>should I learn good ol' Queen's English or ebonics
>>
>>54888175

not really because C is superior to C++
>>
>>54888176
this
>>
>>54887648
Depends on what you want to do. If you're learning for shits and giggles then either will do.
>>
>>54887648
Learn C, get good with it, learn some data structures and algorithms (read: implement them yourself), then learn C++, get good, learn the STL and learn it well.

Then when you're done being a little faggot, learn Rust.
>>
Learn Java.
>implying you need anything else, ever
>inb4 mad ctards trying to meme you into their shit designed non-languages
>>
>>54888636
>Java
DESIGNATED
MEMORY
L
E
A
K
S
>>
Learn enough about both to know the difference, and what constructs or syntax is valid C but not valid C++ and vice versa.

90% of this board (and 50% of people in general) don't know.

>UHHHH classes
>>
>>54887648
Learn both, because they are two completely different languages.

C = portable assembly
C++ = modern multi-paradigm programming language that happens to be compatible with C (which is a downside, not a plus)
>>
>>54888804
>that happens to be compatible with C

And which standards are you comparing now?

Sure isn't C++11 and any of the C standards.
>>
File: 1464063060780.png (463 KB, 785x678) Image search: [Google]
1464063060780.png
463 KB, 785x678
>>
>>54888840
C++11 is compatible with C. That doesn't mean the other way around is true. It's not a symmetrical relation.
>>
File: 1437831052919.png (477 KB, 907x468) Image search: [Google]
1437831052919.png
477 KB, 907x468
>>54888895
>>
>>54889004
>C++11 is compatible with C
Except this is incorrect for every C standard.
>>
>>54888180
You never programmed in your life retard
>>
>>54887648
Learn C++
It is objectively better.
>>
>>54887648
C if you want to do embedded/linux stuff
C++ if you want to do windows shit
>>
C -> C++ -> Then whatever.
>>
>>54888706
kekd
>>
Is there a good book on memory management on c?
>>
>>54888706
What are designated memory dmleaks? :^)
>>
>>54888327
Basically my purpose for learning
>>
>>54889105
Programming for embedded systems sounds pretty cool anon
Thanks
>>
If you dont really have much interest in writing gui programs then C is the best.
>>
>>54889253
You really dont need to bother with allocating memory anymore. Most computers now days have 4+ gigs of ram. Malloc is only needed for embeded shit like routers and whatnot.
>>
>>54887975
100% bull. I've been a seasoned c++ programmer for years. It took me around 300 hours to master c. C++ took days (of constant work time) but that was before I was experienced.
>>
>>54889759
how did you master C in 300 hours?

[spoiler]What did you do more precisely? [/spoiler]
>>
>>54889769
not that guy but my suggestion is to read k&r and then read source code of simply programs (reputable ones or even github) and try to volunteer to fix bugs for a few months, or just modify what you have until it works the way you like.

gradually start toying with/writing bigger and bigger packages and collaborating with others or take a more advanced course at a uni if you want a shortcut
>>
File: Gui interface IP.png (815 KB, 961x551) Image search: [Google]
Gui interface IP.png
815 KB, 961x551
>>54889711
yea you need to learn Visual Basic if you want to create a GUI interface, especially if you want to track someones IP
>>
Learn Object Pascal.
>>
Gentoo
>>
C#??
>>
>>54887648
Hindi
>>
>>54889030
>rust
kek. that shit should have died right along with Go
>>
>>54889759
>it took 37 9am-5pm days to learn c
>it took days to learn c++
>somehow this should be interpreted as c being the easy language
>>
File: serveimage2.png (41 KB, 488x441) Image search: [Google]
serveimage2.png
41 KB, 488x441
>>54887648

It's really going to depend on what you're looking to do.

C: Low level programming. Not thinking about guis, more trying to learn how to program microprocessors and small programs. Think of this as the Computer Engineer route. Also not Object Oriented, but you can almost (if not) make it OO if you know how to write code well.

C++: Thinking more about higher level programming. Think more GUI's, data trees, OO, stuff like that. Think of this as the Computer Science route.

C code can be compiled using the C++ compiler, but not the other way around.

Learning one will make it easy to learn the other...to a point. They both work the same way, but the preferred syntax is different for both. For example, a simple hello world program.

The C version
/*
* Hello World program, hello.c
*/

#include <stdio.h>

int main(void)
{
printf("Hello World!\n");
return (0);
}


The C++ version
// Hello World program in C++, hello.cpp

#include <iostream>
using namespace std; // To make this example easier

int main(void)
{
cout << "Hello world!" << endl;
return (0);
}
>>
>>54891785
>implying either rust or go is dead
Rust is being used for Mozilla's ambitious servo project and go is already widespread
>>
>>54888113
this is a false equivalent

>>54888176
this is not


>>54887648
if linux: c++
if windows: c#
>>
>>54892094
What's in C that's not in CPP, honest question.
>>
/g/ will recommend C because they don't have jobs and just write tiny useless programs.
>>
>>54887675
C++ is literally C with more shit.
>>
>>54892038
learn != master
>>
I learned C then C++
C++ was rather easy because I already had a solid background with C
On the other hand if you learn C++ first you're effectively learning both languages at once even though you're making things a bit harder.
C is less marketable but it's waay simpler than C++
So basically:
babysteps? C then C++
full clean cock applicator? C++
>>
>>54892217

This guy explains some of the quirks pretty well.
http://www.cprogramming.com/tutorial/c-vs-c++.html

Going out on a limb for the rest of this here, but I believe I'm correct in what I'm saying.

C can be used to make kernel modules. Linus will NEVER allow C++ to be used in his precious kernel.

C compiles smaller and runs faster, but not always by much. If you are going to program a microprocessor, AVR, STM32, etc, you're much better off going with C of not ASM. C++ adds overhead and in turn that can make your program run/compile incorrectly and make it unable to run on these devices.

Small things like this. That's why I worded it as I did in my previous post. Probably could have been clearer, I apologize.
>>
>>54889726
But caches are still small, and accessing main memory is literally like 100 times slower. If you don't want to manage memory, might as well use Java you fucking Pajeet.
>>
>>54887648
If you want to be viable - both, and a couple more. Meme languages also require you learning names of the latest meme frameworks.
>>
>>54889726
Are you retarded? If you don't allocate, you write on stack, which is 8MB by default, regardless of total system memory.
Thread replies: 58
Thread images: 6

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.