N 0.2.0
Requires NuGet 4.0 or higher.
dotnet add package N --version 0.2.0
NuGet\Install-Package N -Version 0.2.0
<PackageReference Include="N" Version="0.2.0" />
paket add N --version 0.2.0
#r "nuget: N, 0.2.0"
// Install N as a Cake Addin
#addin nuget:?package=N&version=0.2.0
// Install N as a Cake Tool
#tool nuget:?package=N&version=0.2.0
N - The Library for World's Smallest C# Program "That Does Something"�
Tired of boilerplate? Then N is for you!
Blog Post
World's Smallest C# Program (featuring N
)
Small Programs
Install N
and all you need for a full C# program in Program.cs
is
(at 4 characters):
N();
Want to increment?
++I;
or
I++;
Decrement?
--I;
or
I--;
Absolutely need to assign something?
I=0;
or
I=I;
Declare a variable for a reference type (with warning) - this doesn't really do much:
O o;
or for a value type (with warning):
S s;
In addition, N
let's you write the smallest programs featuring
specific constructs:
Want to be asynchronous? World's Smallest C# async/await Program (8 characters)
await T;
Want to return a code? (9 characters)
return I;
Need a while loop (9 characters):
while(B);
or for loop (9 characters):
for(;B;);
or do while loop (13 characters):
do{}while(B);
Need to new something up (7 characters).
new O();
What about args
? N
s got you covered (8 characters).
N(args);
Remember the GetAwaiter()
loop hole? N
let's you await an integer (8 characters).
await 1;
Need to dispose with using:
using(D);
Want to just return? You don't need N
😉
return;
Want to do nothing? You don't need N
😉
{}
This should be the world's smallest C# program out-of-the-box in .NET 5+ and C# 9+.
Supported Frameworks and Language
.NET Standard 2.0+ C# 10+
Product | Versions |
---|---|
.NET | net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows |
.NET Core | netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1 |
.NET Standard | netstandard2.0 netstandard2.1 |
.NET Framework | net461 net462 net463 net47 net471 net472 net48 net481 |
MonoAndroid | monoandroid |
MonoMac | monomac |
MonoTouch | monotouch |
Tizen | tizen40 tizen60 |
Xamarin.iOS | xamarinios |
Xamarin.Mac | xamarinmac |
Xamarin.TVOS | xamarintvos |
Xamarin.WatchOS | xamarinwatchos |
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.