News for hackers. Stuff that matters.
Re:SQL style guide by johnnyb9 on Sunday October 09, 2016 @01:51PM (#12672335)
Not to mention with an ORM tool you'll have an Employee object, and probably call your collection employees.

Which is better?

foreach (var employee in staff) {

}

or

foreach (var employee in employees) {

}

Re:SQL style guide by fny on Sunday October 09, 2016 @02:42PM (#12672651)
Honestly, they both look fine, but they do impart different meanings. "Staff" implies a set of employees dedicated to something like a company or project whereas "employees" could refer to multiple employees in any context.

If you're walking on to a new project, these subtleties make all the difference in understanding what's going on without having to rely on documentation.

Re:SQL style guide by vizeroth on Sunday October 09, 2016 @07:29PM (#12674149)
In my case, we have anywhere from 3 to 20+ types of employees, and "staff" is the word commonly used to refer to one of those classifications. Certain information requires different levels of protection for some of those classifications. While people can transition between classifications, it's not a very common occurrence, and it only makes handling their information more difficult (and the old classification may apply to the information for a specific period of time after the change, or indefinitely for some types of data).

I basically end up with a "people" table which holds a very small amount of common data and is used in a lot of relationships.

Honestly, the distinctions require a great deal of documentation to fully understand. However, making the data less normalized and a little harder to comprehend also protects new people from making honest mistakes which could lead to legal issues.

Re:SQL style guide by stymaar on Sunday October 09, 2016 @02:31PM (#12672575)
> and probably call your collection employees.

Really ? IMHO this is a bad practice : it makes the code les readable and breaks the auto-completion ...

Re:SQL style guide by johnnyb9 on Sunday October 09, 2016 @02:34PM (#12672590)
Doesn't break autocomplete in Visual Studio 2015...
Re:SQL style guide by Kiro on Sunday October 09, 2016 @03:35PM (#12672955)
What would you call it?
Re:SQL style guide by cema on Monday October 10, 2016 @12:53PM (#12678268)
Better is, imho,

  foreach (var e in employees) {
    // ...
  }
because the iteration variable is essentially a placeholder.