Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: ASCII Battleship Program

by perlStuck (Sexton)
on Feb 05, 2012 at 13:33 UTC ( [id://951944]=note: print w/replies, xml ) Need Help??


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 . . . .

Replies are listed 'Best First'.
Re^3: ASCII Battleship Program
by GrandFather (Saint) on Feb 06, 2012 at 19:45 UTC

    That stranger who is going to maintain your code is ... you - about a month from now.

    True laziness is hard work
Re^3: ASCII Battleship Program
by Anonymous Monk on Feb 05, 2012 at 14:28 UTC

      Thank you! The book I was using really didn't cover the nuances of Perl, and didn't cover OOP at all. As for perldoc, I'm not really advanced enough to slog through loads of documentation to get what I want. I'm looking forward to reading the both of them.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://951944]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-19 01:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found