Should I learn C or C++?
>>62438243
Definitely.
>>62438243
both
>>62438243
C is deprecated and only useful if you are maintaining Linux shell tools.
Learn C++ or something higher like C#/Python.
>>62438254
I'll take "Things pajeets say" for 500, Alex
>>62438254
>C is deprecated
>>62438251
But which I should learn first?
>>62438254
>>62438254
>C is deprecated
How to spot a pajeet 1.1
You'll learn C if you start with C++. Compiling C code in a C++ compiler yields no issues.
>>62438254
Local shitposter goes full retard
More news at 11
>>62438380int *foo = malloc(sizeof(int)*5);
Compile this as C++ if you're so great.
>>62438449
yeah, what libraries are being opened?
>>62438449
>>62438492
This is getting interesting
>>62438449
I'm waiting
Learn C++ first.
C++ is not != C+classes - learning C first will give you this impression
>>62438351
I'm a pajeet and in my first year we learn c and Python.
>>62438449
>int *foo = malloc(sizeof(int)*5)
Just modified it to <code> int *foo = (int *)malloc(sizeof(int)*5); </code>
What's the problem, not being able to access generic pointers?
>>62438351
You must be confused my friend. We learn C very early within our Indian university system. In-fact I would say Java is less popular than C within our academics.
>>62438807
>Indian academics
Physics 100: You are on 9th floor. Calculate the momentum transferred from your poo hitting a muslim guys turban below (assume he is 1.6m tall)
>>62438243
C is wonderful
C++ is literally worse than putting your dick in a toaster
>>62438836
>muslim guys turban
>>62438889
Did you get offended, ahmed?
>>62438449struct nigger
{
void *data;
template <typename T>
operator T*() { return (T*) data; };
};
#define malloc(x) nigger{malloc(x)};
>>62439402
>>62438449HAI
CAN HAS STDIO?
I HAS A VAR
IM IN YR LOOP
UP VAR!!1
VISIBLE VAR
IZ VAR BIGGER THAN 10? KTHX
IM OUTTA YR LOOP
KTHXBYE
>>62439504
I can haz unfunny dated maymays???
>>62438910
It is like some saying to you:
>Hahaha! Americans! Do you want to eat some more snails? Do you want to surrender to Germany again? Are you as tall as Napolean? Hahahaha, Americans!
It is easily understood that the intention is to try and embarrass/insult, but your aim is a little bit off.
Learn Java and c# it's easy
>>62439993
begone pajeet
>>62439504
outdated memes are not funny
Just use any language that doesn't force OOP down your throat.
>>62440045
So much this but all jobs as I have seen are in OOP ;_;
>>62440061
OOP is an important part of modern programming.
>>62439846
I'm french and I feel offended, please apologize
REEEEEE
>>62438243
Depends on what you want to do.
Learn both, programming is one of the easiest things you can dive into. Even a lot of people on /g/ do it and they are retards.
>>62440134
>I'm french
Hasta la vista! Put some more chipotle on the burrito, hombre!
>>62440153
Ok we get your point.
It's not funny anymore
>>62439402
>macros#include <cstdint>
namespace cfunc {
extern "C" {
void *malloc(std::size_t size);
}
}
namespace muhmalloc {
struct nigger {
void *data;
template <typename T>
operator T *() {
return (T *)data;
}
};
auto malloc(std::size_t size) { return nigger{cfunc::malloc(size)}; }
}
using muhmalloc::malloc;
int main() {
int *foo = malloc(sizeof(int) * 5);
return 0;
}
>>62440333
Hey, I never realized you could link a function into a namespace like that. That's cool. I guess it only works for extern "C" functions?
>>62440177
i thought it was pretty funny
>>62440353
I don't know, I only found it now. I just wanted a macroless implementation and it happened to work. Honestly, I don't even know if it's legal or not. clang and g++ doesn't complain.
>>62438243
both
>>62438243
Honestly, you could learn them just for the history and to get a deeper knowledge of how computers work, but there isn't really any practical reason to learn C or C++ at this point.
If you're starting out now, you should learn modern languages. C and C++ are old and obsolete at this point. Rust replaces them for low-level systems programming, and other languages like Go and C# cover high-level programming.
holy shit go back to pol
>>>/pol/
>>62438781
Saved.
>>62438243
C of course. C++ is obsolete and it's a disease.
>>62438781
>"""""""learns""""""" C in school
>thinks he knows C
wake up pajeet. knock knock
>>62438243
c very well then c++ very well
>>62442272
>imblying it's possible to learn C++ very well
>>62438243
Gee, I wonder?
>C
-learn syntax in one week
-learn tooling in one more week
-write perfectly understandable code
-writing C code generators is easy
-use C via FFI in many high level languages like Haskell, Python, Ruby, Lua and many more
-C always comes in handy, even if you don't really use it every day
>C++
-learn the basic syntax in one year
-learn tooling in months
-write cryptic and complex code
-nobody likes C++, except C++ users
-writing C++ code generators brings no advantage to C code generation
-C++ is a "do or die", either you are extermely good and find a C++ job or nobody will care
>>62438288
>should I learn how to ride a bike or how to do sick 360 flips on my mtb first?
>>62438243
c
c++ is a meme
>>62438449
So I typed this out in C and I got 6118896.
I looked up Malloc, why would you need This? Why would I need to take a big chunk of memory?
>>62443070
anon stop trying if you dont know c
>>62443070
I don't know if this is bait or not..
Maybe look up C pointers?#include <stdio.h>
#include <stdlib.h>
int main(void) {
int *foo = malloc(sizeof(int)*5);
// prints the memory adress where the pointer is pointing to (something like "21143568")
printf("%i\n", foo);
// prints the value of the memory adress where the pointer is pointing to (0)
printf("%i\n", *foo);
free(foo);
return 0;
}
>>62438243
Learn to suck robot dick because programming will be obsolete when robots take over
>>62443346
AND WHO WILL PROGARMM THOSE ROBOTS?!?!
>inb4 muh singularity
>>62438243
>Should I learn C or C++?
Depends entirely on what you want to do. In most cases C++ is better. Far more jobs in it.
>>62443380
The singularity will
>>62438288
It doesn't matter. One will make it easier to learn the other anyway.
>>62438449int *foo = (int*)malloc(sizeof(int)*5);
??
>>62443535
Integer pointer foo = (typecast to integer pointer) allocate memory (five times the size of an integer)
>>62438449
>int *foo
Why do people write this? Do they interpret * as part of name? It's unreadable.
C is just so intuitive. Need to make a variable-sized list of strings? Easy:#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
char **foo = malloc(sizeof(char *) * argv[1]);
for (int i = 0; i < 10; i++)
{
foo[i] = malloc(sizeof(char) * argv[2]);
}
return EXIT_SUCCESS;
}
>>62443843
Change 10 to argv[1]
>>62443843
Can't tell if he's sarcastic or not
>>62438243
Is C# really used that often? How does it differ from C++ and C that makes it better? Also, how I'd it any better than Java?
Assuming you don't know any programming because you're asking this dumb question - I'd do C first because
1.) you learn memory management
2.) you can't BS shit, you have to know what's going on and understand your code(due to that last part)
3.) if you try to learn C after you've done a higher level language like Python or even java or c++ you'll think "I can't even add two strings together without thinking for more than a few minutes whereas in python or java it's just "i love" + "dick", fuck this dumb shit"
4.) with that last point you'll be thankful and more appreciative for every other language you learn because most higher level languages (in my opinion) have more features and are therefore more convenient
>>62443945
It's a lot like java, but has more features like delegates which make you copypaste stupid patterns less. It also is less restrictive about exception handling, it won't force you to copypaste stupid placeholders for catching exceptions you know will never occur. .NET's API is also more consistent and less buggy, the syntax has more sugar too (Lately Java started to get same features present in C# but it lags behind 4 years or so). C# also allows easy use of references and non-managed memory, tools for marshaling, etc. It's easy to wrap C++ code with C++/CLI and use it from C# projects too.
The main problem is microsoft. It sucks. It's actually quite surprising they managed to make such a good language. They also tend to kill of their projects like they did with silverlight or windows forms. I don't know if WPF is still alive but I guess it's about time it gets deprecated as well. Apparently nowadays C# is only used by web developers for ASP/.NET and students.
>>62443822
Because C declarations are fucked up and that really is how it is parsed?
>>62444135
Java 8 was three years ago senpai, you can end your ignorance now.
>>62444171
So you can't actually use int* foo in C?
>>62443346
This is the new retard thread?
>>62444250int* foo, bar;
This doesn't do what you think it does.
>>62444275
So you mean foo isn't a pointer and bar isn't in integer?
>>62444285
his point is that the * couples to foo rather than to the type
>>62444318
and by usingtype* var;
instead oftype *var;
you're alluding to it being otherwise
>>62444188
Oh so maybe in 3 more years we'll finally see optional arguments in Java 10.
>>62444338
Why are you arguing with someone who agrees with you?
>>62444383
You have overloads, make your own.
>>62444275
Oh right, that's why I never use commas in declarations.
I wonder if this nonsense ever gets fixed. Probably not. Most likely.
>>62439846
>caring about niggers
Go stone a faggot, Muhammad
>>62444423
C has some really shitty design decisions, it's telling that no language since has repeated these blunders.
>>62444446
C++ did though. STL is quite fucked up too.
>>62444551
C++ did because it wanted moderate source level compatibility with C. New languages without such requirements e.g. D drop it, because it stinks.
>>62438243
Both, then outgrow them towards something that isn't an anachronism.
>>62438243
Learn MATLAB if you don't want to be a code monkey.
>>62444825
Are you implying OP is a millionaire, again?
>>62438781
>>62438807
Turns out C was the pajeet language all along.
>>62444273
Well you're posting in it so apparently so
>>62438243
C first
>>62445987
C++ first
>>62442387
>learn the basic syntax in one year
Brainlet please, all the syntax takes max one month to learn.
Also cpp code is less cryptic than c when done well
>>62446461
>c when done well
Regardless, it is surprisingly hard to find good C code.
im 26 and want to learn how to pg roam what should learn first
>>62438243
C++ is a solid programming foundation, once you understand programming fundamentals trough C++ you can easily switch to other simplified / abstract computer languages later on.
If time is a concern, learn python / java / c# - but trough professional guides, books that cover principles / computer science.
I want to make bideo game.
I'm currently trying to learn c++ from cpp.com
>>62446821
>C++ is a solid programming foundation
>this is what sepples monkeys actually believe
>99 replies about dead, obsolete, ancient languages
Just learn Rust. End of story.
>>>/pol/
>>>/pol/>>>/pol/>>>/pol/
>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/>>>/pol/
>>62448109
are you ok?
>>62439504
The worst part is I can see this becoming an actual high level language some day
>>62438243
Learn how to write large code bases in C first. With this you'll learn how to manage complexity and develop taste which is more important than anything else.
C++ is a cluster fuck of "not-managing-complexity". If lawyers and mathematicians wrote a language then it would be C++ so just stay away.
Instead learn C# up to v4 and earn money, it's okay but it is starting to deteriorate.
If I had 20 years to start over I'd learn SPARK (ADA subset), it's the only respectable language.
>>62439777
You're an unfunny dated maymay.
>>62448298
trumps existence has literally destroyed some peoples brains
>>62438449
Is this some kind of stupid contest?
Any valid C code IS a valid C++ code too.
>>62442177
>C and C++ are old and obsolete
anon you're not supposed to talk if you don't know what you're talking about
>Rust replaces them
oh i see this is bait
>>62443822
Because *foo is an int. It makes sense when you think about it that way.
I usually do int* foo because that's what I'm used to, but I do see the justification of int *foo.
>>62450770
Keep up or get left behind.
>>62438243
JavaScript ES6+
>>62451986
>work at a company that's been using C and C++ for over 30 years
>"you'll get left behind"
ok
C
C++
>>62452094
kys but unironically
>>62438286
>>62438351
I dont think its deprecated either but there is many more opportunities programming in C++ than in C, specially if you want to find a job famalam. (And if you're good at C++, and I mean GOOD, you most likely won't have that many problems when going to the C world)
>>62450715
>>62452094
>JavaScript ES6+
ftfy
>>62438243
learn C++, it's C on steroids but modernized and more in tune with common application and game development.
Also throw some Python in there.