by chx · 3y ago · 0 comments
This is to say, it's possible for a problem the best P algorithm we can find takes n^(10^82) time while the NP algorithm we can find is say (1.00000000.....(10^82 zeroes)... 1)^n. For any practical number the NP algorithm will be faster. (I used 10^82 because it's the approximate number of atoms in the observable universe.)
On the other hand, I have had great benefit from studying PL and semantics for software engineering. It taught me to write more readable and reliable code.
(From a person who studied both as a part of his master)
Also, the reason why profiling is imo not good enough is that you really shouldn’t even try to write an implementation with a known-to-be “slow” algorithm at the designed input size. For that, understanding O-notation is essential.