LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Append a string data to txt. file


@Vinaygowda wrote:

 

one more question does it take more processing power to execute or its not a good way to do LabView program


Probably both.

 

Note that the read file could be smart enough to not actually read anything when the output is not wired. Some functions do that. I wouldn't bet on it. Only benchmarking would give certainty.

 

It's more about clarity. Reading the file would raise a question "why is the file read when the output is not used (let's delete it)". The set file position sends a cleared message. To the computer, and to (another) programmer.

 

Priority is usually to get the code working. Then, 'it works'. For the computer. Good code works for you. If it execute as expected, the next step is to get the code working for you (or me, or any programmer).

 

The code should be the simplest solution that solves the problem. It should be readable, extendable and maintainable. That might not be the most important thing on your mind, but at some point your code or your next program will grow. You'll have a better experience with good code base to build the program. What's good does tend to change, so change it if it's called for. 'But it works' should not be an excuse (if it doesn't work for you).

 

Your alternative isn't that bad btw. It's OK-ish because it's still pretty obvious, and doesn't do much harm for small files. I'd change it if I saw it, but I wouldn't fire someone over it. 

 

 

Message 11 of 11
(304 Views)