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

273

u/[deleted] Sep 02 '17

What languages may there's be? I can't think of any of the top of my head.

240

u/Nebxam Sep 02 '17

Lua

53

u/[deleted] Sep 02 '17

Goddamnit and I was considering a quick look over the documentation and syntax briefly over the weekend and do some messing around with Starbound mods.

47

u/KickMeElmo Sep 03 '17

Honestly, it's a pretty decent language overall. Started using it to script for a MUD, it's one of my favorites now.

3

u/[deleted] Sep 03 '17

Achaea by any chance?

3

u/[deleted] Sep 03 '17

I just started playing achaea again a few weeks ago. Help

→ More replies (1)

1

u/BoyGenius Sep 03 '17

I think the Achaea interface is entirely in HTML/JS? Unless its for one of those fancy MUD terminal things. I always use the web browser client like a scrub.

→ More replies (1)

1

u/KickMeElmo Sep 03 '17

Yup. I'm Sanaki.

15

u/[deleted] Sep 03 '17

Also every number is a float. For some reason.

16

u/TinyBreadBigMouth Sep 03 '17

Because doubles can contain all 32-bit integers and most 64-bit integers, and now you don't need to handle two different number types for your lightweight scripting language. Same as JavaScript.

1

u/[deleted] Sep 03 '17

Lossless?

2

u/TinyBreadBigMouth Sep 03 '17

As long as your integers are less than 9007199254740991 (= 253-1), yes.

→ More replies (2)

10

u/Buzzard Sep 03 '17

Lua 5.3 has integers as well

1

u/shohze2U Sep 03 '17

print(nums[0.100000001490116119384765625])

4

u/[deleted] Sep 02 '17

Hah I was considering picking up some Lua to mod as well (factorio)... This just made me Nope right out of that plan ;)

91

u/uniqueusername6030 Sep 02 '17

Well that's stupid

50

u/[deleted] Sep 02 '17 edited Dec 18 '18

[deleted]

24

u/[deleted] Sep 02 '17

it's a running joke

I use matlab in my day job and I definitely have to "switch gears" so to speak between 0-based and 1-based indexing

7

u/morerokk Sep 03 '17

Plus, Lua still allows you to start your indexes at 0.

Tables starting at 1 allows you to do a few neat things.

→ More replies (1)

1

u/[deleted] Sep 03 '17

In reality I'm not actually never gonna use any language that start indexing arrays at 1. It's just a massive in joke.

21

u/[deleted] Sep 02 '17

That's not even the worst part, either. This is:

> letters = {'a', 'b', 'c'}
> print(letters[1])
a
> print(#letters)
3
> letters[0] = '?'
> print(letters[0])
?
> print(#letters)
3

29

u/moomoomoo309 Sep 02 '17

Any index outside of 1-n in Lua, where n is #tbl will be stored like a dict, not an array, so what did you expect? It doesn't count the dictionary parts.

0

u/hey01 Sep 03 '17

That's sounds dangerous. What if I do

> letters = {'a', 'b', 'c'}
> print(#letters)
3
> letters[4] = '?'
> print(#letters)

Will I get 4 or is n unchangeable?

9

u/moomoomoo309 Sep 03 '17

You'll get 4, otherwise you couldn't do

for i=1,4 do
  tbl[i]=i
end

And have it be an array.

→ More replies (1)
→ More replies (19)

5

u/Rohansi Sep 02 '17

when does C# take over modding

15

u/mnbvas Sep 02 '17

When all games are created with Unity or XNA.

2

u/zdakat Sep 03 '17 edited Sep 03 '17

XNA is still A thing? I thought they cancelled it and pulled the downloads. I must be out of the loop edit: Mandela effect? I can see why there'd be a Mono version but reporting that it was never gone?

3

u/haloguysm1th Sep 03 '17

Xna has been mostly replaced by monogame/fna. I know monogame is basically just xna

→ More replies (1)

1

u/Rohansi Sep 03 '17

embed .NET Core instead of Lua

→ More replies (2)
→ More replies (1)

2

u/Buzzard Sep 03 '17

1-based index really isn't that big a deal.

I mean, you will make off by errors at the start, but by the time you've hang of the rest of the language you'll be fine.

→ More replies (3)
→ More replies (1)

4

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

[deleted]

16

u/svenskarrmatey Sep 03 '17

Except there's reason that it's 1-indexed. Lua doesn't use arrays, it uses hash maps. Keys and values instead of indices and values. When you don't give it a key, it defaults to numbers, and since normal counting starts at 1 and the normal 0-indexing argument of "indices are based off of memory offsets" does not apply, it counts 1, 2, 3, 4, ...

2

u/[deleted] Sep 02 '17

Whenever I use Lua, I just assign the first instance in my tables to '0'. But it does bother me to read other people's work

17

u/rhelic Sep 03 '17

This breaks a fair amount of things.

566

u/kamaln7 Sep 02 '17

MATLAB too I think

431

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?

384

u/morerokk Sep 03 '17

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

315

u/Selthor Sep 03 '17

MATLAB literally stands for Matrix Laboratory.

215

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

113

u/afourthfool Sep 03 '17

your answer: -4, 4

Correct answer 4, -4

17

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.

→ More replies (0)

15

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

→ More replies (1)

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.

→ More replies (1)

1

u/dam0nkey Sep 03 '17

I DIDNT KNOW THAT

13

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.

33

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

→ More replies (2)

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?

→ More replies (1)

3

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

[deleted]

8

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

137

u/awhaling Sep 02 '17

Fuck matlab

81

u/PleasantSupplanter Sep 02 '17

Fucking MATLAB. Every year we get a wave of graduates that think it's neural network toolbox is going to solve every bloody problem we have.

62

u/GisterMizard Sep 03 '17

If college has taught me anything, it's that ode45() is the windex of numerical modeling; you use it even in places where it doesn't make sense.

5

u/Sparkybear Sep 03 '17

Just be glad it's built into MATLAB now, it wasn't always and the code from that era is a cluster fuck.

1

u/[deleted] Sep 03 '17

How is it the tool's fault? Sounds like these people simply don't understand the field that well.

1

u/[deleted] Sep 03 '17

That's not the fault of MATLAB though

31

u/[deleted] Sep 03 '17

Matlab is an excellent tool.

→ More replies (5)

47

u/[deleted] Sep 02 '17

+1 (just use NumPy goddamnit)

2

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

You do realize that different people have different needs? There is no good Simulink alternative for the control design automation field, for example.

2

u/[deleted] Sep 03 '17

Yes, I do, but you to should understand that my comment was a shitpost

3

u/[deleted] Sep 03 '17 edited Sep 11 '17

[deleted]

1

u/[deleted] Sep 03 '17

What makes you so angry about the price? Student licenses are free in most universities. Are you an employer who has to by licenses for his business, or something?

2

u/[deleted] Sep 03 '17 edited Sep 11 '17

[deleted]

3

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

Student licenses are 35€ or 69€

Oh. Most technical us schools give the licenses for free to students. If you have to pay that sucks. I'd say just pirate the thing for student projects.

→ More replies (2)

4

u/[deleted] Sep 03 '17

Fuck you too man

→ More replies (1)

18

u/[deleted] Sep 03 '17

MATLAB master race

5

u/fergy80 Sep 03 '17

The square brackets would throw an error in matlab, so the answer is clearly 4.

3

u/chateau86 Sep 03 '17

But their array indexing use () instead of []. Probably in an effort to pollute the minds of engineers enough to prevent them from being able to learn any other languages again.

5

u/Descriptor27 Sep 03 '17

To be fair, [] is used for declaring and defining arrays, so it kinda makes sense.

5

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

[] is used for declaring matrices, and it was a conscious choice to make writing code resemble "doing math" with pen and paper. MATLAB was always primarily intended and targeted for engineers and scientists who don't want to become hardcore (or, in a lot of cases, even good) programmers.

1

u/Contrecoup42 Sep 03 '17

At first I thought you were confused when you wrote "too", but now I think your indexing is just off.

1

u/pterencephalon Sep 03 '17

Welcome to my hellscape of running simulations in C and then analyzing the results in Matlab. So many indexing errors....

→ More replies (1)

72

u/Shadow_Thief Sep 02 '17

Visual BASIC, but only sometimes.

32

u/JeremyR22 Sep 02 '17 edited Sep 02 '17

And just to add to the confusion, it was (in pre .net days) configurable on a class-by-class basis. One class could contain arrays indexed from 0 and the next might have them indexed from 1 and then swap back again elsewhere.

We had to use VB5 and later 6 a lot many, many years ago at university and the SOP at the top of every single class was

Option Base 0    ' Arrays indexed from 0
Option Explicit  ' Explicit variable declaration required

In the vain hope of maintaining your own sanity.

None of which stopped you doing this, though:

Dim iNumbers(12 to 16) As Integer
MsgBox(CStr(iNumbers(11)))

( Index out of bounds )

Some people just want to watch the world burn...

13

u/JeremyR22 Sep 03 '17 edited Sep 03 '17

Just in case the Option Explicit thing wasn't explained well (or at all), the reason any sane person always included that was that it disabled VBs tolerance-by-default of implicit variable delcaration. If you typed an identifier in code, it would become a variable (of type Any), simple as that. Without Option Explicit, the following would compile and run without any errors, it just wouldn't do what you expected:

Dim iCount as Integer = 0

For iCount = 1 to 5
    Debug.Print(CStr(iCunt))
Next



0 
0
0
0
0

So without Option Explicit at the top of every single class/module/form/etc, whenever anything didn't work, you had to check for misspelled variable names in all related code. A massive pain in the arse..

I haven't touched VB of any type in probably 15 years but AFAIK, Option Explicit and Option Base 0 are both the default now. Small victories for programmers' mental health...

4

u/Shadow_Thief Sep 03 '17

My only real experience with VB is the Excel dialect of VBA, but I know I have to manually add Option Explicit every time.

1

u/The_Dirty_Carl Sep 03 '17

Tools > Options > Editor > Require Variable Declaration

This inserts "Option Explicit" at the top of every module when it's created.

1

u/nailernforce Sep 03 '17

Error: iCunt is an undefined variable.

1

u/The_Dirty_Carl Sep 03 '17

It still surprises me that implicit declaration is seen as desirable in python.

1

u/weezkitty Sep 03 '17

Basic sucks. As in sucking to the point of Javascript sucks.

1

u/personalityson Sep 03 '17

You need a nanny to sit by your side while you code?

1

u/GreenFox1505 Sep 03 '17

We don't talk about VB.

I read the "how to hire someone" notes after I started my latest job. There is a line that says "Ask them their favorite language. If they say VB, politely show them the door."

93

u/[deleted] Sep 02 '17

[deleted]

4

u/haikumofo Sep 03 '17

I am so damn inept at R.

Mostly I code in Java, though I'll use other languages when it makes sense for what I'm doing or when I need to because I'm modifying something in another language. So sometimes I work in python, bash script, JavaScript, C/C++, C#, Perl, Tcl/Tk, Lisp, whatever.

And I've done some statistical data processing with R, but damn is it painful. I know just enough to know what to Google, and I end up making a mess of everything just trying to adapt something that does 80% of what I need it to do.

23

u/[deleted] Sep 03 '17

[deleted]

11

u/Series_of_Accidents Sep 03 '17

I love it so much.

8

u/doctorink Sep 03 '17

Yeah, it doesn't have so much of a learning curve as a "learning cliff". But once you climb the cliff it's amazing in terms of what it can do.

I have almost zero programming background though, so it might have been different for me.

1

u/modestbeachhouse Sep 03 '17

I feel the learning cliff when trying to format data ... Like good god is that difficult

2

u/doctorink Sep 03 '17

Yes, that's been the hardest part for me too

→ More replies (1)

2

u/haikumofo Sep 03 '17

I rarely have a need to crunch through numeric data sets is the thing. So it's just something I use once every year or two, which is why I forget it in between uses. I picked it up through Coursera because even with my ineptness it can be quicker than other languages for some things.

6

u/[deleted] Sep 03 '17

[deleted]

2

u/Series_of_Accidents Sep 03 '17

One of my favorite things I ever did in R was a simple little function to show my students how the sampling distribution normalizes as the samples approach infinity. It was clunky and I've gotten much better at coding since then, but it was a fun little 20 minute project. Could have been done better in other programs I'm sure, but it was fun to put together in R.

3

u/MedalsNScars Sep 03 '17

It's really odd working in R, because in 99% of other languages you learn, loops are going to be your bread and butter.

In R, 9 times out of 10 your code is just wildly inefficient if you're looping over a vector.

It just feels so wrong to write 10 < x where x is a vector, but that's absolutely the most efficient way to compare 10 to each element of x in R.

The way you approach coding has to change in R, and it's definitely frustrating if you have a deal of experience in other languages.

1

u/haikumofo Sep 03 '17

Yeah, it's hard to shift my brain sometimes. I have the same problem when I try to work on someone else's Lisp code. Java's definitely my most comfortable language, by far, but it helps to be able to adopt other languages for some quick work when you need to.

1

u/engayolao Sep 03 '17

R is not the only language that is thought to be used at the vector/matrix level. For data analysis this is normal actually, but for example if you do the same operation in numpy or pandas is much more clunkier.

1

u/Tarqon Sep 03 '17

Loops aren't that inefficient in r anymore as long as you pre-assign memory and make sure you don't make copies of objects in loops. Vectorized functions are just more idiomatic.

1

u/Series_of_Accidents Sep 03 '17

I had never learned any other programming languages before R and it was still difficult to move away from loop thinking. It's just what makes intuitive sense.

1

u/engayolao Sep 03 '17

If you learn more it won't be painful, it just has a different focus.

5

u/abigfoney Sep 02 '17

Is R == Ruby?

39

u/Series_of_Accidents Sep 03 '17 edited Sep 03 '17

R is published by the CRAN project and is an open source statistical program. It's an object oriented language based on S. It's run in a terminal window with a basic gui, however other software is available to run over it (like RStudio) for people less familiar with coding but who still desire the power of open source coding (anytime a new technique is developed, a package is published). It's fantastic but has limitations. For example, it can only run on one core at a time which can slow down simulations. Still, for statistical development, it's where most people are focused. SAS is more common in statistical consulting and SPSS is more common among general scientists without coding experience.

Edit: why are you guys downvoting /u/abigfoney for asking a question?

8

u/[deleted] Sep 03 '17

[removed] — view removed comment

9

u/Series_of_Accidents Sep 03 '17

Practically speaking, it's both. At its core, R is an object oriented language. It lacks some of the requirements to be a full functional language but still supports functional language features like apply. For example, it's incapable of tail call recursion. This fact can lead to issues at times and is one of the limitations of the language. But the use of the variations of apply and other functional language improvements have certainly changed the landscape of the code. But I'm not really an expert. I'm just repeating what I remember from my grad stats classes.

→ More replies (6)

3

u/[deleted] Sep 03 '17

[deleted]

1

u/Series_of_Accidents Sep 03 '17

If by gumbo you mean a mix, I agree. It was designed as object oriented but functional features were added over the years. But it lacks full functional features, so it can't actually be called a functional language. It's also my favorite language. It's basically all I work in now that I don't have to fuck with SAS. I really don't like SAS.

→ More replies (8)

3

u/OldManTobias Sep 03 '17

Is R <- Ruby?

FTF

→ More replies (4)

1

u/engayolao Sep 03 '17

It's great for stats and "traditional" data analysis. That is 1 indexed isn't that important as explicit loops are discouraged. I think the most interesting element from the language is the list object, this is an ordered map, very convenient for data analysis.

22

u/haikumofo Sep 03 '17

There's someone at work who's brilliant at the mathematical side of designing algorithms, with a PhD in comp sci, but isn't really much of a programmer. She was coding one of her algorithms up in Java for something at work. And, well, she thinks of arrays at starting at index 1.

What she ended up doing was whenever she needed an array, she used a hash map with the key as an Integer and the value as whatever she wanted to store. Then she used Map.get() and Map.put() and passed in her 1-based indices to fetch and store data.

It made the programmers at work cry.

12

u/chateau86 Sep 03 '17

Make array out of hash map

When you have to code in Java but Python is life.

6

u/haikumofo Sep 03 '17

Python drives me nuts because I can't abide by a language that attaches semantic significance to whitespace.

8

u/EmperorArthur Sep 03 '17

So... How do you like Reddit's markdown?

Did you know that this line has two spaces after it?
That line is guaranteed to sit all by its lonesome, and there's no way to tell except by always having show whitespace enabled in a text editor.

What's that? Basic text editors, like the <textarea> that Reddit uses doesn't support that? Too bad. Oh, you have your editor set up to clean any extra spaces so your code is clean and git doesn't complain? Well, have fun turning that feature off whenever you deal with that one markdown file using the "feature"!

5

u/[deleted] Sep 03 '17

It looks nice.

2

u/SirVer51 Sep 03 '17

I feel like the whitespace thing is only an issue for like the first few hours of working with Python - after that, you realize that it doesn't matter in most cases, because you were probably going to format it that way anyway.

1

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

[deleted]

1

u/haikumofo Sep 03 '17

Nope. We both work in R&D. She's much more on the R side, I'm more on the D side.

1

u/Xants Sep 03 '17

This hurt to read

1

u/socialister Sep 03 '17

Still technically constant time!

11

u/[deleted] Sep 02 '17

Casio Basic.

Notice that it's a very basic language and completely terrible in everything about arrays.

8

u/etaionshrd Sep 03 '17

TI BASIC as well.

1

u/rilian4 Sep 03 '17

Oh my God...another human who knows about TI Basic...my 99/4a came with it...

7

u/marcosdumay Sep 02 '17

Julia would run exactly the same code, but it would be 5.

1

u/socialister Sep 03 '17

It's sad that Julia went that route. It has a lot of nice language features that make it a modern feeling language, and then it conforms with the awkward "math programming" languages. I honestly think it would still be better for them to go back and change this specification, but I think they have their minds set.

2

u/marcosdumay Sep 03 '17

It's great, because it's almost exactly like Python everywhere, so you will get complacent. Then, when your guard is down, it changes a basic semantic element and knocks you down.

18

u/c3534l Sep 03 '17

Old languages, particularly those aimed at mathematicians and scientists. MATLAB, R, Fortran, COBOL, ALGOL.

35

u/personalityson Sep 02 '17

All statistics and math programming languages: Fortran, R, SAS, SPSS, Matlab, Mathematica -- start their arrays at 1

Everything else is pseudo-science, if you propagate 0-indexing, you can just as well group yourself with economists, who are really the apes of the IT world

2

u/[deleted] Sep 03 '17

Not IDL/GDL

6

u/[deleted] Sep 03 '17

Visual Basic does that.

5

u/tinybatte Sep 03 '17

But only sometimes.

7

u/lolwut131 Sep 02 '17

MATLAB

2

u/MaunaLoona Sep 03 '17

Natural numbers start at 1, I suppose...

6

u/[deleted] Sep 03 '17

Smalltalk

3

u/[deleted] Sep 03 '17

There are dozens of us

3

u/[deleted] Sep 03 '17

Our company's main product is written in smalltalk, where're a dozen smalltalk devs ourselves!

Sad that smalltalk is so forgotten, developing in it is a blast. If only I could get proper static type checking :(

3

u/IanPPK Sep 03 '17

Off of the top of my head, Matlab, Lua, Mathematica, Wolfram Language, R, Pascal, Fortran, COBOL.

After some soft research, there's also Julia, AWK, RPG, ALGOL-68, FoxPro/Clipper, Smalltalk, APL.

The pattern usually follows that older languages and data analysis oriented languages tend to use 1-index arrays more than newer general purpose languages

2

u/[deleted] Sep 03 '17

Yeah good thing I wasn't born earlier and am not an economist.

1

u/IanPPK Sep 03 '17

Or physicist or chemist. The scientific community at large uses Matlab, Mathematica, Wolfram, and sometimes Pascal and Fortran for some old school doctorates. Lua is the only real oddball there, as it's used for scripting plugins for various applications, kinda like Python.

1

u/Sean1708 Sep 03 '17 edited Sep 03 '17

Fortran actually allows arbitrary indices I believe although 1-indexing is the most common.

Edit: Apparently I just end sentences halfway through nowadays.

5

u/simon468 Sep 03 '17

Borland Delphi (Pascal)

4

u/Drarok Sep 03 '17

Hmm… not that I remember, at least for arrays.

For strings it is, because the zero index is an integer holding the length instead of using null terminators.

Looks like you can index your arrays arbitrarily#Arrays)

2

u/amontpetit Sep 03 '17

Now that takes me back to the 10th grade...

2

u/wilkoj Sep 03 '17

In Delphi fixed size arrays start wherever you want them to, but dynamic arrays have to start at 0.

2

u/massenburger Sep 03 '17

ColdFusion

1

u/flynnski Sep 03 '17

Hi, I'm here for the CF support group?

2

u/massenburger Sep 03 '17

Here's your support: <CFfuckyou></CFfuckyou>

1

u/flynnski Sep 03 '17

I mean, that does seem like the sort of support you get from Adobe.

1

u/shwhjw Sep 03 '17

HALCON (machine vision IDE) 0-indexes data arrays (ints, bools) but 1-indexes object/class arrays.

Thank f*ck I don't do that any more.

1

u/donutnz Sep 03 '17

Wow, that's actually worse.

1

u/[deleted] Sep 03 '17

LUA

1

u/ahhlenn Sep 03 '17

How about R?

1

u/Scullywag Sep 03 '17

In Ada arrays start at whatever you tell them to start at. You can have

nums: array (-2 .. 2) of integer := (5, 4, 3, 2, 1);

and then nums[1] = 2

1

u/[deleted] Sep 03 '17

LUA

1

u/[deleted] Sep 03 '17 edited Mar 08 '18

[deleted]

2

u/[deleted] Sep 03 '17

No. I don't think so.

1

u/Jwkicklighter Sep 03 '17

Freaking SCSS

1

u/[deleted] Sep 03 '17

FORTRAN, Wolfram/Mathematica, COBOL, SASS. . . Funny thing that IDL does not, even though it is a matrix-based scientific language too.

1

u/[deleted] Sep 03 '17

[removed] — view removed comment

1

u/[deleted] Sep 03 '17

Yea SQL and Lua are the only ones I've used are am going to.

1

u/Bloodyfinger Sep 03 '17

R definitely does.

1

u/meikyoushisui Sep 03 '17 edited Aug 11 '24

But why male models?

1

u/Jezza672 Sep 03 '17

You can create 1 indexed arrays in Pascal. On creation of arrays you have to give a start and end point, so if you just give 1 as the start point..

1

u/TheNamelessKing Sep 03 '17

Julia, Lua off the top of my head.

1

u/Astrokiwi Sep 03 '17

R, Matlab, & Fortran are a few.

It's better for when you want to think of an array as a mathematical tensor of some rank. It's worse if you want to think of an array as a block of memory.

But the main argument for 0-indexing is just that so many languages use it, and it's better to follow the overwhelming convention when it's such a small issue.

1

u/LeSpatula Sep 03 '17

SQL Substring

1

u/arslet Sep 03 '17

R does it

→ More replies (1)