A named query takes in a dictionary of parameters, which it uses to build the query. How to I most cleanly write out this dictionary?
Say I have a named query, located at end_of_shift_reporting/create_report_entry, which takes three parameters: machining_shifts_ndx, operator_user_name, parts_produced_during_shift, and returns the index that this new report was created at.
I take in some data from a button event, calculate these three above parameters, and have them in variables named the same.
There are two ways I can think to approach this: declare a variable, put my params in it, and then pass it to the function, or I could have an anonymous variable instead.
It will come down to personal preference really. I see some people do option 2 as well, and that is more compact code, but I like a variable especially when I am building the params from other variables.
I also use camelCase, but for me it less "personal Preference" and more, because that is the Java recommended scheme, and so when using Java functions in Jython, it makes my OCD not go crazy, from mixed naming schemes.
I also prefer short hand names, but don't fall into the "Microsoft" trap. I'm looking at you LPCWSTR, and Hungarian Notation.
I always notice when I see LLM stuff from people where the LLM throws the underscore scheme in there and the person puts their flavor on top of it not realizing. I probably only notice because I too have a hair of the OCDs when it comes to code.
oh, I'm completely a fan of camelCase (my background is java), it's just that all the code we have uses underscores, and I'd rather be constant in that regard.
One thing that I was not willing to be consistent on (and in fact went back and refactored) was prepending the name of any variable that was used in a named query with param_.
(The main reason I refactored was because we had a giant dictionary of parameters for this application, that seven different queries went and added to/ wrote from as they went)