1

I've noticed in a recent article on TDWTF that someone was using the variable name lsSQL . I have also noticed similar variable names in a legacy application I am working on and in other places around the web, but I have never found out what the ls prefix stands for.

What does ls mean? What kind of notation is that?

Thanks,
Tom

Tom
  • 6,991
  • 13
  • 60
  • 78

2 Answers2

3

I would expect that this is a usage of Hungarian notation is Basic-like language (i.e. without strong typing). Here I would expect l to denote something like "local variable" as opposite to "argument" or "global variable", and s to denote type i.e. string here.

SergGr
  • 23,570
  • 2
  • 30
  • 51
  • That's what i thought, but it felt strange to see Hungarian notation in a PHP application... – Tom Apr 28 '10 at 15:35
  • Well, Hungarian notation is not bound only to some languages. It might be used in almost any imperative language. And in my opinion Hungarian notation is not always evil. I think that the best article on this top is written by Joel http://www.joelonsoftware.com/articles/Wrong.html – SergGr Apr 29 '10 at 10:09
2

If my VB Naming Convention Fu serves me right, I believe the ls prefix stands for Local String (and then the SQL mearly indicates that it's the SQL Statement).

As a comparison reference in those situations, I would expect there to also be a variable prefixed with lcon for Local Connection.

Justin Niessner
  • 242,243
  • 40
  • 408
  • 536