Meaningful Names / Comments
Functions
Error Handling
Formatting
Objects & Data Structures
100

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. 

100

What is the single responsibility principal?

Functions should do one thing and they should do it well. 

100

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. 

100

True or false, variables should be declared as far away as possible from their usage?

False! 

100

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.

200

True or false, classes and objects should be noun phrases?

True. Example: CustomerAccount

200

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. 

200

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

200

What is vertical density?

The lines of code that are more related to each other should appear close to each other

200

Are large chains of calls are considered sloppy and should be avoided? 

(i.e. company.primaryPerson.address.city)

True! Avoid.

300

True or false, methods should have verb phrase names?

True, example: deletePage
300

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.

300

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. 

300

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

300

What is a data transfer object or DTO?

The quintessential form of a data structure is a class with public variables and no functions

400

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

400

Define monad

A function that only takes in one argument. 

400

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

400

True or false, a team of developers should never agree upon a single formatting style?

False! 
400

What are Hybrid structures?

Half object and half data structure, and they make it hard to add new functions and new data structures

500

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.

500

Define niladic.


A function with zero arguments. 

500

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.

500

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.

500

Define The Law of Demeter

A module should not know about the innards of the object it manipulates

M
e
n
u