Declarative delusion

The delusion happens when developers start believing that declarative languages are better than imperative languages.

Personally, there is no perfect solution for all.
Nowadays, there are so many solutions/partial-solutions/broken-solutions, which for people, normally has a lazy tendacy, would like to fanatic easy to understand simply because it’s easy. But easy solution is normally suitable for special or specific domain, in some cases, its broken. Otherwise, for example, why the mostly widely used langue for enterprises is java?

ES6 destructing and spread

destructuring is to auto map the source to the assigned variable, whether being array or object or tuple.

const [a,b,c] = ...

const {a,b,c} = …

const [a,b,c]= …

spread is to auto map any number of items in the array to a spread variable, vice versa. basically to repsent array as one (spread) variable.

const [a, ...b] = ...
const x = [a, ...b]

and in order to destruct array of objects

let o = [
a: "foo",
b: 12,
c: "bar"
a: "test",
b: 20,
c: "check"

let [{a}] = o ====> “foo”

let [{a: a1},{a: a2}] = o ====> “foo”, test

publish vscode extension with bundled in images/gif

its by default vscode expect a public git repository for referring the code and even images to be shown in the markdown.

an alternative, workable solution to enable for the bundled in images is through publish a pre-packaged vsix.

You can override that behavior and/or set it by using the –baseContentUrl and –baseImagesUrl flags when running vsce package. Then publish the extension by passing the path to the packaged .vsix file as an argument to vsce publish.

: in typescript destructing

tsc keep complaning about this code of implicit any type:

const updateFile = (type: any, { fsPath: filepath }) => {

turns out the : within the destructing is for aliasing.

so the code need to change to

const updateFile = (type: any, { fsPath: filepath }: {fsPath: any}) => {


As you can see, component is implicitly any. The : inside of your destructuring assignment in the function arguments is aliasing rather than functioning as a type signature. You could correct it by doing the following: