Is the variable name "e" a search friendly name? What is an example of a search friendly variable name?
No, "e" is not a search friendly variable name.
What is the single responsibility principal?
Functions should do one thing and they should do it well.
True or false, you should never create an informative error message and pass it along with your exceptions?
False! You should always mention the operation that failed and the type of failure.
True or false, variables should be declared as far away as possible from their usage?
False!
What is the difference between objects and data structures?
Objects: hide their data (be private) and have functions to operate on that data.
Data Structures: show their data (be public) and have no functions.
True or false, classes and objects should be noun phrases?
True. Example: CustomerAccount
True or false, switch statements should always be used wherever possible?
False!
Switch statements are hard to be made small and it's hard to make a switch statement that does one thing.
True or false, it's okay to return null with error handling? Why or why not?
False! Returning null creates work for ourselves and it only takes one missing null check to mess things up
What is vertical density?
The lines of code that are more related to each other should appear close to each other
Are large chains of calls are considered sloppy and should be avoided?
(i.e. company.primaryPerson.address.city)
True! Avoid.
True or false, methods should have verb phrase names?
True or false, it's good practice to pass in a boolean to a function?
False! It's bad practice to pass a boolean into a function.
Booleans passed into a function can complicate the signature of the function.
Passing in a boolean will cause a function to inherently do more than one thing.
True or false, it's a good idea to pass null with error handling?
False. In most programing languages, there is no good way to deal with null.
Where should instance variables be declared?
Should be declared in one well-known place (at the top of the class). Because they are used by many of the methods within the class
What is a data transfer object or DTO?
The quintessential form of a data structure is a class with public variables and no functions
What are two things you should do when thinking of writing a comment?
1) do not put too much information
2) make the connection between the comment and code obvious
Define monad
A function that only takes in one argument.
What is the role of the finally block in error handling?
The finally block is used to execute code regardless of whether or not an error has occurred
True or false, a team of developers should never agree upon a single formatting style?
What are Hybrid structures?
Half object and half data structure, and they make it hard to add new functions and new data structures
True or false, it's a great idea to comment out code? Why or why not?
False!
Others who see commented out code are sometimes afraid to delete it.
Define niladic.
A function with zero arguments.
What is logging? How does it differ from debugging?
Logging is the process of tracking events that happen during the execution of a program. Debugging is the process of identifying and fixing errors in a program.
What is Conceptual Affinity?
Certain parts of code want to be near other parts, sometimes because a group of functions perform a similar operation or one function calling another.
Define The Law of Demeter
A module should not know about the innards of the object it manipulates