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

Personal bias aside. Is there really any point of using C when

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: 24
Thread images: 2

File: 1475981723545.png (220KB, 557x411px)
1475981723545.png
220KB, 557x411px
Personal bias aside. Is there really any point of using C when there is C++ and C#? I really seem to be having trouble comprehending the usage of C when we have debatable superior C derivatives.
>>
Yes, retard.
>>
>>57658486
Optimization and better syntax.
>>
You don't always need classes.
Now C is the lowest of high level languages.
>>
File: 1464409460258.jpg (2MB, 3200x2718px) Image search: [Google]
1464409460258.jpg
2MB, 3200x2718px
HolyC
>>
>>57658486
Speed and the simplicity for learning purposes. That's everything.

>>57658518
You are a retard.
>>
>>57658486
Yes.
Who's this cute girl?
>>
C is good for embedded systems. You can mimic classes with structs and equivalent functions to operate on them without the bloat of C++, although it can be less "safe" depending on the class (for example, accessor/mutators being unnecessary and only written to follow convention).

C# is a good Java alternative for Windows machines. You wouldn't write an operating system in C#, nor would you program an embedded system in C#.

Nearly all embedded systems are programmed in C or assembly; C is easier for the programmer. The computers in your microwave, car, and AC are likely programmed in C. I suspect assembly is uncommon to actually write these days since compilers are so good at optimizations.
>>
>>57658486
reasons to use cpp
>oop
>abstractions
>bulky standard library

reasons not to use cpp
>oop
>abstractions
>bulky standard library
>>
>>57658624
You're not memed into using oop for cpp like Java.
>>
>>57658486
Hello do you have a C++ compiler for 8051? Please.
>>
>>57658539
>You are a retard.
Have a (You), moron.
>>
>>57658486
2 reasons to use C:

It absolutely, positively HAS to run as fast as possible. It's a relatively "simple" language where what you're writing is closer to what the machine is actually doing. This also benefits in that there's a C compiler for practically everything.

You're writing something fairly straightforward, like a microwave control system and there's really no need for anything fancier. Do you really need classes, interfaces, and polymorphism to create a timer that turns on a microwave generator and then goes "ding?"
>>
>>57658596
/thread
>>
>>57658486
You write for a machine directly (embedded), than you use C
You write a simple program that doesn't need all the garbage C++ brings, you use C
>>
>>57658596
pseudo classes work in C++ too
>>
>>57658596
Since about the early 2000s, C with MISRA guidelines is standard for programming microcontrollers in automotive applications.
>>
>>57658901
They are implemented differently under the hood, tho.

C++ is pretty good, but it brings in lots of garbage you dont want on your drivers or an embedded
>>
>>57658486
Ive never really understood people hating on the STL. To me, using arrays is much less safe, memory access wise, than say, vectors. Why would you want to keep track of a separate size variable when you could just let a template class do it for you, and call vect.size(). Not to mention iterators, and sorting. I could understand if you need pure C for a memory/speed critical embedded system, but most people I hear from just write in C for most/all applications because they don't like C++ because of its "bulk." I've never understood why someone would want to make things harder if they dont have to.
>>
>>57659043
Could you provide evidence of that?

Also: you do not pay for what you do not use (except if you are retarded and link against unneeded shit)
>>
>>57659088
Just because you have resources you don't have to waste them
>>
>>57659141
The compiler will optimize most "wasted resourses," in most cases where you wont even notice a difference. Unless you program like a 12yo minecraft hacker, in which case, all bets are off.
>>
C exists on more platforms than C++ and you might want to port your software to those platforms at some point. You might even be using one of those platforms because you're a huge nerd.

C# isn't even comparable. Oh wow, it has C in the name. Might as well compare C to java.

And if you're not programming as an employee it really doesn't fucking matter. It's your time, not your employer's, use emacs lisp, who gives a fuck. Language wars are almost as bad as text editor wars.

PS: vim and emacs are both harmful, use sam
>>
>>57658486
How are C and C++ comparable to C#?
Thread posts: 24
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.