An open API service indexing awesome lists of open source software.

https://github.com/av3boy/if-optimizer

Input your source code as text and the optimzer will clean your code by preferences (WIP)
https://github.com/av3boy/if-optimizer

Last synced: 10 months ago
JSON representation

Input your source code as text and the optimzer will clean your code by preferences (WIP)

Awesome Lists containing this project

README

          

# If-optimizer
Input your source code as text and If-Optimzer will cleanup your code!

## TODO

Categorize refactoring and optimizational functionalities

Refactoring functionalities

Optimization functionalities

Add Functionality for
- C#
- JavaScript

Handle Conditional operator
https://docs.microsoft.com/en-us/cpp/cpp/conditional-operator-q?view=msvc-170

Check block root. block return type

If (with brackets)
If (without brackets)
If (Returns a value from method)
If statement latter parentheses may be on another line

Value tuples

Nesting

nullish coalescing

[monadish transformations](https://youtu.be/C2w45qRc3aU?t=255)

optional chaining

https://en.wikipedia.org/wiki/Abstract_syntax_tree

Ternary Operator (?:)

guard clauses

expression trees

Short Circuits

Else (with brackets)
Else (without brackets)

Else If (without brackets)
Else If (with brackets)

MVP:
C# version: .NET standard 2.0
JS version: ES6

Later versions:
c# Language Version select support

## References

http://dontcodetired.com/blog/post/Whats-New-in-C-10-Reclaim-Horizontal-Editing-Space-and-Simplify-Nesting