>>>>You only asked for syntax. Coding with such syntactic sugar to eliminate the redundancies will IMO still be a patch - the code is the equivalent to recurring fields in a record before normalization. So create a record/object for each index to clean up and hang those objects into a list, dict or even easier an array with index as index. So now you have some refacturing advice as well...
>>>>
>>>
>>>These are the columns in the table and they are repeated (6*3 columns). currentTemplate represents a table's row and all these properties are actual columns in the table.
>>>
>>>
>>this really grates my nerves. Some lazy/stupid table design percolated into repeating code - making the whole thread necessary to ask for tricks to patch things up. Should be a lesson to those not trying for at least 1NF design.
>
>Well, there are several tables like this in our database. The application started as a VFP application about 20 years ago, then got moved to SQL Server and currently is being re-written into MVC application and AngularJs for front-end. We do change some tables but I think this one is very crucial for the application and used in many areas and other applications so chances of it being normalized now are slim. I think I will not raise the issue now, may be at a later point.
It is your job and you know the company and people involved. Would not be my style - esp. the part of "not raising the issue now, but may be later", as it already costs the company money and you are currently working on it.
I am not into PC speak - but would hold you responsible as well if you were in the group of working on such a stink if brought in for a code review, perf optimization or to replace one of the higher ups. If ever questioned your only defense against collusion would be to argue own stupidity - not really a good long term strategy.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement