Nmap Development mailing list archives

Re: [Lua snippit] print_hex


From: Sven Klemm <sven () c3d2 de>
Date: Mon, 08 Sep 2008 10:41:24 +0200

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ron wrote:
| Kris Katterjohn wrote:
|> Patrick Donnelly wrote:
|> I'm pretty sure Brandon, I and others have brought this up in the
past, but it
|> would be awesome to have a "Best Practices" section (short is fine)
in the
|> Nmap docs/book somewhere on Lua coding, and any gotchas that could
get us who
|> come from many other languages (I think most people here learned
Lua solely
|> for NSE... I know I did).  I know Brandon recently posted a link on
learning
|> Lua from a Perl background, but I've never been much of a Perl guy.
|
| I agree that a best practices or style guide of some kind would be
| handy. While writing a script, there were a few times when I wasn't sure
| what the proper style was. Here are some thoughts I had while I was
writing:
| - Tab indenting or spaces? If spaces, how many?
| - Should there be a maximum line length?
| - Is it better to use, for example, str:len() or string.length(str)?
| When is one preferred?

I also agree that having best practices would be a good thing.
I use 2 spaces for indentation and try to keep my line length below 80
but I don't mind if I get over it occasionally. I always use str:len()
instead of string:len(str).

Another topic for discussion would be variable names and function
names: CamelCaseNames versus lowercase_names, verbose longer names
versus abbreviated shorter (cryptic) names.
I do prefer lowercase names and try to use verbose names instead of
abbreviated shorted ones.

It would be nice if all libraries would share a common style for their
API.

Cheers,
Sven

- --
Sven Klemm
http://cthulhu.c3d2.de/~sven/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkjE5TQACgkQevlgTHEIT4ZulACfXoi3l+SfNFcjDfk09eA8f53R
imwAnibPBQ5W15G7OYVizCexMYAE+Uk5
=7zXJ
-----END PGP SIGNATURE-----

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org


Current thread: