I usually include a prefix of some kind in the name to supply more information about my variable names (and field names in tables). For example - sCustCode - Shows that the code is a string. nCustCode would mean it's a numeric. Some programmers might use strCustCode and intCustCode (if it's an integer). And in my customer table I'd likely use c_CustCode - using 'c_' to show the field belongs to the table titled Customers. In the Sales table I'd likely name it s_CustCode. That makes a big difference when using recordsets of linked tables. If the field name was simply CustCode in BOTH tables, the first usage of CustCode would show as CustCode but the second HAS to be something else. So the recordset will instead substitute a (likely) pretty unintelligible temporary field name on the fly, making debugging a lot more of a challenge. It will be particularly challenging if the recordset refers to two DIFFERENT customers for some reason. Probably won't happen with the Customer Code, however. But the same problem might easily arise with other fields - fields that are similar in context but hold different data in that particular recordset. Total, for example. In a one-to-many relationship (sales by customer, for example) the same field name could easily refer to total sales for the customer AND the total for each particular sale.
@codekabinettcomen2 жыл бұрын
Thank you for this feedback. Whether data type prefixes for variables make sense is a longer topic. - Actually already on my list for future videos. - TL;DR: I don't use that anymore. Regarding the issue with query output columns, I think you are trying to fix the problem at the wrong end. If there are columns in the query result which become ambiguous due to the nature of the query, these column names should be aliased to more sensible names right there in the query. For an info on aliases see: codekabinett.com/rdumps.php?Lang=2&targetDoc=sql-as-alias
@sudhirbethekar17792 жыл бұрын
Its nice to see you back in the role .... would you please explain class and class property in deep but in simple way? as you do in every time you do.
@wilsonfineart5 жыл бұрын
Well done! Thanks for sharing that. Might say ">= MINIMUM_VALID_DATE" depending on your requirements.