0
kpenc
8y

I want to ask for your opinion guys, because I don't know if I am right or wrong.

So, some days ago, my brother sent me some code to check out for an automation that he does for testing purposes, since he's a QA (I am a programmer). He should be able to send XML data to a server and depending on the process that he tests, the data is different every time. I saw a strange thing, he hardcodes the XML tags and concatenates them with data which I find stupid. So I proposed him to use a template to generate XML data, because I think it's more flexible and easier, making data and presentation separate. That way if in the future he wants to start using JSON he could do it in no time. I made the code in a separate file which he imports and uses it's functions (they are two so no need for classes) and uses them to load the template and render it as he passes the data as a hash table. He insists that concatenating data and XML tags is easier and simpler and I can't wrap my mind how could that be true. I gave him an example in which the data structure for a process is changed and he have to open the file and change the XML tags or the structure and he still says that's simpler.

What is the right decision in this situation. Keep in mind that I simplified the process a lot and it actually involves sending the data and reporting the results, but they are not important here since I am talking only about generating data.

Comments
Add Comment