justChooseOneGoddamn

InsertaGoodName
36 Comments
Subscribe
Notify of
36 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

or count(โ€ฆ), or .Length. Who knows how many other options we have

.Count, .Count() or Length

ANd thats still C# only.

Meanwhile in C

“How would i know how big the array is?”

array.getLength()

Itโ€™s obviously

array.__len__()

Or `#array` if Lua

Also, array.length

std::size::<array>(myArray)

sizeof(array)

At least it isn’t a string. Do I need to know how many bytes, how many Unicode code points, or how many Unicode graphemes?

Perl’s way of doing it is hilarious to me. You just evaluate the array as a scalar.

“`
my @arr = (1,2,3)
my $arrSize = @arr
“`

Wait. What language is this? Where am I? Who is I? Is me who? Who is who?

Or `arra.length` in Java. Only Sun knows why.

I donโ€™t always read the docs, but when I do, this is when I read the docs.

… Ubound() and Lbound() casually stroll into the conversation …

sizeof(array) / sizeof(array[0])

It’s length(array)

Every language can provide you with a dozen-page long manifesto why their way is objectively best.

`sizeOf(array)/array[0]`

unless array degenerated into a pointer

maybe just a dot and IDE does the job for you?

I’ve recently started learning java and the other day I couldn’t remember the one for python

โ€Ok its array.length()โ€

A few rows below, thankfully, Copilot has got your back, suggests โ€array.width()โ€

Thatโ€™s what I use LLMs for with 50% of my requests.

Yeah, with three projects in near windows: TS, Go and Rust

When youโ€™re working with Javascript and PHP

God I feel this on a visceral level

Bro, it’s like I’m playing the slots, waiting to get the good one.

I thought it was in_array()… ๐Ÿ™„

Write your own interface:

getLength(areay)

NaN

Wtf?

๐Ÿ˜ญnumel(array)

lines( array )

The spaces in the parantheses are important

This is where I’ll just ask an AI ๐Ÿ˜‚

It’s ok, daddy AI will remember it for me ![gif](emote|free_emotes_pack|slightly_smiling)

Or just “#” in array -> #array (lua)

When I’ll write my programming language they would all work

Thatโ€™s when you hit Cmd + I and have copilot do it for you

36
0
Would love your thoughts, please comment.x
()
x