C++ vs C#

Which is a better language and in what ways? Which one is worth my time?

why not both?

>C++ vs non-portable Microsoft's rebranded Java
You tell me

it's easy to do both, learned C++ in high school, C# was a walk in the park afterwards

Any imperative language that isnt C is a waste of time. If you need a HLL, theres Lisps and Haskell.

Why do you insist on making life hard for yourself?

CONFUSION
[spoiler]if you already know java skip C#, the sintaks is very alike. Instead go to C++ and have fun with the memory[/spoiler]

C# is very much like Java, a verbose restrictive object oriented language designed so that mid level managers to be able to understand that the programmers underneath them are doing more easily. It's very popular in industry and highly employable.

C++ is a frankenstein language with a million different features and possible paradigms, that's faster & more efficient than C# and popular for systems programming, games and high performance applications. It's by far the better and more powerful language (if you can get a handle on it), but less employable and even if you do manage to properly understand it, finding other people to work with who are on your level will be difficult.

How is using a superior language making my life hard?

[spoiler]BLISS is the superior Portable Assembly[/spoiler]

Because the problems with it are largely cultural (there are few C++ programmers and those who exist are often not trained properly).

If you can do something in C++ with modern features, you should be doing it in another language. performance critical parts can be done in C.

Why C? It's just more horrible C++. If anything you should do the performance critical parts in C++ and do the rest in another language.

And if you're already doing the performance critical parts in C++, you might as well do the rest of it in C++ to save yourself writing endless fucking wrappers, trying to manage two or more language environments for no bloody reason, etc.

How is C bad? Are you a brainlet, user?

Anything involving vectors, matrices, big ints or other unusual math types (i.e. a significant proportion of what you need a high performance language for nowadays) is horrible because there's no operator overloading.

No generics. (No, that C11 preprocessor shit doesn't count).

No namespaces.

No exceptions. (I like exceptions, sue me).

No auto code generation (RAII, copy/move operators, etc.) to speak of, wasting enormous amounts of time managing memory and god forbid you ever mess it up.

No ability to use less horrible paradigms when you want to write something performance non-critical.

The world's most barren standard library.

But moreso, what has it got over C++? You can write the exact same code in C++ and it will be just as fast, except when you want to read in text from the user you don't have to personally allocate/reallocate/deallocate a buffer to store it in because there's actual code generation and a standard library with things in it.

>thinks knowing the syntax means learning the language
oh boi

>there are few C++ programmers
>Taught in every decent hs
>heavily used in gayming industry
>3rd place after c in every popularity ranking ever
Classic delusional Sup Forums brainlet

java/c# if you want a job,c++ is 'lower level' , not recommended if you're a brainlet but it's worth it.

Nothing in that post is good. Try again.

If your programming past c89, you are not programming C

You can do better than that.

> Unironically making a comparison between C and C++

wtf

>Taught in every decent hs
In high school? In what fanciful world is that happening?

In my experience C++ is taught in all universities, but it tends to be C++03 or perhaps C++11 if you're lucky, with the emphasis being on teaching memory management concepts, leaving the vast majority of people who learn it with completely the wrong impression of what the language is and how it should be used.

Templates (which are NOT Generics) in C++ are absolute trash.

All data types you mentioned are easily used in C.

Namespaces are mostly pointless.

Exceptions ARE pointless, and quite harmful

Code "generation" (whatever that means) doesnt exist in C++ beyond templates.

RAII along with C++ safe memory things are normally worse than just using a GC. Manual memory management isnt hard.

What other paradigm does C++ support? It does nothing well.

What does C have over C++? Sanity.

It's a tiny language and inexpressive that still manages to be inconsistent in its semantics.
Not that it makes C++ any good.

U learned c++ in hs? Shit we learned vb6.0 lel

>inb4 "cant have mixed code and declarations"
good for you

Im advocating using Lisp or Haskell over C++. This user seems hell bent on C++ everything

>No exceptions. (I like exceptions, sue me).
monadic error handling is superior to all

I'm not going to respond to most of that because it's just "Wahhh I don't like that, take it away so I can't possibly be tempted to use it."

But this:
>Manual memory management isnt hard.
Literally every second vulnerability of the last decade would like a word with you.

those aren't issues with memory management, but memory safety. There is a difference.

c# is better a million times.c++ only worth learning if you want to die early of stress and if you literally want to take your hands and physcically rip your balls off.learn c# if you are not a lincuck,learn java if you are.just stay away from that abomination of a monkeyshit that c++ is.

When you force people to remember to type out every single facet of memory management, eventually somebody is going to fuck it up. In reality this translates to "near constantly".

anything other than assembly and machine code is pajeet tier

Did you forget my first post? I clearly advocated HASKELL and LISP. This isnt about "I cant us it" its about "it shouldnt be in a low level language"

If you, also, look at the programs were these vulns were discovered you will discover something very frightening. They ALL were large, baroque peices of shit that were much, MUCH too large.

You can't write fast programs in Haskell or Lisp. Your problem appears to be that you're using C++ for a purpose it wasn't designed for.

You can write extremely fast programs in both languages. C++ shouldnt be used for anything.

I know you're advocating Haskell and Lisp, I have no problem with that.
What I don't understand is your insistence that it should be backed up by high performance code written in a language that is needlessly difficult to use, seemingly because putting .cpp on the end of your files would summon an insatiable urge within you to make everything a variadic virtual class template that uses shared_ptr for memory management and overloads the comma operator.

My bad , maybe I shouldn't speak for everybody.
In eastern Europe back then it was taught pseudocode,pascal,c,cpp . Ofc only basic stuff , I had a bad teacher so I wouldn't know. We also had 'cs' classes in 'middle school' but I never attended one. This also happens in India.

Either way my point still stands , 'there are a few cpp programmers' is bs

Because the compiler needs to support those features whether you use them or not. That, and they are all pointless to use in the first place.

This is the same arguments Haskellers get in about things like Typeclasses and the existance of certain extensions.

C with added C++ when convenient is the only answer.

functional autists have a deep need to use every obscure language feature all the time because they like to feel smart. Then they blame the language when it bites them in the ass.

What is this art? Looks similar style to 20th Century Schizoid Man

What is mono?

Found the non-FP'r

The opposite is true. The less there is in the language, the better.

That's the stance of a Lisplet, not an FPer.

>Because the compiler needs to support those features whether you use them or not.
Why do I care? I'm not writing the thing. This has got to be the first time I've ever heard somebody say "You shouldn't use a piece of software because it was difficult to make". (And don't pull that crap of "Oh how will we port it to new platforms", using LLVM removes the need to worry about language features when doing that).

>they are all pointless to use in the first place.
>doing anything less time consuming than reading in a string from the user through manual buffer allocation/reallocation/deallocation is pointless
>not having to dot your i's and cross your t's with 100% accuracy to avoid having security vulnerabilities is pointless
You're either a troll or you like busy work.

bait

Nani??? Haskell is just syntactic sugar over system FC, a trivial extension of system f.

C# is more uniform and future proof. C++ is just versatile and battle-hardened.

C++ is complicated, and not that language that you choose for your amusement. It's more a necessity when you're doing professional work, during an internship or something, or maybe because you're self-taught in gamedesign, which is also increasingly common.

>not that language that you choose for your amusement
>he doesn't program in C++ for fun

>C# is more uniform
Lol

LLVM is a complete shit hole. It is actively harmful.

If a user cannot fully grok the language/program/idea in its entirity to the point of being able to implement it themself, it is bad.

No ifs ands or butts. Anything violating this principal is harmful and should not be used.

>Magic compiler making machine is banned
>Complex software is banned
Every time you open your mouth the world you live in gets more and more obtuse and miserable.

unless you can mathematically prove it, thats why FP exists

Shit

I never said complex software was banned. I said software that cannot be understood by a single person is harmful. They are very different statements

To master C# is way harder and more complicated that C++.

Fpbp. Only brainlets and pajeets can't learn more than 1 language at a time

Lmao. No.

Have you seen the newest c++ standard?

Compare Ken's compilers to gcc or clang. Ken's are superior.

C++17 doesn't have any of the good shit like modules or concepts. C++ hasn't changed much since C++11

You can't fool me, Andross!

C++17 is still a draft, so is c++20.

C++ is kind of a ragged language, which is troublesome in terms of code conventions. There are too many ways to write the same code.

C# on the other hand is encumbered with a huge library to do the work for you, blurring the relation between machine and programmer. Often it seems that you're doing it right, meanwhile there is a platform-specific quirk (like BitConverter) and you're doing it all wrong.

C++ or Java. C# is garbage.

C# running inside your C++ program, so you can keep the speed and keep the pajeet out of the important code.

That's the fun part

not him but actually id be interested in reading the original compilers, where can i find them?

The ones I am refering to are a part of plan9. I do not know where to find the original C compiler, a google of pcc source should pull.some hints though

C or C#. C++ and Java are garbage

:thinking:

alright, thanks

Infact it's inside that album.

Garbage

C# is a beautiful language, and has fairly elegantly incorporated features from other languages over the years. It's worth learning just to expose yourself to concepts not found in other C-style languages.

But if you ever need to do anything more than extremely simple interop with native code, do yourself a favor and don't waste time fucking with DllImports, unsafe code, and/or trying to appease the marshaller. Just write your interop code in C++ CLR, you can easily mix native C++ and .NET code in the same file and function.

>and has fairly elegantly incorporated features from other languages over the years
Lolno, the only language more haphazard and shortsighted about adding features is sepples

This, Java is the same way
For the longest fucking time I wasnt even taught stringbuilder was a thing, nor list classes
I always implemented that shit myself, the former poorly, the later okay but it had reduced functionality
Lot of other stuff too but those are the ones that jump to mind

>you can easily mix native C++ and .NET code in the same file and function.

shiiiiiiiit isshygddt

Any language pre-C# just werks if you're an insider, but otherwise you're moving in a labyrinth. Hence I wrote earlier, C++ is not a good language for hobbyists, it requires guidance.

In C# just need C# in nutshell book to be productive.

C++ need several books and years practice to be productive, people learn C++ on high school or college code had too many errors.

How else do you plan on converting native structs to something managed...?

You could argue that the addition of some features was reactionary to whatever was cool at the time, but I don't think any of them are haphazard, and they've managed to mostly maintain backwards compatibility (I'm only aware of one really breaking change in how foreach + lambdas worked, and that's because the original behavior was fucking stupid). The only language feature I don't like is LINQ syntax, I greatly prefer the extension methods.

C is fun, bros

Didn't meant to quote you, sorry.

>How else do you plan on converting native structs to something managed...?

Dont.

>How else do you plan on converting native structs to something managed...?

Don't be a chad a just use dllimport, there is nothing wrong with it.

k.

If all you need to do is call a couple of simple functions with basic scalar arguments and maybe an opaque pointer, sure, but not everything is so simple. Sometimes you want to write a convenient wrapper library for some complex native code. If you've ever spent days trying to debug or workaround a corrupted state exception or an attempt to read/write protected memory (courtesy of the marshaller), you'd understand why DllImport isn't always the right approach and why bridging the gap yourself is better.

/thread

imo if you're going to go all the way to C++ just go straight to rust.

C# is heavily OOP and for that I don't really like it, but it is easy and a good way to get a job.