That is to say, if we wanted to add elements to this structure, or if we wanted to remove elements from it, we’d have to do it starting from one place: the top of the stack. The interesting thing about how stacks work, is that they only really have one direction to them. And, like linked lists, stacks are linear, which means that there is a sequence and an order to how they are constructed and traversed. So what is a stack, and how does it work? Well, just like a linked list, a stack is nothing more than a data structure that contains a whole bunch of elements. It’s actually it’s own abstract data type! And there’s so much to learn about it. It turns out, however, that there’s a lot more to the term stack. That was the first time that I learned about something that’s referred to as the stack (or sometimes the call stack), which is the structure that stores all the things that happen when a program is executed - or all the things that happen during runtime. Stack level too deep? I mean, how deep were we really talking here?īut, as time went on, I started delving deeper into this error message and reading more about this thing called a stack that I seemed to be overflowing. That’s a lot of what my the early days of learning to code looked like, back when I was freaked out by debugging and would perpetually give up on myself before I had even started.īefore I enjoyed debugging my code, one of the errors that I ran into quite often - and sometimes still run into now - looked like this: SystemStackError: stack level too deep!Īt first, I didn’t really know what it meant, but I knew that it was bad. ![]() But it took me a few months to not be so afraid of figuring out what exactly I had done wrong. ![]() Well, part of that fear was true: I had usually done something wrong. ![]() My gut reaction would be to panic and immediately think that I had done something wrong. When I was first learning to code, errors used to scare the hell out of me.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |