The effective exploitation of his powers of abstraction must be regarded as one of the most vital activities of a competent programmer.
Each significant piece of functionality in a program should be implemented in just one place in the source code. Where similar functions are carried out by distinct pieces of code, it is generally beneficial to combine them into one by abstracting out the varying parts.
[Abstraction] tries to factor out details from a common pattern so that programmers can work close to the level of human thought, leaving out details which matter in practice, but are immaterial to the problem being solved.
array.each do |item| # do somethingend
for(var i =0; i< array.length; i++){ // do something}
array.each do |item| # do somethingend
for(var i =0; i< array.length; i++){ // do something}
Programs must be written for people to read, and only incidentally for machines to execute.
array.each do |item| # do somethingend
for(var i =0; i< array.length; i++){ // do something}
array.each do |item| # do somethingend
for(var i =0; i< array.length; i++){ // do something}
The real problem in speech is not precise language. The problem is clear language ... It is really quite impossible to say anything with absolute precision, unless that thing is so abstracted from the real world as to not represent any real thing.
There is no abstract art. You must always start with something. Afterward you can remove all traces of reality.
Humans are awesome pattern identifiers.
Abstractions are patterns that we give names.
But we need to be careful about the patterns we pave.
ECMAScript syntax is relaxed to enable it to serve as an easy-to-use scripting language.
Even though ECMAScript includes syntax for class definitions, ECMAScript objects are not fundamentally class-based such as those in C++, Smalltalk, or Java.
Remember that all models are wrong; the practical question is how wrong do they have to be to not be useful.
In a class-based object-oriented language, in general, state is carried by instances, methods are carried by classes, and inheritance is only of structure and behaviour. In ECMAScript, the state and methods are carried by objects, while structure, behaviour, and state are all inherited.
abstraction
abstraction
A good way to organize a programming course is to start with a simple language and then to extend this language gradually.
Always implement things when you actually need them, never when you just foresee that you need them.
The most thought-provoking thing in our thought-provoking time is that we are still not thinking.
Scientists work from models acquired through education and through subsequent exposure to the literature often without quite knowing or needing to know what characteristics have given these models the status of community paradigms.
It is far better to grasp the universe as it really is than to persist in delusion, however satisfying and reassuring.
Keyboard shortcuts
↑, ←, Pg Up, k | Go to previous slide |
↓, →, Pg Dn, Space, j | Go to next slide |
Home | Go to first slide |
End | Go to last slide |
b / m / f | Toggle blackout / mirrored / fullscreen mode |
c | Clone slideshow |
p | Toggle presenter mode |
t | Restart the presentation timer |
?, h | Toggle this help |
Esc | Back to slideshow |