Programming hero
223 subscribers
63 photos
5 videos
22 links
HTML, CSS, JS, Python, C/C++, Java...
Download Telegram
#CodeSmart

Look up table is an efficient mechanism by which you can lookup a value that correspondence to a given key. It is faster, simpler, shorter and easily maintainable than using the "if" statement.
#CodeSmart

Bitmasking is an alternative to lookup table(check previous post), It uses bitwise operations to compare values.
Pros:
It is faster than lookup table because it uses bitwise operation rather than the .includes method used by lookup tables.
Cons:
You have to understand bitwise operations in order to understand it.

you can read more about bitwise operations here:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_AND
#CodeSmart

The debounce function is similar to throttle, it delays the processing of an event until the event has stopped being called for a predetermined amount of time.

Usage:
* Have you noticed that when you type into a search input, there will be a delay before the typeahead results appear. This functionality is frequently controlled by debounce.

Advantage:
* It prevents your code from needing to process every event thus improve performance.
Programming hero
#QuizAnswer I'm going to be giving some details here so it might be a long explanation ๐Ÿ‘. First, when an HTML page is loaded by the browser, the page is parsed line by line, from top to bottom before being rendered to the screen, from this process, the browserโ€ฆ
My advice, if you are going to be having conflicting styles for a single element, make sure to use the same style declaration for all conflicts, that's better than putting "!important" all over your code or changing your code order.

#CodeSmart
#CodeSmart

Master the JS Array map method


@david.webdev
#PYQuiz
#QuizAnswer

Try the quiz before checking the answer, that's how to practice.

#CodeSmart
#React

The useEffect hook is quite confusing to some beginners.
Here is a nice little overview.

#CodeSmart
Get source code of any website using python.

#CodeSmart
To implement method chaining, return "this" from every method in the class.

#CodeSmart
Local and session storage are both used to persist data.

The difference is local storage data does not expire while data from session storage get cleared when the page session ends.

#CodeSmart
Programming hero
Tooltips are good for UX, they help identify the purpose of items on the screen. #CodeSmart
Tooltips are good for UX, they help identify the purpose of items on the screen.

#CodeSmart
๐Ÿ‘1