Skip to content

Latest commit

 

History

History
50 lines (32 loc) · 2.76 KB

File metadata and controls

50 lines (32 loc) · 2.76 KB

Understanding The Problem Domain Is The Hardest Part Of Programming

THE HARDEST THING ABOUT WRITING CODES:

  • Learning a new technology.
  • Naming things.
  • Testing your code.
  • Debugging.
  • Fixing bugs.
  • Making software maintainable.

Writing code is a lot like putting together a jigsaw puzzle. Why problem domains are hard: We put together code with the purpose of building components that we have taken out of the “bigger picture” of the problem domain. The big issue is that many problem domains are like a puzzle with a blurry picture or no picture at all.

Programming is easy if you understand the problem domain:

the waterfall approach, it was very easy to write the code for a feature. I was easily able to learn that problem domain and because of it, I was able to write the code very easily as well. On Agile project, you will take a lot of time to clearly understand the problem domain before writing any code. It is very difficult to solve a problem before you know the question.

What can you do about it? You can do one of these things: Make the problem domain easier, or get better at understanding the problem domain.

You can often make the problem domain easier by cutting out cases and narrowing your focus to a particular part of the problem. You must take a part of the problem and fully understand that part before expanding the problem domain. 

From the Duckett JS book

CHAPTER 3: FUNCTIONS, METHODS & OBJECTS

  • WHAT IS AN OBJECT?

Objects group together a set of variables and functions to create a model of a something you would recognize from the real world. 

CREATING AN OBJECT: LITERAL NOTATION: There are some ways to make objects, some of these literal notation. The object is the curly braces and their contents, and is stored as a variable.

CHAPTER 5: DOCUMENT OBJECT MODEL

  • CACHING DOM QUERIES: DOM queries is a methods that find elements in the DOM tree. You can use a variable to store the result of this query when you want to work with an element more than once.

  • METHODS THAT SELECT INDIVIDUAL ELEMENTS: getElementById() and querySelector() can both search an entire document and return individual elements. getElementById() it the quickest and most efficient way to access an element, and querySelector() is a more recent addition to the DOM.

  • SELECTING AN ELEMENT FROM A NODELIST: There are two ways to select an element by The item() method and array syntax. But Array syntax is faster.

  •  ADDING OR REMOVING HTML CONTENT: THE innerHTML PROPERTY:  Approach: innerHTML can be used on any element node. ADDING CONTENT: To add new content, you must store new content, select the element whose content you want to replace, and set the element's innerHTML property to be the new string. REMOVING CONTENT: you can do this by setting innerHTML to an empty string.