aeroson

Untitled

May 22nd, 2016
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1. _____________________________________________________________________
  2.  
  3. PPT - pro programing tips
  4.  
  5. DEFAULT BEHAVIOR IS THE WORST POSSIBLE
  6. Always assume that the default unconfigured behavior of anything is the worst possible. So always configure everything the best way you can.
  7. (The default behavior might change, or none paid attention to it.)
  8.  
  9. MAKING ANY PROGRAM
  10. Must be controllable only by keyboard, and also only by mouse
  11. Viviem--it web browser addon is good example, press f, all clickables are assigned letter combinations
  12.  
  13. USE CASE TEST SCENARIOS
  14. You need use case test scenarios for everything you want to support. Because if you don't you willl inevitably break it some day without even knowing it. Which will make everyone angry.
  15. (Arma 3, addon added amphibious tracked vehicles can't move in water, because there is no vanilla amphibious tracked vehicles, so BIS can not even test it)
  16. // http://feedback.arma3.com/view.php?id=19911
  17.  
  18. AMPHIBIOUS FEATURES
  19. Two ways to do one thing, people will forget the least used one. Introduces bugs and confusion.
  20. (php: "text\n" and 'text\n' \n gets interpreted only inside "")
  21.  
  22. TAKE CARE WHEN USING ROUND,CEIL,FLOOR
  23. ceil(_x/_maxX*4) this will be 1,2,3,4
  24. ceil(_x/_maxX)*4 this will be 4 always
  25.  
  26. C# GET SET
  27. The only difference is the first letter, i once wrote a SETer function in GET block.
  28. Infinite recursion, crashed so many times, couldn't find the bug,
  29.  
  30. SIMILAR NUMBERS FOR TESTING
  31. Have A and B, now in your code you use A/2 and B alot, in case A == B*2 you might switch A/2 and B.
  32. It will still work for these particular numbers but if you change them, everything breaks.
  33.  
  34. SOME CHARACTERS LOOK LIKE NUMBERS
  35. I wanted to use "i" letter variable for indexing, but i have instead had number "1" there.
  36. Small laptop monitor is partially to blame.
  37.  
  38. CLEAR CACHE
  39. Could not find bug in new code, since I was using data (stored in cache) created with the old bugged code.
  40.  
  41. VARIABLE NAMES PREFIX
  42. I thought the variable name was correct since at first glance it looked correct.
  43. It was "ray", but it should have been "rayReflected", do not use only prefix alone.
  44.  
  45. IT IS NOT POSSIBLE
  46. You are probably in wrong place, it might look similar, but it's wrong file.
  47.  
  48. BIT SHIFTING
  49. Take extra care when using >> or <<. I had written 1>>4 which is 0 but I wanted it to be 2^4. The correct was 1<<4.
  50.  
  51. _____________________________________________________________________
Add Comment
Please, Sign In to add comment