Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

New answers tagged

2

A short review; Your implementation of _buildConnectRequest and _buildAnnounceRequest is missing, it would have been interesting to review that I am not a big fan of using underscores to denote private methods. If you run version 12 or later of Node, you can prefix with # to denote private functions. Your code does not support IPV6 at all. You will have to ...


3

Follow some standards, use code linting (for example ESLint) and code formatting (for example Prettier), try to prevent code duplication as much as possible, use design patterns and don't complex things. Those things will make your code more readable for others. There is no right or wrong while the code works and it's easy to read. Martin Fowler. Any ...


1

(Extension of my comment above) It would be a better idea to use literal Unicode rather than HTML entities. The advantage of Unicode characters is that they are usable universally and not only when outputting HTML. If you don't like the literal characters in the source code, or find them hard them to read, then you can use JavaScript escape sequences with ...


4

Ways of improving/optimizations: What fixApostrophes and fixDashes functions actually try to do is replacing a specific punctuation chars with respective HTML entities. Instead of those numerous horrifying while loops - a more optimized, concise and extendable approach would be to: compose a predefined replacement map (where keys are search patterns and ...


Top 50 recent answers are included