blade-sensei / learning

Roadmap for software engineer, sandbox, algorithms training, it also contains my daily task dashboard
9 stars 2 forks source link

naming: add vs append vs create #51

Closed blade-sensei closed 4 years ago

blade-sensei commented 4 years ago

append is used to agregate to string or file .. ciontinious add is more for creating or ADD INTO

blade-sensei commented 4 years ago

append

attach, insert and element at the end of generally a list or string (string is considered as a list or chars)

Examples:

DOM: element.appendChild() add element to list child In the element (parent)
Python: list.append(item)

add

add has the same function that append, so it can be the same thing in different langages/tools/libs etc.

combination of other things so as to increase the original unit in numbers, size, amount

Examples:

JS: Set.add() add: add and element to set object

Insert

Insert is also used to add but in a specific place or Index (arrays)

Examples:

python: list.insert(index, element)

create

Builds/create and object but it's not attached to anything.

Examples

DOM: document.createElement("BUTTON"); create / not added anywhere