logoalt Hacker News

awesome_dudeyesterday at 6:53 PM1 replyview on HN

Do you really have code that's

if array.Len > 2 { X = Y[1] }

For every CRUD to that array?

That seems... not ideal


Replies

skydhashyesterday at 8:19 PM

Yes. Unless there’s some statement earlier that verify that the array has 2 items. It’s quick to do, so why not do it?