BY Simmi Kava26 Aug 2021 Edit
JavaScript/TypeScript Development Guidelines

Coding Guidelines


  • Use module pattern whenever possible. But do you know the reason why? Let me explain it to you.

    -- Modules are executed within their own scope and not in global scope.

    -- Code reusability.

    -- Encapsulation

    -- Load on demand

    -- Easier testing

  • Avoid using namespace if modules is a possibility. Why? As you might end up importing the whole standard namespace into your program which may not be required.

  • Organize single class into a single file.

  • Import only required module and retain naming convention.

  • Use default export for 1 major class and named export for less frequent or related classes

  • Refrain from using underscore (_) anywhere, not in field name or get/set. Why? As such a naming convention indicates a name is meant for internal use. TSLint doesn't respect the underscore pattern naming convention.

  • Do not create async if only last return statement has await. Do not omit async/await when catching exceptions.

Will share another article on async tips soon! Till then happy learning.

BY Simmi Kava
LikeCommentSave
LikeCommentSaveShare
0

POPULAR POSTS
17 Mar 2021
LATEST ACTIVITY
srikanth.naidu
liked this post.
malli
saved this post.
Show more
ARCHIVES
2021
2020
2019
2018
TAGS
javascript (41)
developer (25)
javascriptdeveloper (15)
coding (10)
Xamarin.Forms (10)
webatoms (8)
arrays (7)
xamarin (7)
android (6)
typescript (6)
function (5)
csharp (4)
iOS (4)
methods (4)
object (4)
update (4)
web-atoms (4)
arrayoperation (3)
decorators (3)
programming (3)
prototype (3)




Web Atoms: JSX (TSX + TypeScript) for Xamarin.Forms, Hot Reload Your App in Production Environment

PlaygroundSamples Repository