Guest User

Untitled

a guest
May 24th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.94 KB | None | 0 0
  1. Answer of Question 1
  2. --------------------
  3. VoidVolker, ProAppDev, falconandy these are the three gists/code files.
  4.  
  5. In the VoidVolker code the highestProductOf3(...) method is static which makes it ready for a console application implementation.
  6. Also the calculations are all made on long code lines instead of on several lines to increase readability.
  7. Also 'Exception' is not a proper exception to throw when the length of the array is less than 3.
  8.  
  9. In the PropAppDev code the namespace is not named well, it is named gameguy34. Which is not good for code readability.
  10. Also the highestProductOf3(...) method is not static which makes it not ready for a console application implementation.
  11. Also the calculations are all made on long code lines instead of on several lines to increase readability.
  12. Also ArgumentOutOfRangeException is a proper exception to throw when the length of the array is less than 3.
  13.  
  14. In the falconandy code
  15. Also the highestProductOf3(...) method is static which makes it ready for a console application implementation.
  16. Also the calculations are all made on long code lines instead of on several lines to increase readability.
  17. Also ArgumentException is a proper exception to throw when the length of the array is less than 3.
  18.  
  19. I order them from the strongest code at top (first) to the weakest code at the end as following:-
  20. 1. falconandy (Rating=1)
  21. 2. VoidVolker (Rating=2)
  22. 3. PropAppDev (Rating=3)
  23.  
  24. Answer of Question 2
  25. --------------------
  26. I didn't find any changes that would make the content better for C# users, also there were no mistakes in the three articles.
  27.  
  28. Answer of Question 3
  29. --------------------
  30. Both are same, there is no difference its just a different term for the same thing in C#.
  31.  
  32. Method:
  33. In object-oriented programming, a method is a subroutine (or procedure or function) associated with a class.
  34. With respect to Object Oriented programming the term "Method" is used, not functions.
  35.  
  36. Answer of Question 4
  37. --------------------
  38. 1. Building up a string one character at a time is O(n) in C# and the language has StringBuilder to make it
  39. more efficient.
  40. 2. There is a term for taking a subset of the string in C# and it is called slicing, it is called string
  41. slicing as well in Python.
  42.  
  43. Answer of Question 5
  44. --------------------
  45. I've read the style guide and here are my comments
  46. * The guide says: "Use default settings such as four spaces for indenting, spaces instead of tabs"
  47. IMO, Tabs should always be used.
  48.  
  49. * The guide says: "Use C# built-in type aliases when available instead of .NET types."
  50. .NET types could be used sometimes instead of built-in types to increase,
  51. the one place where I do explicitly use Int32, Int16, etc.,
  52. is if I'm dealing with binary storage or transfer, especially to or from a custom binary format.
  53. In this case, having the explicit bitsize of each member going into and out of the file makes
  54. the code more readable and understandable, IMO.
  55.  
  56. * The guide says: "Comments can be avoided if your variables, classes, and functions are well-named."
  57. This is not accepted, comments are important even if the variables, classes, and functions are well named
  58.  
  59. Answer of Question 6
  60. --------------------
  61. Yes, I understand Big O Notation clearly. I've read the examples in the provided link and I understand them well.
  62.  
  63. Answer of Question 7
  64. --------------------
  65. Peter wakes up before the sun is up. Without even eating breakfast, he runs out of the house to catch the bus.
  66. He is in such a hurry that he grabs his brother’s jacket instead of his own. But there is no time to go back.
  67. The bus will arrive soon! Peter arrives to the bus stop right as the driver begins to close the door.
  68.  
  69. "You’re lucky," the driver says. "I was about to leave without you!"
  70.  
  71. Peter takes a seat by the window so he can take in all the sites. When he arrives at his stop, he races off the bus,
  72. runs towards the bakery, and walks through the blue, big door.
  73.  
  74. "I'll have a piece of cake, please!"
  75.  
  76. "Cake? For breakfast?" the baker replies.
  77.  
  78. "Oh yes," says Peter. "Cake is the best breakfast!"
Add Comment
Please, Sign In to add comment