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

Why do STEM majors, not related to computer science, need to

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: 36
Thread images: 9

File: 1438710121630.png (889KB, 756x715px) Image search: [Google]
1438710121630.png
889KB, 756x715px
Why do STEM majors, not related to computer science, need to learn programming? I had to take a programming course based on C++, why?
>>
>>7731682
Because a lot of sciency stuff is made of boring and repetitive tasks that can be more easily and efficiently accomplished by a computer program. Also, simulations.
Anyway programming is damn easy, I don't know why someone would complain about that.
>>
Physics requires to make simulations for experiments and models n shit
>>
>>7731682
so everyone can switch to the computer science master race whenever they realize they're taking shit degrees
>>
do not be angry that you had to take a programming course

be angry that it was C++
>>
All you need is matlab
>>
>>7731703
You could be one of two type of persons.

If you are the kind of person who would say that it is better to teach python or some other shit codemonkey language then you are shit. You have no soul and no sense of pride for your work. Just make it fast and fuck everything else. C++ is inherently superior to any other programming language and to be able to be superior it has to be more complex.

But if you are the kind of person who thinks that instead of C++ they should teach C then I would partially agree with you. There is no problem with C because personally when I program C++ I program like it was C but I use the extra libraries and containers to make my life easier.
>>
Why do STEM majors, not related to physics, need to learn physics? I had to take a physics course based on calculus, why?
>>
Matlab ain't free.
>>
had c++ on aerospace engineering too. didn't mind it though, came in handy some time later
>>
>>7731682
>Why do STEM majors, not related to computer science, need to learn programming?

Programming is a basic tool of all technical fields. You need to know how to do some programming just like you need to know how to read (even though you aren't a literature major! omg!).
>>
>>7731797
i'm say that his first course in programming should not be a stupidly complicated object oriented bastardization of an actually good language and a horrible introduction to the object oriented paradigm
also i think going to college to learn python is retarded

this also brings up the question of what major OP is
>>
I'm a computer science major. What I want to know is, how does one c++ (sometimes two) teach non CS majors how to program?

Surely you can't make simulations after an intro to programming class. All you learn is loops, data types, basic shit. Wtf?
>>
File: 7542357934.jpg (52KB, 554x527px) Image search: [Google]
7542357934.jpg
52KB, 554x527px
fucking shit
i had to take a bunch of humanities courses to complete my MATH degree
i would have a perfect fucking 4.0 if not for those fucking classes
and you are complaining about programming, a skill that is actually useful even in non-STEM fields
if i ever see you i'm gonna slap your shit
>>
File: 1450560576018.png (523KB, 756x715px) Image search: [Google]
1450560576018.png
523KB, 756x715px
>>7731682
I could not help but notice your png was not optimized anon.
I have optimized your png.
Your png is now optimized.
>>
>>7731924
fucking this

Courses like "The interaction between computer and humans" and "Business administration" are killing my gpa in comp sci.

Garbage courses. I guess that im just in a garbage uni then... ;/
>>
File: 1450574748340.png (20KB, 756x715px) Image search: [Google]
1450574748340.png
20KB, 756x715px
>>7732096
II culdnt ta halp but nitoce ur png av vas not upasotimatset anion. i haf optimest your pgn. ur pgna is niw otspmesd
>>
>>7732121
I think you're garbage if you can't bullshit your way through those courses
>>
>>7732127
>still using lossless PNG compression
>not saving another 9 KB
>>
File: 1450576240328.png (15KB, 756x715px) Image search: [Google]
1450576240328.png
15KB, 756x715px
>>7732127
I could not help but notice your png was not optimized anon.
I have optimized your png.
Your png is now optimized.
>>
>>7732335
BASED
>>
File: image.png (30KB, 756x715px) Image search: [Google]
image.png
30KB, 756x715px
>>7732335
um is this a bot?
>>
File: image.png (25KB, 756x715px) Image search: [Google]
image.png
25KB, 756x715px
>>7732335
lets see
>>
File: popo.png (8KB, 756x716px) Image search: [Google]
popo.png
8KB, 756x716px
>>7732335
I culddanutz halp bt notiz ur are png is not optmused anus. I havoptimuszed u are pong. ur are pong is new optimuzed.
>>
>>7731703
this lol
>>
>>7731797
Isn't the lack of classes in C a major limitation? I don't even know how they kept data organized in complex programs before they introduced classes.
>>
>>7731883
Well it probably depends on what exactly the simulations entail. I'd imagine for the most part basic programming is enough if you know the proper equations your simulation is based on.
>>
>>7732483
Structs and pointers my friend.

With structs and pointers you can do everything you can with classes and some would say that it is more elegant.

However, in reality there is no performance difference between classes and structs in C++ so it is more of a choice. But I will tell you, if you come from a Java background of all OOP and starting programming in C++ you will soon find it liberating that you are not limited by OOP and can actually have creative freedom with your code.

In other words: not everything needs a class of its own.
>>
>>7731682

Because being able to program is very useful for many, many other professions. Why do things by hand when you can automate them? Not to mention that many other majors (engineering(especially stuff like EE,CE), physics, etc) actually require programming. You also have to remember that computer science isn't about programming - you're thinking about software engineering. Thinking algorithmically is also a useful thing to have.


>>7732494
>>7732483

Classes aren't the thing that makes C++ more powerful than C, it's all the other stuff.

However, classes and runtime polymorphism via virtual functions/inheritance does have its uses, like when you have a heterogeneous collection you need to iterate over, where you can't just use compile-time polymorphism via templates. You can kind of do that in C by implementing the vtable yourself via function pointers, but, why?

IMO the biggest thing that I find annoying about C that is in C++ is RAII. It reduces code complexity significantly while simultaneously making it safer, all while being better on performance than a solution like garbage collection (which only tackles the issue when the resource is memory - and plus it's non-deterministic about when shit is getting collected, which can potentially be an issue).

>However, in reality there is no performance difference between classes and structs in C++

There's literally no difference between them besides the default access specifier/inheritance specifier (private inheritance/access for class by default, public for struct), other than the fact that when you forward-declare things they must match up with the actual definition. They really should've just had one keyword instead of two.
>>
>>7732483
>Isn't the lack of classes in C a major limitation?
Yes. There is a reason C only sees modest use in general purpose computing these days, and this is it. It doesn't restrict what you can do with the language, but it does very seriously restrict what is convenient to do with it; in these cases, languages that do include classes and related functionality are simply more convenient.

>I don't even know how they kept data organized in complex programs before they introduced classes.
Classes aren't really used to keep data organized in memory. That is to say, they are used that way, but that part is no different from using structs, which C does have.

Classes are used primarily to organize *code* in a way that human beings (that is to say, programmers) can still understand it. As programs get more complex, there comes a point where you simply can't understand it anymore as a programmer, and thus can't develop it further or fix problems in it; or at least, not without tons of work and introducing tons of bugs and other stupid mistakes along the way. Obviously, this is a continuous scale, not a hard cutoff. Classes are one major technique (among many) for reducing the complexity of the code, allowing you to write more complex programs while still being understandable. The fact that C does not have classes (and several related features) makes it impractical for sufficiently complex programs.

(continued)
>>
>>7732525
(continued)

Of course, not all programs are complex enough that classes are effectively a necessity; and moreover, as programmer skill grows, so does their tolerance of complexity. Nonetheless, for most general-purpose software (desktop programs, web applications, mobile apps) is a silly idea; you may be able to get away with it, but it will seriously complicate things for no good reason. There are exceptions, but they are (wait for it) exceptions.
This does not hold, however, for many other kinds of software. Much of the software that runs on embedded systems (say, the software that runs the controller for your washing machine) is both simple enough that C is a fine choice, and resource-constrained enough that using it over more powerful languages is a worthy tradeoff. Much numeric software -- which includes a lot of the stuff typically written in non-CS STEM applications, such as physical simulations -- can also be written in C perfectly well without significant problems.
>>
>>7732526
Nonetheless, for most general-purpose software, *using C* is a silly idea. Derp.
>>
>>7731804
Cause a real education is not trade school. You need to have broad knowledge, otherwise you're just a shitter who can't comment on anything except your own field.
>>
File: wasa_the_following.jpg (141KB, 1280x720px) Image search: [Google]
wasa_the_following.jpg
141KB, 1280x720px
>>7731682
Because numerical skills are valuable both in academia and in industry. Unless you're in math or some fringe-ass field of physics you're gonna have to use some sort of programming language to make some pictures.
>>
>>7732525
>Classes aren't really used to keep data organized in memory. That is to say, they are used that way, but that part is no different from using structs, which C does have.
In C++, isn't the only difference between a struct or class that they have different default access modifiers? Is there really anything that you can do with a C++ class that you can't do with a C struct?
>>
>>7732537
>In C++, isn't the only difference between a struct or class that they have different default access modifiers?
Yes, but that's because a C++ struct is a quite different thing than a C struct. That is to say, everything that C++ classes can do, C++ structs can also do, for convenience; but C structs are a far more primitive thing. Colloquially, the word "struct" is usually used to refer to the thing C has, and "class" to the thing C++ has, even though this isn't strictly speaking correct.

>Is there really anything that you can do with a C++ class that you can't do with a C struct?
Absolutely. The key magic that classes can do, and structs can't, is constructors and destructors; functions that get called when a variable of the class is created or destroyed. This allows you do define objects that do their own bookkeeping and clean up after themselves, making it far less likely that you mess it up somewhere in one of the myriad of possible ways.
Other things you can do with classes but not (C) structs include member functions; access modifiers; and operator overloading. These features help you define objects that more seamlessly function like a self-contained whole, reducing opportunities for messing things up and making code using these objects easier to understand. But these are ultimately more minor additions, not as important as the constructors/destructors.

Together, all these features enable you to make objects that take care of themselves, without the calling code having to be very careful to use them properly. This is something C structs cannot do, it's an organization in memory and very little else.
Thread posts: 36
Thread images: 9


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