Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

typescript style type

type ComponentProps = {
	styles: React.CSSProperties 
}
Comment

typescript style guide

Casing:
  Long: easier to read throug in lists
    MACRO_CASE: constants, enums 
  
    kebap-case: file names, paths
  
    snake_case: API I/O, object properties, variables, function/method attributes. 

  Short: less characters allow us to fit more meaning; e.g. when we extend or scope an entity (both good practices) the name tends to grow 
    camelCase: functions, methods, GraphQL actions
    
    PascalCase for classes and interfaces, cloud infrastructure resource names

Grammar
  variable: a noun (an object or a collection of objects)
  
  function: a verb (an action) against a noun with optional adjunct (e.g. ...FromSomewhere, ...BySomeCriteria)
    When the input attributes are more than two => nest them in a `config` object for readability.
    Prefix private methods with an underscore to be easily distingushable from non-private methods.
    
  interface: descirption of a noun and/or a verb 
    Not putting commas at the end ot each attribute make it an interface declaration easily distinguishable from a an object declaration

  enum: a list of limited options
    key - capital case with underscore
    value - kebap case; If needed we can switch to short casing at any time with simple util like `toPascalCase()`
Comment

PREVIOUS NEXT
Code Example
Typescript :: typescript interface define a map key value pairs 
Typescript :: how to print certain elements of an array 
Typescript :: components of selenium 
Typescript :: typescript initialize object 
Typescript :: ioredis 
Typescript :: get distance beetwen two points roblox 
Typescript :: behaviour 
Typescript :: Line 23:12: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images 
Typescript :: how to make the inputs become a sum python 
Typescript :: list of elements in watir 
Typescript :: // running tests Your code should no longer have a p tag around the text asking what level ninja a user is. // tests completed category:423 
Cpp :: fast i/o c++ 
Cpp :: list conda environments 
Cpp :: c++ inline 
Cpp :: platform io change baud rate 
Cpp :: string hex to int c++ 
Cpp :: std::string to qstring 
Cpp :: cpp sample code 
Cpp :: how to ensure the user inouts a int and not anything else c++ 
Cpp :: compile multiple files C++ linux 
Cpp :: ue4 get size of viewport c++ 
Cpp :: error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/ 
Cpp :: how to output to a file in c++ 
Cpp :: change int to string cpp 
Cpp :: qt qimage load from file 
Cpp :: max element in vector c++ 
Cpp :: c++ find key in hashmap 
Cpp :: c++ find sum of vector 
Cpp :: prime number in c++ 
Cpp :: binary string addition 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =