22: What does it all mean? - Part 2

18 Nov 2022

Following on from the last podcast as we ran out of time - we discuss loads more acronyms

Random fact

One of the oldest symbol / abbreviations in the English language: X, XXX and XXXX - lots of meanings historically Most people recognize X as the roman numeral for the number 10, one of the earliest and most common uses for X in English is as a symbol for a kiss. This usage dates back to the Middle Ages, when X was signed to represent the Christian cross at the end of a letter. The signer would then seal the document with a kiss to show sincerity. By the 1760s, this practice had evolved and spread all over the globe and people signed letters using XOXO (kisses and hugs). The salutation has since evolved again to become the kiss-only signature XXXX in modern texts, chat messages, and emails. More recently In the kitchen for confectioners’ sugar: Used to denote how fine a particular confectioners sugar is. It is graded from XXX to 14X, with a higher number of X’s corresponding to a more finely ground product X was certified as a rating for adult content by the Motion Picture Association in 1968 XXX can also denote a strong malt liquor (aka a strong beer, fermented bottom up) in some countries Also a Vin Diesel film and an Aussie beer brand!

Introduction

Carry on from Part 1 - .Net Terminology and abbreviations and General Programming terminology

PCL - Portable Class Libraries (pre .Net Standard)

Portable Class Libraries (PCLs) are considered deprecated in the latest versions of Visual Studio. While you can still open, edit, and compile PCLs, for new projects it is recommended to use .NET Standard libraries to access a larger API surface area.

LINQ - Language Integrated Query (Introduced in .Net Framework 3.5) (https://en.wikipedia.org/wiki/Language_Integrated_Query)

Query syntax

from person in Context.People
where person.Age > 18
select person.Address

Method Syntax

var result = person.Where(x => x.Age > 18).Select(x => x.Address)
  • sits on top of the IEnumerable extension methods such as Where, Select, Aggregate etc
    • LINQ operators are mapped to an IEnumerable extension method

Lambda

Expression lambdas - (input-parameters) => expression

Statement lambdas - (input-parameters) => { }

TPL - Task Parallel Library (released on .Net 4.0) - making it easier to run multiple tasks at the same time - easy Threading

  • Task (new abstraction) over threading - makes parallel and async programming easier

The purpose of the TPL is to make developers more productive by simplifying the process of adding parallelism and concurrency to applications.

ASYNC/AWAIT (released on .Net 4.0) - no more onBegin / onFinish etc - all happens behind the scenes in the compiler now

PLINQ - part of TPL - Parallel LINQ - PLINQ implements the full set of LINQ standard query operators as extension methods for the System.Linq namespace and has additional operators for parallel operations. PLINQ combines the simplicity and readability of LINQ syntax with the power of parallel programming.

var source = Enumerable.Range(1, 10000);

var evenNums = from num in source.AsParallel()
               where num % 2 == 0
               select num;
Console.WriteLine("{0} even numbers out of {1} total",
                  evenNums.Count(), source.Count());

Async IEnumerable (async iterator)

public async Task<IReadOnlyCollection<Customer>> GetCustomers()
{
    var customers = await httpClient.GetFromJsonAsync<List<Customer>>("/api/customers");
    // all the customers are in memory by the time we return from this method
    // no real need to use IAsyncEnumerable<T> here
    return customers;
}
public async IAsyncEnumerable<Customer> GetCustomers()
{
    var continuationToken = "";
    do
    {
        var page = await httpClient.GetFromJsonAsync<CustomerPage>
            ($"/api/customers?continuationToken={continuationToken}");
        foreach (var c in page.Customers)
        {
            yield return c;
        }
        continuationToken = page.ContinuationToken;
    } while (!String.IsNullOrEmpty(continuationToken));
}

Compilation - JIT Vs AOT:

JIT - Just in time compilation

  • IL to machine byte code - good for smaller apps, optimizations can be made as compilation is happening on the specific target machine.
  • JIT compiler can make optimization decisions as it has all the information available as it is on the target machine
  • Good if machine has enough resources to JIT

AOT / R2R (.NET 7 only?) - Ahead of time compilation - compile as R2R binaries (Ready to Run)

  • binaries are bigger as they contain both IL and native code - IL is still required in some instances - between 2 to 3 times larger
  • First use of any code in the application may be faster
  • Has the biggest benefit for apps with large amounts of code receive a greater performance benefit - less code compiled from IL to native at runtime. Apps with a small amount of code will see less benefit
  • there are 2 ways to publish your app as Ready2Run:
    1. dotnet publish -c Release -r win-x64 -p:PublishReadyToRun=true

    2. Add a property to the project file:

      <PropertyGroup>
      <PublishReadyToRun>true</PublishReadyToRun>
      </PropertyGroup>
      

      publish the application without any special parameters:

      dotnet publish -c Release -r win-x64

XAML - Extensible Application Markup Language - declarative xml based language for initializing structured values and objects - came to the forefront with Silverlight and WPF

Actions - Encapsulates a method that has a single parameter and does not return a value.

Action<int> cw = i => Console.WriteLine(i);

Delegates - A delegate is a type that represents references to methods with a particular parameter list and return type. When you instantiate a delegate, you can associate its instance with any method with a compatible signature and return type. You can invoke (or call) the method through the delegate instance.

public delegate int PerformCalculation(int x, int y);

Funcs - Encapsulates a method that has one (or more) parameters and returns a value of the type specified by the TResult parameter - **Func<T,TResult>

Func<int, int, int> randInt = (n1, n2) => new Random().Next(n1, n2);

POCO - Plan old CLR objects, came from POJO in the Java world, not to be confused with MOFO!!

MAUI - .NET Multi-platform App UI (.NET MAUI) - don’t know much about this! It’s new and shiny!

General programming abbreviations

DevOps - Combines Software Development and IT Operations

CI - Continuous Integration

CD - Continuous Delivery

UI - User Interface

UX - User Experience

GUI - Graphical User Interface

DI - dependency injection

IOC - inversion of control

HTML - Hyper Text Markup Language

XHTML - EXtensible HyperText Markup Language

HTTP - Hyper Text Transfer Protocol

JS - Javascript

JSX - JavaScript Syntax Extension

NPM - Node Package Manager

NVM - Node Version Manager

TS - Typescript

CSS - Cascading Style Sheets

SASS - Syntactically Awesome Style Sheets - CSS preprocessor

LESS - Leaner Style Sheets - CSS preprocessor

Transpiler / Transcompilation - transpose from one language to another - for a example transpile from C# to JS

Compiler - translates code written in one language (the source language) into another language (the target language)

Interpreter - a program that can analyse and execute a program line by line

RSS (Really Simple Syndication)/ATOM (Atom Syndication Format) - feed

JSON (schema)

XML

GRPC

GraphQL

3-Tier

Mark-up - any sort of mark-up language like HTML

Script - any interpreted code that can be run. It is interpreted and executed at runtime

  • Examples:
    • Database scripts, written in SQL
    • Front end script, most likely written in JavaScript (JS)

Code - generally code that is compiled before execution, although can be used to cover code in a script

DB - Database

DBMS - Database management system

RDBMS - Relational database management system

SQL - Structured Query Language (SEEQUEL)

NoSQL - Non-SQL or non-relational - data modelled in means other than the tabular relations used in relational databases

PR - Pull Request

GitFlow - a branching strategy made popular originally by Atlassian

DDD - Domain Driven Design

TDD - Test Driven Design

BDD - Behavioural Driven Design

REST / RESTful - Representational State Transfer - style of api design built on HTTP

API - Application Programming Interface - an interface that is available for consumption by automated processes

Pub / Sub - Publish and Subscribe - a style of application design that seeks to reduce component coupling where events are published to subscribers. The publisher is unaware of who / what / where the publishers are, rather it broadcasts events and the subscribers consume these events

CQRS - Command Query Responsibility Segregation - a style of application design where the responsibility of querying is separated from the responsibility of command execution. This design seeks to reduce contention between query and command operations

Event sourcing - is an architectural pattern in which entities do not track their internal state by means of direct serialization or object-relational mapping, but by reading and committing events to an event store - an event store is a type of database optimized for storage of events.

K8 - Kubernetes - An open source system for automating deployment, scaling and management of containerized applications

Container - a lightweight virtual machine of sorts. Used to deploy, host and manage software. Containers are used to abstract applications from physical environments in which they are running. A container packages all dependencies related to a software component and runs them in an isolated environment.

VM - Virtual Machine

IDE - Integrated Development Environment - an application to aide development that can compile and host built code to allow developers to write and test code

  • Visual Studio has always been the main Microsoft .NET IDE
  • VS Code - now pretty much is with the right extensions added, although its default installation does not establish it as an IDE

OS project/utility of the week

GIMP (GNU Image Manipulation Program) is a free and open-source raster graphics editor used for image manipulation (retouching) and image editing, free-form drawing, transcoding between different image file formats, and more specialized tasks.

Extensibility & Flexibility

GIMP provides extensibility through integration with many programming languages including Scheme, Python, Perl, and more.

The result is a high level of customization as demonstrated by the large number of scripts and plug-ins created by the community.