Skip to main content
Code Review

Return to Answer

deleted 173 characters in body
Source Link
vog
  • 209
  • 2
  • 7

You should move all require(...) calls to the very beginning of your code, instead of running require on each place locally.

In its current form, you won't see require errors until your server runs and receives its first requests. This is unfortunate. You usually want a program to fail as early as possible if it clearly won't work. Rule of Repair: Repair what you can — but when you must fail, fail noisily and as soon as possible.

This principle is also an important part of the Rule of Repair in TAOUP :

Rule of RepairRule of Repair (TAOUP): Repair what you can — but when you must fail, fail noisily and as soon as possibleas soon as possible.

You should move all require(...) calls to the very beginning of your code, instead of running require on each place locally.

In its current form, you won't see require errors until your server runs and receives its first requests. This is unfortunate. You usually want a program to fail as early as possible if it clearly won't work. Rule of Repair: Repair what you can — but when you must fail, fail noisily and as soon as possible.

This principle is also an important part of the Rule of Repair in TAOUP :

Rule of Repair: Repair what you can — but when you must fail, fail noisily and as soon as possible.

You should move all require(...) calls to the very beginning of your code, instead of running require on each place locally.

In its current form, you won't see require errors until your server runs and receives its first requests. This is unfortunate. You usually want a program to fail as early as possible if it clearly won't work.

Rule of Repair (TAOUP): Repair what you can — but when you must fail, fail noisily and as soon as possible.

Source Link
vog
  • 209
  • 2
  • 7

You should move all require(...) calls to the very beginning of your code, instead of running require on each place locally.

In its current form, you won't see require errors until your server runs and receives its first requests. This is unfortunate. You usually want a program to fail as early as possible if it clearly won't work. Rule of Repair: Repair what you can — but when you must fail, fail noisily and as soon as possible.

This principle is also an important part of the Rule of Repair in TAOUP:

Rule of Repair: Repair what you can — but when you must fail, fail noisily and as soon as possible.

default

AltStyle によって変換されたページ (->オリジナル) /