Stoicism

The best guides: Seneca and Marcus Aurelius.  Their teachings are sobering but consoling. Feel heroic and defiant in the face of our many troubles.

Stoicism can help with the following problems:

  • Anxiety – Stoics propose to courageously come on terms with the very worst possibilities. We will cope no matter what it will happen.
  • Fury – angry is caused by an incorrect picture of existence, the collision of hope and reality. In order to be happy expect far less from life. Reach a state where simply nothing could suddenly disturb your peace of mind.
  • Paranoia -Don’t wonder why it happened to you. It may neither be your nor anyone else’s fault.
  • Loss of perspective – Contemplation of the heavans. Nothing that happens to us is of any consequence whatsoever from the cosmic perspective.

Plato’s philosophy

How to make people more fulfilled?

  • Think harder – bring clarity and order to your mind, don’t follow the popular ideas about love, fame and money
  • Love more wisely – love is a kind of education. Love should be two people growing together and helping each other. You need to get together with a person that have the virtues you don’t have. Enter relationships  less combative  and commit to help your partner to become a better version of himself
  • The importance of beauty – Almost everyone likes beautiful things because they are seen like a part of « the good ». Art. Censorship of the arts. The artists must use the power of the art wisely.
  • Changing society
    • new heroes, models for everyones’ good development
    • censorship – avoid dangerous preachers
    • better education – next generation should be brought by people more qualified than their own parents.

Interests and skills

Interests – things you want to learn about or activities you like

Skills – abilities natural or learned to do things well

  • functional skills – things you do, strengths you have from birth.
  • subject skills – things you know, your expertise
  • personal trait skills – ways you act, ways you handle yourself and interact with the world

The mix of these three kinds of skills makes you unique.

 

7 steps you need to do when you are searching for a job

  1. Identify your skills and areas of interests
  2. Create a professional profile (add information about education, past work experience, special trainings, hobbies and interests)
  3. Read and understand a job description
  4. Application – Resume – a written document of one’s employment, education and skills
  5. Application – Cover letter – introduce the job seeker, show qualifications and formally apply for a job
  6. Networking – a way to introduce yourself to future employers
  7. Interview – demonstrate how you are qualified for the job

Interfaces fundamentals – notes

An interface is a group of public members that defines a contract. It is a group of related functions that can belong to a class or struct. In order to fulfil the contract you must supply implementations for all of the interface members. The compiler will enforce the implementation.

An abstract class can contain members with different access modifiers. Interfaces contain only public members and only properties, methods, events and indexers. Constructors and destructors are specific to a particular class, they don’t belong in a general contract.

Abstract class biggest strength is that it can contain implementation code that is shared among all of child classes but its biggest disadvantage is that it can inherit only one base class.

Interface biggest strength is that you can use any number of interfaces but there is no shared code implementation, it contains only definitions.

Updating an interface – Adding or removing members will break implementation or break usage. You can use inheritance to add an interface.

Interface explicit implementation – when two methods have the same name and parameters but the return type is different.

 Program to an abstraction (interface) rather than a concrete type (class).

Using interfaces makes the code maintainable, extensible and easily testable. When using an interface you don’t need to care about the implementation details.

The repository pattern – mediates between the domain and data mapping layers using a collection like interfaces for accessing domain objects. It separates the application from the data storage technology.

Interface Segregation Principle – the I in SOLID. Clients should not depend upon methods that they do not use. Interfaces belong to clients, not hierarchies. Granular interfaces that include only the members that a particular function needs.

Example: the class List<T>. It implements Ienumerable<T> for iterating over a collection, data bind to a list control,use linq,  ICollection<T> for adding and removing items in the  collection, counting and clearing it, IList<T> for more control.

Dependency injection – the goal is to create loosely coupled code by making something else responsible for dependent objects. Patterns: Constructor Injection, Property Injection, Method Injection, Service Locator. Use a Dependency Injection Container.

Mocking – Provide behaviour  for the methods we plan to use. Use a Mockup Framework.

About .Net Standard

The .NET ecosystem is available as a stack for any kind of developer (mobile, desktop, cloud, Windows or non-Windows). Every platform has a different base class library so if you want to encapsulate parts of your application (or create a new library ) that will run on all platforms you will need implementations for each platform. So, the solution was to unify all these base class libraries into one base class library called .NET Standard. This way, a developer can master only one base class library, the code reuse targets a big surface area and the .NET Standard can grow faster without updating any platforms.

.NET Standard is a specification and in the same time a type of class library with a set of APIs that the current and future platforms have to implement.

.NET Standard will replace Portable class libraries.

Higher versions of .Net Standard will incorporate all APIs from previous versions.

Specific platforms of .NET implements specific version of .NET Standard.

How do you choose what version of .NET Standard to target?

  • the higher the number of the version of .NET Standard is the more APIs you have available
  • the lower the number of the version of .NET Standard is the more platforms you can run on (the more .NET platforms implemented the standard)

Read more about .NET Standard: https://github.com/dotnet/standard

The catalog of APIs – https://apisof.net/

 

About OWIN

Web is evolving fast and web development needs to keep up with it.
One solution is to have an abstraction between the web appplication and the web server.
OWIN (Open Web Server Interface for .NET) – standard interface between .NET web servers and web applications. It decouples server and application. There is no code for OWIN, there are only just specicifications for the real implementation of a custom web server.

OWIN defines a standard interface for web servers and .NET client applications and Katana and Nowin are some implementations.
OWIN runs on the server, answers to HTTP requests, and forwards them to its middleware.

IIS – a super-tested web server but its biggest limitation is that it is related to the OS.

OWIN is not related to the OS, you can build your custom host and add whatever you want in the HTTP request processing pipeline.
The OWIN specs define four layers:
Host: where the server is launched and startup
Server: This is the actual HTTP server, the one binding to the network socket to listen to
requests and sending them to the pipeline of OWIN middleware components.
Middleware: components that stand between the server and the final
application code, and handle the requests sent through the OWIN pipeline(a logger or a full web frameworks like
Web API or SignalR). As far as the server is concerned, a middleware component is
anything that implements the application delegate.
Application: the specific application code, possibly built on top of a web
framework.

SOLID Principles

Single Responsibility Principle – the methods and classes should focus on doing one thing and doing it well

Open Closed Principle – extend the classes instead of modifying them – Open for extension, closed for modification. Imagine you want to add a basement to your house. You don’t want to change the code that is already in production.

Liskvov Substitution Principle – Derived classes can stand in before base classes – Code against an interface.

Interface Segregation Principle – Make fined grained interfaces client specific –

Dependency Inversion – Depend on abstractions, not concrete implementations

 

HTML and Javascript notes

Semantic Markup – text data that is annotated with a special language to offer more sense or meaning to the text.

SGML (Standard Generalized Markup Language) permitted to researchers to format their documents

HTML – an extension of SGML.

Tim Berners-Lee published aWorldWideWeb – a system of hypertext documents viewed by software named browsers in a client-server architecture.

World Wide Web Consortium (W3C)

Web browser – a gateway to the web-application (retrieve and present the content,allow navigating through different web pages)

 

Things any programmer should know #4

  • A good bug report must express three things:
    • how to reproduce the bug
    • what should have happened, in your opinion
    • what actually happened, with as much information as you can record
  • You can improve code by removing it. You Aren’t Gonna Need It.
  • Remove all you warnings or deal right away with a warning when it appears. You need to get rid of the noise.
  • Know your IDE but try working with command-line build tools, they can help look under the hood and understand what is going on.