Why do programmers use this fucking cryptic-ass bullshit language?

Why do programmers use this fucking cryptic-ass bullshit language?

I have absolutely no fucking clue where to start on this big O notation nonsense, and I'm going to fail the class and waste another goddamn $700 because my stupid as shit university wants to make physics majors take a fucking computer science class.

I have no interest in programming, I've never had any interest in programming, I never will have any interest in programming. Fuck this bullshit.

This is some seriously basic shit. ...how can you not understand this? It even explains it below

If only there was some sort of system if interconnected computers, where information could be shared, and that system would be searchable so information could be retrieved about all sorts of topics.

Oh well, op is a fag I guess.

Basically, the "for (i = 0; i < 100; i++)"
says: as long as i is less than 100, do this thing:
{}
then it adds 1 (i++ is the short form of "i = i+1)
then it loops it again, it's called a for-loop

What part are you having issues with? If you understand basic algebra, then thete is nothing complicated about this...

I don't even fucking know!

I'm in Calc 2 right now with an A, but when I look at this shit it's like I have dyslexia or something.

>i'm too lazy to learn
>everyone should use visual basic
>waaaaaaa

fucking typical liberal

Or you know, this example is practically pseudo code...

I don't know what to tell you...

If you understand functions from algebra, then you pretty much should get functional programming. That example is nothing but a loop that runs 100 times and two outside functions foo are executed and results are added to sum. Doesn't even matter what foo1 and foo3 do, frankly. Doesn't even matter what those functions do.

Wait until you see undocumented C++, KOBOL, Haskell or the ever majestic Brainfuck language.

You literally cannot be a physicist in 2016 without knowledge of programming...
Source: I'm a physicist.

Big O notation identifies the growth rate in basic operations of an algorithm as a function of it's input length, discarding slight increases like scalar factors and summands that grow more slowly. It states that a (mathematical) function grows in complexity no faster than the function inside it. It's a way of roughly comparing and composing the efficiency of different algorithms on an abstract level without having to implement and measure them. It actually has a much more complemented definition rooted in abstract algebra, but you don't need those details to use it anymore than you need to know the topology underpinnings of calculus to use it's identities. Programming languages vary by their purposes. There are some more similar to natural language. But C inparticular is meant to be a compromise between the way common computer hardware actually works and high level abstractions usable by human mathematicians and engineers. It's way more practical than assembly code for anything more complex than a small driver. I'm not sure why it's being used to illustrate a discreet mathematics concept here. Perhaps you'll be using it to write things later in the course.

No one uses Brainfuck for serious enterprise software, though. There's a lot of shit written in KOBOL still running out there.

It adds 1 to the value of i
It checks if i is less than 100
If that's true it runs again until i is greater than 100

What do physicists even do? Run simulations all day and write papers wanking about it?

While its curious that they want you to take actual computer science and not just scripting/applications, a physics major should be able to handle that no problem.

Your bitching about programming is irrelevant, because that is not programming. The class a physics program would normally want you to take would be programming. That is computer science, and it is just math.

I got a BS in physics, a zillion years ago (I'm an oldfag).

If you're doing science, your bitchass better get used to programming. Biology? Welcome to R. Bioinformatics? A lot of specific Perl packages (but Python is growing).

Physics? I don't know what's current, but Matlab, there's huge amounts of proven and time-tested FORTRAN libraries out there with decades of work behind them, and so forth.

Better get used to it.

There are experimental physicists (particle, solid state, quantum), theoretical physicists (cosmology, branes), and physicists in industry (semiconductor tech, medical tech, nuclear tech, etc).

Lots of shit for physicists to do.

This. Computers weren't invented for games and facebook. They are tools for doing math. And the ones who need the most flexible mathematical tools are scientists.

Science part:
25% Simulations, 60% experimental work and 15% theoretical work.

But the science part for a professor is maybe around 50%, the rest i bureaucracy. PhD's, postdocs do 80% of the work.

Also wanking.

That could just as easily be Java.

Funny thing is, almost all those things still require writing and running simulations on an almost daily basis.

Unless you're a theoretical/mathematical physicist, everything you do will involve programming.

Simulations are how equations are typically calculated these days - i.e, you program the equations into your simulation, and run it a billion times to see what happens at several points over a course of time.

Even with experimental physics, you'll have simulations to predict what's going to happen in your experiment, and all data analysis is handled through programming.

This.

My friends in atmospheric and planetary science spend all day on FORTRAN models.

1. Not inside and classes.
2. No public/private modifiers.
Might be C++ though.

Experimental physicists will also have a huge and complicated setup that needs to be controlled and the data needs to be recorded and analysed.

I worked in a BEC lab. The control system alone was easily 200.000 lines of code.

I was presented with more complex concepts than this when I was a junior in high school

I was too, but my school sucked butt, so I had to take classes at a nearby community college to get it.

dude just remember the hierarchy of the O-notations. Its easy as fuck 90% of the time the answer to those questions it's the highest of the individual parts and done

I'm not even a programmer and I understand this shit.

Why the fuck would you major in physics? There are no jobs for that.

What exactly do you plan on doing if you're getting a physics degree and don't want to do programming? Do you seriously expect to do your work with pen and paper and not get left in the fucking dust by 14 year old Pajeet running Matlab?

Big O is somewhat like finding dominant terms in limits. O(n) approaches infinity faster than O(log(n)), so for very large n the O(log(n)) term is insignificant. The for loop is self explanatory, and if you dont know what it does and cant figure it out youre beyond help. Multiplying or adding a constant does nothing, because its constant and for very large n multiplying by or adding constants is insignificant. If all of the terms are constants, then it doesnt matter how large those constants are, runtime is a constant O(1).

Like i said, just substitute in your mind big O with dominant tems in limits (and a couple of special cases that are a bit different).

I spent my first two years as a physics major at my university. I decided I wanted something with more application, so I switched to chemical engineering and I really like it. It's kind of the perfect mix of physics, chemistry, and engineering; you get good use out of each field without going full autism into any one area.

You will still have to do some programming, but if you get into control systems (many, many ChmE do this) then it is much more symbolic rather than writing obscure code. Although, you still need to be able to write equations in a format which a computer can understand, and understand yourself how a computer stores information.

OP in a nutshell
>studies housebuilding
>"I don't want to use hammer!"
>"I will never use a hammer!"

Welcome to the life where every mov you make matters.

Let's get you started:

.data
.balign 4
msg: .ascii "asm\n"
.text
.globl _start:
_start:
push {lr, r7}
mov r0, #1
mov r1, msgaddr
mov r2, 4
mov r7, #4
svc #0
pop {lr, r7}
mov r0, #0
svc #0

Enjoy division as it's not defined for you

>division is not defined
>doesn't define it himself
Newbie

>C/Java
>Complicated

push {r4,lr}
mov r2, #0
mov r3, #0
mov r4, #32
b .loopc
.loop:
movs r0, r0, lsl #1
adc r3, r3, r3
cmp r3, r1
subhs r3, r3, r1
adc r2, r2, r2
.loopc:
subs r4, r4, #1
bpl .loop
pop {r4,lr}
bx lr

It's COBOL you degenerates.

Doesn't get that the point of the assignment isn't how a loop works, but one on Big O.

Isn't cut out for Physics if he can't do simple programming.

That some of the most basic code ive ever seen. Good luck you're going to need it.

but haskell is easy... and the lens library makes it look like C.

C until more code can be seen

If you can't handle this easy shit then you're not going to be able to handle any difficult classwork even if it's not programing.

>why do programmers use this cryptic language
Why does everyone speak English in America? Because it was populated by people who spoke English, most of computing in terms of operating systems and academia was done in C, therefore everything looks like it.

>Can't tell where big O starts

You don't actually need to know that, just need to know what the biggest big O is of the two functions there, because your loop is a constant which gets factored out of big O

Forth, lisp, ml, ect... oh and asm...
most OSes are written in C/C++ but for other fields we have other languages in use

>lisp less confusing than C
are you fucking kidding me?

Java and C++ (not counting COBOL because no one should be teaching that shitty language) are the most popular languages, python is more popular with engineers and scientist but those classes are tailored towards CompSci students so you're going to get C++ or Java unless they are trying to get rid of the shitty students quickly then it will be a dialect of lisp

Lisp takes 2 min to learn and is much simpler than C... also we need a filter as todays cs is shit.

Even forth is simpler and easier to learn than asm macro sugar language (C)

You're obviously a retard or a troll so don't really see the point in arguing anymore

Nither, I'm currently teaching myself programming and i do not agree that C is any easier.

So far i've picked up C, Scheme, CL, Haskell, Forth, Python, Lua, ect... and currently working on ARM asm. C takes a lot longer to teach than lisp (what i gathered from teaching a few classes) and is a lot harder to get your head around.

Forth was best for pointers (so far) and lisp proved better for data structures, algorithms, ect... C was just a pain.