http://qs321.pair.com?node_id=951944


in reply to Re: ASCII Battleship Program
in thread ASCII Battleship Program

I do realize that in the context in which I have used it, protoyping is quite useless. This was at a time when I was rather unsure what prototyping really even was. I simply saw others doing it, and actually thought until recently that it was simply part of the manner in which one defined subroutines. As for the naming of the variables and subroutines, what I was originally planning to do with this was put all the code into one, large program that would allow me to select between other games I played, word processer, possibly an HTML Parser (probably some kind of open-source text-browser already out there) etc. etc. In fact, I was actually intending to make a whole OS-like 'shell' program, for the heck of it. Such aspirations were, naturally, soon abandoned, as such a program was hopelessly out of reach for me. I felt that the naming conventions I used would permit me a broader area of flexibility with which to write other mini-programs in the 'OS'. With local, all I was attempting to do was make it so that subroutines called by other subroutines had access to the same variables that called them. This was before I was particularly well aware of the practice of accepting arguments by use of the variable @_. I felt that such use of local suited my purposes fine, as it would keep all of the variables well within the bound of the battleship program, but would not allow them to seep out into the broader program. My native language is Perl. However, being self-taught, I've developed a style of programming that is probably not only not the greatest, but also simply rather strange looking. But I generally manage to get stuff done, so I'm generally pretty happy with how I code. I do rather fear for whoever's going to have to maintain my code, though . . . .