[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]

Memes aside, should I learn C or C++ first?

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: 65
Thread images: 3

Memes aside, should I learn C or C++ first?
>>
>>59370381
C++

If you're looking for a neat book to start with, buy "Accelerated C++".
>>
>>59370381

If you intend to learn both, do C first.
>>
>>59370410
this guy is correct.

when learning C++, make sure to read stuff that is updated for at least C++11, and to use idioms made for C++11 and on. the language changed quite a bit.
>>
c++

c is nearly useless in 2017
>>
Whatever you will be more productive in. C++ has higher level features which can make life easy, but they can mask what's going on under the hood. C lacks nice features like templates, destructors, abstract classes, etc, but you will have to know exactly what you're doing. Really a matter of preference, depending on what level you want to work at.
>>
>>59370381
Neither.


Learn C if you're going to be writing operating systems or device drivers.

Learn C++ if you want to make video games.
>>
>>59370381
is there an equivalent to k&r for C11?
>>
>>59370381
Learn C, then don't learn C++.
>>
c++ is just a meme, c has been the industry standard for over 40 years
>>
>>59370523
What if I'm just a hobbyist wanting to develop skills for future jobs?
>>
>>59370381
C++. There remains close to 0 reasons to bother with such a featureless low quality language such as C in this century. There is a thing called evolution.

Anything C can do, C++ does it better. C is a subset of C++.
>>
File: thnkeuphor.png (143KB, 411x411px) Image search: [Google]
thnkeuphor.png
143KB, 411x411px
>>59370592
>C is a subset of C++
>>
>>59370589
>hobby
Learn D. You will be a good programmer
>>
>>59370592
That is some ridiculously weak bait.
Get the hell out of here until you get something better.
>>
>>59370602
Yes, any doubt?
>>
>>59370627
>bait
It's not. C is obsolete, and should die ASAP.

C is a disservice to intelligent programmers. It does not have features that a modern programmer would use in the industry and C++ provides all of them. C lacks many things and it's a poor language if you are not stuck in the 80's
>>
>>59370640
There exist programs which are valid C and not valid C++.
Therefore C++ is not a superset of C.

I'm not even talking about trivial shit, either.
There are many important and useful features that are missing from C++.

>>59370686
>C is obsolete
For something to be obsolescent, something has to obsolete it. What makes C obselete?
If you say C++, you clearly have no fucking idea what you're talking about.
>>
>>59370686
>>59370592
Get with the times gramp, C# is the future.
>>
>>59370714
asm.js
>>
>>59370714
>What makes C obselete?
C++
>you clearly have no fucking idea what you're talking about.
Where is C used these days again? Kernel dev? Microcontrollers?
C++ has restricted C to a very niche industry and I hope C dies out just like that. No wonder C's popularity is falling like no other languages
>>
I'd love to learn C/C#/C++ but I have no idea what to program.
>>
>>59370749
In a future where C# dominates, C has NO place to exist.
>>
>>59370714
Except for a handful of very minor details, C++ is a superset of the C programming language.
>>
>>59370765
>very niche industry
Are you saying those niches are not important? You're basically saying "C is obsolete but not obsolete".
C fits its niche so damn well, it isn't going to be replaced any time soon. C++ is utterly inappropriate for the things C is good at.

>>59370809
It's a lot more than you think it is. There are even many cases where they compile with the same syntax but have different semantics.
>>
>>59370381
C++, if you really have to learn any of C or C++.
I'd suggest you start with D. It'll give you a rock solid foundation on programming. D itself is a re-engineering of C++ and as a language D is better than C++.

However learning C is just pointless in this age, I'd say otherwise in the 90's maybe when the hardware industry was not really competitive. I can understand why people are suggesting C though. C is a very small language that takes almost no time to learn. But in the long run C++ will be more helpful to you.
>>
>>59370589
You are choosing language that is very large and hard also it has much less entry level jobs than C# or Java.

Also from financial side of job.

Hard job != good salary
market demand == good salary

C embedded programmer with 10 years of documented exp. will make much less money than java code monkey with 10 years of exp.

Writing in c or c++ is not making you a better programmer in any way, you will just loose your hairs faster fucking with dumb shit.
>>
>>59370858
>>59370617
samefag shilling D. Can you program a kernel in D? Well, yeah, but no one does because it's shit.
>>
>>59370839
>Are you saying those niches are not important?
No. By niche I mean niche. C has it's place - rare cases where you need to develop kernels. Developing kernels is important but it's only a rare fraction of the software industry.

Kernels can be developed in assembly too.

>>59370839
>It's a lot more than you think it is.
-No tentative definitions in C++
-No K&R function definition style
-Nested struct has class-scope in C++
-No default int
-No special handling of declaration specifiers in array dimensions of parameters
-No variable length arrays
-No flexible array member
-No restrict qualifier for helping aliasing analysis

Is that all? hahaha
>>
>>59370887
Is OP going to develop a kernel? Dumb C tard fuck off.

Also
>Can you program a kernel in D?
Why are C tards so tech illiterate? Legit queston
https://github.com/Vild/PowerNex
>>
>>59370951
I said you can, but no one does. And that one shitty kernel you suggested doesn't even support an OS. You're just proving my point here, please stop.
>>
>>59370951
Most /g/ programmers are novice first year undergrads. C is easy to learn and /g/ probably has been able to learn C. Amazing how /g/ babbies live under a rock like that.

/g/ babbies hate anything but C because other systems languages are too hard for them
>>
>>59370983
JUST FUCKING LOOK AT THE BACKPEDALING OF A C TARD

>>59370887
>no one does
>>59370951
>example given
"gee may be some space alien made that kernel"

Low IQ C tards are source of all the cringes
>>
>>59370918
If we're talking about syntax alone, you missed designated initialisers, compound literals, _Generic and maybe a few others I'm forgetting off the top of my head.
There are also a shitload of semantic differences between the languages.
Automatic void * conversions, sizeof char literals, non-static inline functions, are a few that pop to my head. I'm sure there are dozens of small ones which could easily trip people up and lead to subtle bugs.
You also missed C's important feature of being easy to implement, its distinct "lack of features" (which is a feature in itself), it's unwillingness to cause an explosion of object code, it's stable ABI (this one is important), and so on.
>>
>>59370992
function c() {
rm -rf .wild-cache PowerNex.iso Disk/boot/PowerNex.{krl,dsk} Initrd/Binary Userspace/lib {Kernel,Userspace/{Init,libRT,libPowerNex,Shell,Cat,HelloWorld}}/obj/
}
function v() {c && ./build}
function b() {v && qemu-system-x86_64 -cdrom PowerNex.iso -m 2048 -monitor stdio -serial file:COM1.log -no-reboot}
function a() {addr2line -e Disk/boot/PowerNex.krl $1}


Woah, that's so difficult.
>>
>>59371036
C doesn't have Generics
>>
>>59371024
Sorry, my bad.
>no one relevant does
>>
>>59371051
For a C babby maybe. What are you trying to prove there with that block of code?
>>
>>59371024

He is not backpedaling, its just your reading comprehension and attention span are at a level of a retard.
>>
>>59371052
It has _Generic, which is a compile-time switch based on the type of the argument.
>>
>>59371082
Learn to read, dumb fuck
>>
>>59371077
That D is shit. A kernel written in it relies on the Linux command line LMAO
https://github.com/Vild/PowerNex/blob/master/env.sh
>>
>>59370992
>D
>Systems language
>Garbage collected
>>
>>59371098
see >>59371074

No one relevant uses D unironically
>>
>>59371100
>Linux command line
.sh files are not "Linux command line" you computer illiterate C tard.
>>
>>59371098

You ought to practice what you preach in this particular case.
You are embarrassing yourself.
>>
>>59371115
But it's got rm -rf in which is LINUX. Fucking idiot.
>>
>>59371109
If you don't need garbage collection you can avoid them, and there are instructions on how to do that
>>
>>59371134
That is some incredibly weak justification.
>>
>>59371129
>rm -rf
>"Linux"
Jesus christ are you actually baiting? What's so Linux about rm -rf? Fucking dumb shit?

>>59371145
What weak justification?
>>
>>59371157
int main(string[] args) {
assert(args.length == 3);
auto pipes = pipeProcess(["sh", "-c", `readelf -W -s ` ~ args[1] ~ ` | grep "FUNC" | awk -F" " '{ print $2 " " $3 " " $8}'


LOL IT CAN'T EVEN DO THIS ITSELF IT HAS TO RELY ON LINUX HAHAHAHAHA

https://github.com/Vild/PowerNex/blob/master/Utils/GenerateSymbols.d
>>
>>59371191
>IT HAS TO RELY ON LINUX
>LINUX
Are you actually dense or >>59370992 was right? First year?
>>
>>59371226
>kernels written in D have to use Linux to do the legwork
Stay butthurt D shiller
>>
File: 1487776988114.png (60KB, 645x968px) Image search: [Google]
1487776988114.png
60KB, 645x968px
>>59371191
>see grep and awk
>see rm
>see a .sh file
"it's linux guise"
>>
>>59371255
For the fourth time:
What's so Linux about .sh?
>>
>>59371260
Linux uses rm and grep and awk idk what it is but I'm pretty sure it uses awk too since the l shaped symbol moves the previous functions contents to it. I think it's std(main) --out?
>>
>>59371051
looks just like actionscript. was it actionscript inspired or something?
>>
Learn C first, and do a small but non-trivial project with it.
C is simpler to learn because it isn't as huge as C++. It will allow you to concentrate on pointer manipulation and memory management, which are things you will also need to tackle in C++, and are kinda tricky to get at first if you are used to a garbage-collected language.
Another reason to learn C before C++ is that a lot of C libraries are often used in C++ programs.
Once you are comfortable with C, you can learn C++, and you will get why C++ is a thing in the first place. Despite being a language hated by many people, classes, templates, smart pointers, etc, are all very useful additions to the C core of the language.
I wouldn't recommend to get "Accelerated C++" because it teaches C++98, which is outdated. Get "A Tour of C++" or "The C++ Programming Language" which include the former.
For C, two useful books to get are "Understanding and Using C Pointers" and "21st Century C".

>>59370749
C# can't compete with C/C++ if you need performance. It's all about using the right tool for the job.
>>
>>59371282
More like
Unix uses, the kernel/src/ does not, in any way, relies on Linux, it's a different kernel
>>
learn Rust, as good as C/C++ minus the bullshit
>>
>>59371294
what
>>
>>59371305
C has neither bullshit nor features. It's a tasteless POS. Might as well use assembly because everyone in the world has to develop his own kernel now according to C toddlers
>>
>>59371324
yes, it has the same function calls. but action script has more advanced types, like String.
function sampleFunction():void{ 
var sampleVariable:String = "Hello, world.";
trace(sampleVariable);
}
>>
>>59371359
>():void
>var sampleVariable:String
I don't see such things here >>59371191

Do you have autism?
>>
>>59370381
Do you want memory exploits and security vulnerability in your program? If yes I highly recommend exploitlang (aka c).
Over the years c has managed to remain the mother of all security vulnerabilities and 0days.
Thread posts: 65
Thread images: 3


[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.