[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
I know java, c#, js/node, scala, some other "high level"
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: 32
Thread images: 3
File: 55846555.jpg (64 KB, 500x375) Image search: [Google]
55846555.jpg
64 KB, 500x375
I know java, c#, js/node, scala, some other "high level" languages and I can find good job no problem

why should I learn c or c++?
>>
>>51970981
The basis for all those languages is C/C++.
>>
If you ever want to work on embedded systems, robotics, write drivers (and other low-level programs), you need to be able to write C.
>>
There are two reasons why:
1. You just want to know.
2. You need them for something.

Otherwise, don't bother. Just don't let the programming police catch you, as the penalty for not knowing C is, of course, death.
>>
>>51970981
You should not.

C# is good enough
>>
>>51971148
Maybe if you plan to be glued to Windows all your software developing life... mono on other platforms sucks ass.

When it comes to writing light, fast, cross-platform applications nothing holds a candle to C and C++.
>>
File: bang.jpg (52 KB, 720x480) Image search: [Google]
bang.jpg
52 KB, 720x480
>>51970997
>C/C++
>>
You cannot possibly know enough about a hard subject to distinguish useful from non-useful until you have learned that subject. It's not neccesary to master it, but you must learn it first.
>>
>>51970981
>memegeneretor.net
End your life
>>
because c++ is easier than java.
in java all your functions must be in a class, but in c++ you don't have to, and you have more choices.
>>
>>51970981
go back to reddit
>>
C++ is much more flexible.
It allows more control over the development cycle which results can result in faster more efficient code.
However, bad c++ programming is much more dangerous than bad c#, since c# doesn't allow mistakes because it holds your hand.
>>
>>51973072
Is there any centralized place that lists all relevant C++ standards? I've looked at different sources, but some show colliding standards.
>>
>>51970981
>tfw learning C++ and Java at the same time
How fucked am I?
>>
>>51973145
Not fucked at all.
>>
>>51970981
Need to write a high-performance module that can literally run on, in, and with everything without requiring a pre-installed run-time or interpreter? C++

Need to write some drivers? C++

What about building a virtual reality or a video game? C++

Trying to build a new interpreted or byte-code compiled programming language? C++

What about a browser? C++

Need a fast web server? C++

Trying to rise above the code monkeys and script jockeys? C++

Trying to learn how a machine actually functions? C++ then C ... then assembly

It's all C++ anon. Everything that's actually worth a shit is written in C++. Yes, EVERYTHING that is responsive, doesn't hitch randomly, runs on multiple platforms etc. etc. etc. is ALL either written directly in or relies upon C or C++. Nothing else comes even remotely close to the performance and relative ease of use of C++ and its no-cost abstractions.
>>
>>51970981
I find C++ more fun to code in.

the low level access lets you if you so desire to work right close to the hardware, do bit manipulation etc.

or you can work at a high level like any other language and not care about the low level stuff thats going on (until you get a really weird bug because you're a shit programmer)
>>
>>51973812
>Need to write a high-performance module that can literally run on, in, and with everything without requiring a pre-installed run-time or interpreter?
C is more widespread.
>Need to write some drivers? C++
Fucking no. C++ features are NOT suitable for drivers. Even Microsoft says to write your drivers in C.
>Trying to build a new interpreted or byte-code compiled programming language?
Most 'popular' language interpreters are in C.
>Need a fast web server?
Most fast web servers are in C. Apache is mixed C and C++ though.
>Trying to learn how a machine actually functions?
C++ won't teach you shit. C won't teach much either, but it makes sense to think of assembly in terms of C. If you want to learn how a CPU actually functions, take an electronics paper that covers CPU design at university.
>>
>>51973898
The thing about C being somehow faster or lighter weight than C++ is an absolute myth.

1. It's 100% possible to match C with C++
2. C++ gives you tools that C does not-- Classes, templates, auto, lambdas, smart pointers, for-each loops, and more. None of them are mandatory, but all of them are useful. C provides none of them. For example, try implementing a generic linked list in C.

C is more widespread for reasons other than which language is more powerful. i.e. C was around first, C has a myth around it being magically faster or smaller, C is simpler (simpler != better).

Writing drivers comes down to safety and memory allocation up front. Both of which can be done better in C++.

There's zero reason to start a new project in C rather than C++. Why? Because C++ provides abstractions (mentioned above) that do not have run-time costs compared to their hand-implemented analogs in C. Furthermore these abstractions are provided by the compiler rather than being home-spun every time (i.e. C's pathetic attempts at providing generic containers).

You keep saying that "most X are written in C..." but this doesn't prove that those projects wouldn't benefit from being implemented in C++. For example, John Carmack has said that moving from C to C++ was an important and beneficial move for id. the Unreal engine has been C++ since before UE3. Unigine and Crytek are both C++. Infernal Engine from TRI (when they still existed) was C++ as well.

C++ will teach you precisely the same things that C will about how a machine functions. The purpose is to learn not just what a transistor or a register are but to learn how those low-level parts are abstracted up to where humans can easily think about, use, and manipulate them.
>>
>>51970981
I just finished my first programming class, which was c++. Is it really that much different than other languages? We ended on calling methods (functions outside of main, whatever, the teacher called them methods), classes and derived classes, and simple pointer usage with strings. My next class is Java, still in community college btw.
>>
>>51974126
theirs a reason all OSes, at least the low level components are written in C and assembly.

C++ is better for general cases, but when you're working directly with the hardware C is better.
>>
>>51974198
I learned all this in 3 days, with a book, at home. Why even wate time at college?
>>
>>51974241
Cuz its free and c++ is required for engineering majors...
>>
>>51974198
Java is awful.

You will find it works much like C++, but everything is an object, to an extreme.

you have int (a primitive type) and Integer (an object) which both hold the same sort of data, but java only like Integer in certain cases among other retardation.


>>51974241
probably since he's in first semester and it was a babies first look at anything programming related.

I remember first year we did java, and the first semester I didn't even show up to class and got an C+, I later marked for the class and the stuff is shit easy, second semester they crank up the heat, the prof threw us in a CLI with just vim and a compiler and told to have fun, lose 50% for poor formatting etc.
>>
>>51974126
>1. It's 100% possible to match C with C++
int *a = malloc(sizeof *a);

int a[] = { [2] = 2 };

void fn(char restrict* a, char restrict* b); /* this is a big one */

and so on
>C is more widespread for reasons other than which language is more powerful
Right, because C++ is ridiculously hard to implement. It's even to the point where parsing C++ is an undecidable problem. C is so widespread because it's easy to implement and even goes out of its way for that.
>C has a myth around it being magically faster
I never claimed it was faster, but there are many C++ features which will make a program slower just by using them.
>simpler != better
In some cases, it really is.
>Writing drivers comes down to safety and memory allocation up front
Drivers are about performance and knowing exactly what is going on with your allocations. Also C++ unstable ABIs pretty much make it completely useless for these sorts of things.
>Because C++ provides abstractions (mentioned above) that do not have run-time costs compared to their hand-implemented analogs in C
There is that fucking magical "free-abstractions fairy" again. LOTS of C++ features have runtime costs. Also not everyone wants abstractions. When it comes to operating systems and other systems programming, you DON'T want abstractions (adding to my point above), which is why C still completely dominates those areas. Even companies like Microsoft who seem against C still use it for their Operating system.
>but this doesn't prove that those projects wouldn't benefit from being implemented in C++
I doubt using C++ would make them any better. It would probably make them worse.
>C++ will teach you precisely the same things that C will about how a machine functions
My point is that both of them will teach you fuck all. Learning C or C++ (or even assembly) isn't going to teach you about pipelines, memory access, cache levels, buses, the CPU's internal state machine etc.
>>
>>51974233
The reason is that all OSes were started between the late seventies or very very early nineties when C++ either didn't exist or had extremely shitty compilers.

By the way, your fallacy is a combination of "correlation == causation" and "majority is always right".

Try again.
>>
>>51974443
or its because C is as >>51974338 said easy to implement.

its easy to write a C compiler on your brand new architecture you just built.

C++ is great for application, but not when you're dealing with low level stuff.
>>
File: 80kek.gif (1 MB, 288x198) Image search: [Google]
80kek.gif
1 MB, 288x198
>>51974259
>c++ is required for engineering majors

Wow, just wow
>>
>>51974586
my school makes them do a babies first cs course to teach them how to use software to help them build shit, ie code a program to do math for you.
>>
>>51974669
>babies first cs
>c++
It just gets better
>>
>>51974586
It makes sense, if you're working with something of a certain size where you need C then C++ is almost certainly a better choice. You can literally use it like C with a better type system (it is) although there are a lot of interesting features you could choose to use beyond that with various trade offs.
>>
Because why the fuck not.

It isn't even hard to understand either. High School students across the world are building functional robots using mainly c++ as their language of choice.

C++ would make you even more of an interesting candidate for a position.
Thread replies: 32
Thread images: 3

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.