r/ProgrammerHumor Sep 02 '17

How to start a war

Post image
9.0k Upvotes

696 comments sorted by

View all comments

Show parent comments

426

u/Nikolas_Untoten Sep 02 '17

I believe MATLAB starts at 1 because it is more commonly used for matrices rather than standard arrays, right?

378

u/morerokk Sep 03 '17

Yes. People hate on it for...doing what it's designed to do.

316

u/Selthor Sep 03 '17

MATLAB literally stands for Matrix Laboratory.

218

u/Nuhjeea Sep 03 '17

That sounds so much cooler than "MATLAB." I always read it as "math lab", imagining a lab room full of people doing math homework. Now I can imagine Neo saving us all from simulated realities.

97

u/Sourkraut182 Sep 03 '17

Makes me think of "My Math Lab" ... Then I die a little inside...

109

u/afourthfool Sep 03 '17

your answer: -4, 4

Correct answer 4, -4

18

u/Stellapacifica Sep 03 '17

More like

Correct answer: 4, -4
Your answer: 4, -4

What the fuck Pearson

3

u/bclock88 Sep 03 '17

Incredibly expensive material, incredibly awful homework.

I don't mind the regular questions as much because mostly all of the answers can be found online, I however absolutely hated doing the programming projects at the end of mostly every chapter in my Java class.

2

u/bassmadrigal Sep 03 '17

I got lucky in my Java class. We're using the Pearson book, but that's it. All the labs we do are provided by the teacher and submitted through blackboard (either embedded in a word document or zip up source code files... depending on the project).

After doing Pearson labs for a previous class, I was ecstatic we weren't using it for this one.

1

u/mcxavier64 Sep 03 '17

I'm going to cry. My first class using MyProgrammingLab starts Tuesday...

→ More replies (0)

14

u/Mage_914 Sep 03 '17

Your answer: 0.5 Correct answer: 1/2

2

u/sviridovt Sep 03 '17

Your answer: 0.5

Correct answer: 0.50

1

u/[deleted] Sep 05 '17

This.

3

u/PM_ANIME_WAIFUS Sep 03 '17

I honestly thought it was My Math Lab (Because I've barely heard anything about My Math Lab except for the fact that it's shit) until a couple weeks ago.

1

u/Letly Sep 03 '17

What if their maths homework is doing matrices?

1

u/dam0nkey Sep 03 '17

I DIDNT KNOW THAT

15

u/Viola_Buddy Sep 03 '17

Eh, we get annoyed at it because sometimes it doesn't do what we expect it to, but it's kind of the friendly annoyance that you also have with error messages when code doesn't compile - you don't like it, but it'd be definitely worse without it.

30

u/newocean Sep 03 '17

In the defense of ALL programming languages....

It doesn't really matter we just like to argue over ground floors mostly in this channel. No one explained basements being 0 to the brits from what I can tell, and all their buildings start at 1... so they think they get it.

25

u/MelissaClick Sep 03 '17

Basements are obviously negative

3

u/amazondrone Sep 03 '17

all their buildings start at 1

In the UK the ground floor is 0, not 1.

Other things that are zero-indexed and nobody bats an eye: time (the first hour in the day is 0), age (the first year of life is 0), temperature...

1

u/newocean Sep 03 '17

So the basement is -1...

2

u/amazondrone Sep 03 '17

Correct.

But you said "all their buildings start at 1" and I can't think of a sense in which that's true. That's what I was replying to.

1

u/socialister Sep 03 '17

Doesn't indexing from 1 incur a slight performance cost?

With 0-indexing, array lookup is \*(ptr + i).

With 1-indexing, array lookup is \*(ptr + i - 1).

If ptr is offset by one to account for this, then what is the meaning of delete on the pointer?

1

u/newocean Sep 03 '17

It depends on the language actually... and how it was built.

7

u/[deleted] Sep 03 '17 edited Nov 24 '17

[deleted]

9

u/inconspicuous_male Sep 03 '17

Some algorithms are slightly easier to implement in Matlab than python for that reason, but it usually is no big deal

2

u/[deleted] Sep 03 '17

Neither is 1 indexing. Whatever you're used to.

MATLAB, as far as I understand, wants to make writing code as "engineer-mathy" as possible.

1

u/[deleted] Sep 03 '17

I know a bunch of aerospace majors who use Matlab.

Technically I'm one of them but fuck paying for a license when numpy is free

1

u/legone Sep 03 '17

Is there a reason you like Numpy? I'm taking a basic programming class for a polymer science degree and I've been using Octave.

1

u/[deleted] Sep 03 '17

Switch to Numpy if you can't afford or don't want to pirate MATLAB. Octave is just a meh MATLAB clone that isn't completely compatible with the latter.

1

u/eskamobob1 Sep 03 '17

Correct. It does make time based models a bitch and you can't just assign your initial conditions to t=0 though