Current mission: update the SoyBooru tag dictionary by clicking the ? button next to tags, inserting the TagDefinition template, and filling it in.

SNCA:C#

From Soyjak Wiki, the free ensoyclopedia
Jump to navigationJump to search
The average C# user.

C# is a general purpose programming language made by Microsoft, and is very similar to Java. It is also a C-derived language and has some similarities to C++ as well. It runs on the .NET runtime. Some game engines like Unity and Godot use C# for scripting. Five Nights at Cobson's was written in C#. You can use C# for basically everything you can use Java for. Because C# was created by Microsoft, it is mostly oriented towards Windows, it is cross platform however and can be run on Linux as well.[1]

Soyteens are in debate over whether C# or Java is better. Some people prefer C# because it also has a massive standard library like Java, while providing many modern language features such as nullable types and better null safety, null coalescing, LINQ, and better native interfacing. Despite this, Java still has a very mature ecosystem and is thus sometimes easier to find libraries for Java than it is for C#, and because of the historical dominance of the JVM platform.

Unlike Java which compiles to .class files, C# compiles to .dll (dynamic linked library) files. Although C++ also does compile to .dll files, C++ DLLs and C# DLLs are distinct and not compatible.

Its package manager is NuGet and is used to add packages that contain assemblies that allow you to JSID, which provide namespaces and classes like Microsoft.Web.WebView2, Newtonsoft.Json (ev&oe you should just use System.Text.Json because it's official) and Microsoft.XNA.Framework.

History[edit | edit source]

C# was created by Anders Hejlsberg of Microsoft and Minecraft fame and released in 2000. It was obviously inspired by Java and has very similar syntax.

Example[edit | edit source]

namespace SoyjakParty.Examples;

using System;

// class is sealed so it can't have derived classes much like how troons can't have children
public sealed class Tranny
{
    /// <summary>
    /// Determines whether the tranny should ack based on a given probability.
    /// </summary>
    /// <param name="ackProbability">An integer between 0 and 100 representing the chance of acking.</param>
    /// <returns>True if the random probability is less than the ackProbability; otherwise, False.</returns>
    private static bool ShouldAck(uint ackProbability) =>
        Random.Shared.NextDouble() < Math.Clamp(ackProbability, 0u, 100u) / 100.0;

    /// <summary>
    /// Main function that decides whether to ack or print "TRANS RIGHTS ARE HUMAN RIGHTS!!!!".
    /// </summary>
    /// <param name="args">An array of command line arguments.</param>
    public static void Main(string[] args)
    {
        if (ShouldAck(41))
        {
            throw new SystemException("ACK!!!!");
        }
        else
        {
            Console.WriteLine("TRANS RIGHTS ARE HUMAN RIGHTS!!!!!!!!");
        }
    }
}

Snopes

C Sharp is part of a series on Computing

LOW LEVEL

AssemblyCC++C#Holy CRust

HIGH LEVEL

JavaGoPHPPythonSQLBashJavaScriptPowerShellActionScriptScratchRubyLua

MARKUP

HTMLCSSXML

IMAGEBOARDS

nusoiVichanYotsubaOpenYotsuba

FILE FORMATS

SVGGIFWEBMWEBP

OPERATING SYSTEMS

WindowsLinuxAndroidTempleOSBSD

MISC

BabybotMcChallengeSystemdMS PaintJS PaintPhotoshopFlashIRCAd blockingDark Web

AI

ChatGPTGeminiGrokVibe codingGenerative AIStable Diffusion