I had a professor in university who was frequently saying he developed a thousand application and he didn't use any if.
I know it's extreme but is there any way to reduce (lets say 5 to 1) conditions?
I think he was developing Fortran apps.
Anecdote: This very same professor asked us to do a matrix operation (I don't remember what) without using if once. He said it would be faster than using ifs. Many of us couldn't. Then he revealed his solution, he was getting first indice of first row and doing some operation and getting the last indice of last row, then second indice of first row and so on.
One of my friend told that if he wrote the algorithm plain using ifs, it would be faster. Professor told it's impossible.
In the end of the day the version which was written using ifs was a lot faster than the version without ifs. Because of the changing indices cause a lot of cache misses but getting matrix elements sequentially used cache correctly.
I was making around $3000 before leaving my job (it's very good money for Turkey) and I had $3000 when I left my company. It's been almost 3 months now and I have $1000 more. My project is ready to sell. And we will start selling next week. I hope I can survive.
I know it's extreme but is there any way to reduce (lets say 5 to 1) conditions?
I think he was developing Fortran apps.
Anecdote: This very same professor asked us to do a matrix operation (I don't remember what) without using if once. He said it would be faster than using ifs. Many of us couldn't. Then he revealed his solution, he was getting first indice of first row and doing some operation and getting the last indice of last row, then second indice of first row and so on. One of my friend told that if he wrote the algorithm plain using ifs, it would be faster. Professor told it's impossible.
In the end of the day the version which was written using ifs was a lot faster than the version without ifs. Because of the changing indices cause a lot of cache misses but getting matrix elements sequentially used cache correctly.