[Survey]Which language/technology would you recommend for specific use

  • (2 Pages)
  • +
  • 1
  • 2

16 Replies - 1104 Views - Last Post: 23 June 2017 - 04:24 PM

#16 C0deboy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 12-June 17

Re: [Survey]Which language/technology would you recommend for specific use

Posted 23 June 2017 - 12:56 PM

U are right, I didn't take it into consideration and I know why. Almost every binary search example don't take either. On the other hand, I want to keep it simple and I think it
middle = (start + end) / 2

is more clear than
middle = start + ((end - start) / 2); 


As I said, it's just showcase of syntax. It's not a tutorial of implemetation binary search, but somtimes, even in such cases integer overflow isn't taken into consideration. I bet it is for the same reason - to keep it simple. As I remeber, I took this code from well-known book :o
Was This Post Helpful? 0
  • +
  • -

#17 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 5887
  • View blog
  • Posts: 20,095
  • Joined: 05-May 12

Re: [Survey]Which language/technology would you recommend for specific use

Posted 23 June 2017 - 04:24 PM

And this is the reason why cryptography experts experts recommend taking somebody else's certified and proven working libraries instead of rolling your owen -- even if you are taking code from a textbook. Usually code shown in textbooks books are written to demonstrate concepts, but not necessarily be written to handle errors or edge conditions.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2