alsotang

alsotang

A fullstack JS programmer.

Member Since 10 years ago

Tencent, ShenZhen, China

Experience Points
5.1k
follower
Lessons Completed
77
follow
Lessons Completed
1.2k
stars
Best Reply Awards
193
repos

438 contributions in the last year

Pinned
⚡ :baby_chick:Nodeclub 是使用 Node.js 和 MongoDB 开发的社区系统
⚡ :closed_book:《Node.js 包教不包会》 by alsotang
⚡ :blue_book:async.js 各种函数的 demo
⚡ :heart_eyes: Writing Fast JavaScript
⚡ Determine if a string is all Chinese(based on unicode range)
⚡ Generate arbitrary size file on Cloudflare Workers
Activity
Jan
25
2 days ago
Jan
24
3 days ago
Jan
21
6 days ago
started
started time in 5 days ago
Jan
8
2 weeks ago
Activity icon
issue

alsotang issue jaredwray/keyv

alsotang
alsotang

unexpected undefine after I set the value

const Keyv = require('keyv');
const path = require('path')

const keyv = new Keyv(`sqlite://${path.join(__dirname, 'database.sqlite')}`);

async function main() {
  let v = await keyv.get('foo')

  console.log(v)

  await keyv.set('foo', 'bar', 1000)

  v = await keyv.get('foo')

  console.log(v)
}

main()

image

When await keyv.set('foo', 'bar', 1000) this line is executed, the get result should absolutely return a value but it is not.

You can debug the bug by running the script every second.

started
started time in 2 weeks ago
Jan
6
3 weeks ago
started
started time in 2 weeks ago
Jan
1
3 weeks ago
Activity icon
issue

alsotang issue comment desmondmorris/node-tesseract

alsotang
alsotang

⚠️ This project seems abandoned

No commits since 2017. Here is a new and improved version: https://github.com/zapolnoch/node-tesseract-ocr

Dec
29
4 weeks ago
Activity icon
issue

alsotang issue tucnak/telebot

alsotang
alsotang

The project is not golang style and there are too many `interface {}`

I read the readme and found some APIs are very flexible such as Handle and Send. When jumping to the implements, I don't think they are designed fine.

Though the API seems beautiful in a way, it lost the protection of the type system. The type system can't prevent the programmer to call the function with the correct type. All type errors occur at runtime. It makes me feel that I am using a dynamic language but not a statically typed compile language.

A golang project should not sacrifice the beauty of internal(e.g. statically typed) for beauty of the surface.

The type system of golang is straight and simple. It doesn't have function overloading. The correct way to support multiple type is split Send to SendString and Send, the latter is used for Sendable type.

started
started time in 4 weeks ago
Dec
22
1 month ago
Activity icon
created branch
createdAt 1 month ago
Dec
17
1 month ago
started
started time in 1 month ago
Dec
16
1 month ago
Previous