1

Question: I've been working a lot with op codes recently, writing explainer content primarily. I've been finding it awkward to refer to the top and second from the top item in the stack. Is it incorrect to refer to items on the stack as 'first and second' from top down, or is there some commonly accepted convention used in conversion?

Thanks in advance, sorry for the noob question!

Equious
  • 11
  • 1

2 Answers2

0

At the moment, saying “top” and “bottom” are the most correct.

Patrick Collins
  • 11,186
  • 5
  • 44
  • 97
  • 1
    We all have different experiences and I rarely see bottom of the stack. If it's about the top 2 stack items, I also haven't seen "bottom" used to describe the item after the "top" of the stack. – eth Mar 15 '24 at 01:12
0

In computer science and programming, the top two items on a stack are commonly referred to as the "top" and "second from the top" or "second" items.

(Source: ChatGPT and I don't think many would disagree.)

eth
  • 85,679
  • 53
  • 285
  • 406