Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Answer of Question 1
- --------------------
- VoidVolker, ProAppDev, falconandy these are the three gists/code files.
- In the VoidVolker code the highestProductOf3(...) method is static which makes it ready for a console application implementation.
- Also the calculations are all made on long code lines instead of on several lines to increase readability.
- Also 'Exception' is not a proper exception to throw when the length of the array is less than 3.
- In the PropAppDev code the namespace is not named well, it is named gameguy34. Which is not good for code readability.
- Also the highestProductOf3(...) method is not static which makes it not ready for a console application implementation.
- Also the calculations are all made on long code lines instead of on several lines to increase readability.
- Also ArgumentOutOfRangeException is a proper exception to throw when the length of the array is less than 3.
- In the falconandy code
- Also the highestProductOf3(...) method is static which makes it ready for a console application implementation.
- Also the calculations are all made on long code lines instead of on several lines to increase readability.
- Also ArgumentException is a proper exception to throw when the length of the array is less than 3.
- I order them from the strongest code at top (first) to the weakest code at the end as following:-
- 1. falconandy (Rating=1)
- 2. VoidVolker (Rating=2)
- 3. PropAppDev (Rating=3)
- Answer of Question 2
- --------------------
- I didn't find any changes that would make the content better for C# users, also there were no mistakes in the three articles.
- Answer of Question 3
- --------------------
- Both are same, there is no difference its just a different term for the same thing in C#.
- Method:
- In object-oriented programming, a method is a subroutine (or procedure or function) associated with a class.
- With respect to Object Oriented programming the term "Method" is used, not functions.
- Answer of Question 4
- --------------------
- 1. Building up a string one character at a time is O(n) in C# and the language has StringBuilder to make it
- more efficient.
- 2. There is a term for taking a subset of the string in C# and it is called slicing, it is called string
- slicing as well in Python.
- Answer of Question 5
- --------------------
- I've read the style guide and here are my comments
- * The guide says: "Use default settings such as four spaces for indenting, spaces instead of tabs"
- IMO, Tabs should always be used.
- * The guide says: "Use C# built-in type aliases when available instead of .NET types."
- .NET types could be used sometimes instead of built-in types to increase,
- the one place where I do explicitly use Int32, Int16, etc.,
- is if I'm dealing with binary storage or transfer, especially to or from a custom binary format.
- In this case, having the explicit bitsize of each member going into and out of the file makes
- the code more readable and understandable, IMO.
- * The guide says: "Comments can be avoided if your variables, classes, and functions are well-named."
- This is not accepted, comments are important even if the variables, classes, and functions are well named
- Answer of Question 6
- --------------------
- Yes, I understand Big O Notation clearly. I've read the examples in the provided link and I understand them well.
- Answer of Question 7
- --------------------
- Peter wakes up before the sun is up. Without even eating breakfast, he runs out of the house to catch the bus.
- 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.
- The bus will arrive soon! Peter arrives to the bus stop right as the driver begins to close the door.
- "You’re lucky," the driver says. "I was about to leave without you!"
- 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,
- runs towards the bakery, and walks through the blue, big door.
- "I'll have a piece of cake, please!"
- "Cake? For breakfast?" the baker replies.
- "Oh yes," says Peter. "Cake is the best breakfast!"
Add Comment
Please, Sign In to add comment