Category: dev thoughts

[2020]Activities

ADCES Presentations:

 

  1. Various methods of loading plugins in .NET Core
  2. Docker for Developers
  3. What’s new in Angular 9
  4. Ce a fost nou la Build 2020 (Windows Terminal , C# 9 , MAUI)
  5. ASP.NET Core HealthCheck
  6. Activity , OpenTelemetry and Jaeger for tracing microservices
  7. Testing .NET Core WebAPI
  8. WEB API Best Practices
  9. .NET 5 What’s new and awesome

You can find those at https://ignatandrei.github.io/Presentations/

Also, finding presenters for ADCES monthly meetings – see https://www.meetup.com/Bucharest-A-D-C-E-S-Meetup/

Also, I am now speaker in https://dotnetfoundation.org/community/speakers/ignat-andrei

Open Source Software

 

  1. Skinny Controllers Generator –  Generate actions with Roslyn : Source . Blog
  2. SideCarCLI  – run and intercept any (Console ) application : Source. Blog
  3. HealthCheck for version: Source. Blog
  4. Covid data – with Bogdan Bobe  . Source. BlogDemo
  5. WebAPI2CLI . Blog . Source

 

Books

 

  1. Console2SAAS – book with Daniel Tila about transforming Console App to SAAS : Free : https://ignatandrei.github.io/console_to_saas/consoleToSaas.pdf.html .  Amazon: https://www.amazon.com/dp/B08N56SD4D ( with a  free consulting gig). Blog

 

Work

  1. Passing from monolith to (micro)services.
  2. Going to the DevOps route .
  3. Coordinating the Romanian Farm for EA.

 

 

Software Year 2019 in review

This is what impressed me in 2019

  1. On 8 January https://blog.github.com/2019-01-07-new-year-new-github/
  2. On 21 January https://java.com/en/download/release_notice.jsp : Public updates for Oracle Java SE 8 released after January 2019 will not be available for business, commercial or production use without a commercial license.
  3. On 8 February Ie default browser
  4. On 12 February https://www.bleepingcomputer.com/news/security/windows95-v20-lets-you-play-doom-wolfenstein-3d-and-more/
  5. On 7 March Microsoft Calculator implementation
  6. On 13 March https://send.firefox.com/
  7. On 29 March https://www.redhat.com/en/blog/future-through-software-developers-red-hat-key
  8. On 3 April https://docs.microsoft.com/en-us/visualstudio/releases/2019/release-notes
  9. On 18 May https://arstechnica.com/gadgets/2019/05/microsoft-open-sources-algorithm-that-gives-bing-some-of-its-smarts/
  10. On 23 May https://blog.stephenwolfram.com/2019/05/launching-today-free-wolfram-engine-for-developers/
  11. On 24 May Photo to OCR to Excel
  12. On 2 June https://devblogs.microsoft.com/typescript/announcing-typescript-3-5/
  13. On 2 June https://blog.angular.io/version-8-of-angular-smaller-bundles-cli-apis-and-alignment-with-the-ecosystem-af0261112a27
  14. On 7 June https://techcrunch.com/2019/06/05/microsoft-and-oracle-link-up-their-clouds/
  15. On 11 June UIPath – with CoreWF
  16. On 11 June CoreWCF – community : https://www.infoq.com/news/2019/06/WCF-Decision/
  17. On 12 June Salesforce is buying data visualization company Tableau for $15.7B in all-stock deal
  18. On 24 June https://www.raspberrypi.org/blog/raspberry-pi-4-on-sale-now-from-35/
  19. On 25 July Oracle EF Core
  20. On 5 August https://mspoweruser.com/microsoft-will-disable-vbscript-in-internet-explorer-11-from-this-month/
  21. On 2 September https://www.oracle.com/database/technologies/appdev/dotnet/odtvscodequickstart.html
  22. On 11 September https://www.zdnet.com/article/java-finally-goes-all-in-on-open-source-with-the-release-of-jakarta-ee-8/
  23. On 14 October https://www.oracle.com/cloud/free/
  24. On 9 November TypeScript 3.7
  25. On 11 December https://techcommunity.microsoft.com/t5/Microsoft-Teams-Blog/Microsoft-Teams-is-now-available-on-Linux/ba-p/1056267
  26. On 11 December .NET Core 3.1

What I have done in 2019–and goals for 2020

In 2019

  1. I have learned
    • .NET Core  – up to the version 3.1
    • Angular-  up to the version 8.0
    • Docker –  up to the 19.3
    • TypeScript –up to 3.7
    • JavaScript frameworks for backend and mono-repo
  2. I have started
  3. Coordinating automation work at the office ( I am TD at EA )
  4. Written this blog and series about
  5. Become an MVP again https://mvp.microsoft.com/en-us/PublicProfile/4025203?fullName=Ignat%20Andrei
  6. Organizing 12 ADCES meetings – Bucharest meetup about .NET and programming technologies : https://www.meetup.com/Bucharest-A-D-C-E-S-Meetup/
  7. Speaking at various conferences about .NET Core and Angular – see my previous MVP track

For 2020 I want

  1. Keep learning new versions of .NET Core / Angular / TypeScript / Docker
  2. Start learn AI / ML so I can be proficient ( starting point my InfoValutar)
  3. Finish migrating InfoValutar to Azure
  4. Continuing ADCES
  5. Continuing blogging ( this blog!)
  6. Speak at conferences
  7. Doing good work at the office
  8. Starting again the video series about tools in 5 minutes – maybe separating in C# and general programming tools ?
  9. Become MVP again

Basically, the same thing as for this year.

Intermezzo–options for loading multiple providers of data – part 10

We have 2 national banks –  and we gather exchange rates from there. What if we want to add more banks  -or let other programmers to add their dll’s to our software to just display the exchange rates from other banks ?

 

Option 1: HardCode all the list


var l = new List<IExchangeRates[]>
{
new GetFirstBank()),
new GetSecondBank()),

};

Option 2: Reading from some config file the list of classes – letting DevOps to modify the config file

var l = new List<IExchangeRates[]>;

foreach(var line in File.ReadAllLines(“myListOfExchangeRates.txt”){

IExchangeRates r= Activator.CreateInstance(Type.GetType(line)) as IExchangeRates ;

l.Add ( r );

}

Option 3: Reflection – in the current assembly or in all assemblies to load the classes that implements the interface to load the data

var typeToFound = typeof(IExchangeRates);
Assembly a = Assembly.GetExecutingAssembly();
var types = a.GetTypes()
.Where(it=>it.IsPublic)
.Where(it => it.GetInterface(typeToFound.FullName)!=null)
.ToArray();
foreach(var t in types)
{
recognizes.Add(Activator.CreateInstance(t)as  IExchangeRates);
}

Option4 Load as plugins

use the library from  https://github.com/natemcmaster/DotNetCorePlugins/blob/master/samples/hello-world/HostApp/Program.cs  and there are 2 lines , basically:

var loader = new LoadExchangeProviders("plugins");
var exchange = loader.LoadExchangeProviders().ToArray();

Infovalutar

And one hour passes...
(This is the result of 1 hour per day auto-challenge as a full cycle developer for an exchange rates application)
( You can see the sources at https://github.com/ignatandrei/InfoValutar/ )
NrPost 
1Start
2Reading NBR from internet
3Source control and build
4Badge and test
5CI and action
6Artifacts and dotnet try
7Docker with .NET Try
8ECB
9Intermezzo - Various implementations for programmers
10Intermezzo - similar code - options
11Plugin implementation
12GUI for console
13WebAPI
14Plugin in .NET Core 3
15Build and Versioning
16Add swagger
17Docker - first part
18Docker - second part
19Docker - build Azure
20Pipeline send to Docker Hub
21Play with Docker - online
22Run VSCode and Docker
23Deploy Azure
24VSCode see tests and powershell
25Code Coverage
26Database in Azure
27Sql In Memory or Azure
28Azure ConString, RSS
29Middleware for backward compatibility
30Identical Tables in EFCore
31Multiple Data in EFCore
32Dot net try again
33Start Azure Function
34Azure function - deploy
35Solving my problems
36IAsyncEnumerable transformed to IEnumerable and making Azure Functions works
37Azure functions - final
38Review of 37 hours
39Last Commit in AzureDevOps
40Create Angular WebSite
41Add static Angular to WebAPI .NET Core
42Docker for Angular
43Angular and CORS
44SSL , VSCode, Docker
45Routing in Angular
46RxJS for Routing
47RxJs Unsubscribe

Intermezzo–program based on experience–part 9

This post will be somewhat related to https://www.smart-jokes.org/programmer-evolution.html – but it makes total sense for me.

Let’s take what we achieved until now: We have 2 national banks –  and we gather exchange rates from there. What if we want to add more banks  -or let other programmers to add their dll’s to our software to just display the exchange rates from other banks ?

Let’s say now that the requirements are to to display the exchange rates for 2 national banks into a console program .  The manager says that later we may add other banks to load exchange rates . I will try to explain some differences how the code is created, depending on the experience.

Junior programmer: – all the code inside


int Main(){

// code for load and display the first bank exchange rates

// code for load and display the second bank exchange rates

}

Internship programmer: – create classes


//create  2 classes ( first bank, second bank ) and a Load method

int Main(){

var firstBank = new FirstBank();

var data = firstBank.Load();

DisplayData(data);

//same for second bank

}

Seasoned Programmer: – creates interfaces


//add to the 2 classes an interface , loading into a list, loading data for all the list, display

int Main(){

var l = new List<IExchangeRates[]>;
{
new GetFirstBank()),
new GetSecondBank()),

};

foreach(var rates in l){

var data= rates.Load();

DisplayData(data);

}

 

Until now, it is business as usual. But, from now on, there are many things that can be done , depending on programmer experience and will to do things ( until some error arrives and there is an official task for it) :

  1. How to handle errors ( Polly ? )
  2. How to load different libraries that contains our interface ( writing code that loads directly a list with all classes / DI / reflection / config files / plugin loader )
  3. Think about performance ( loading data in parallel / caching )
  4. Add Tests + code coverage
  5. CI / CD

( if I do miss something, please put on comments)

 

What is my point here ? Is that I expect any programmer to go very fast to the level of Seasoned Programmer. But , after that, the knowledge of each programmer is relevant about how he does the points above ( or, if he does not …)

Infovalutar

And one hour passes...
(This is the result of 1 hour per day auto-challenge as a full cycle developer for an exchange rates application)
( You can see the sources at https://github.com/ignatandrei/InfoValutar/ )
NrPost 
1Start
2Reading NBR from internet
3Source control and build
4Badge and test
5CI and action
6Artifacts and dotnet try
7Docker with .NET Try
8ECB
9Intermezzo - Various implementations for programmers
10Intermezzo - similar code - options
11Plugin implementation
12GUI for console
13WebAPI
14Plugin in .NET Core 3
15Build and Versioning
16Add swagger
17Docker - first part
18Docker - second part
19Docker - build Azure
20Pipeline send to Docker Hub
21Play with Docker - online
22Run VSCode and Docker
23Deploy Azure
24VSCode see tests and powershell
25Code Coverage
26Database in Azure
27Sql In Memory or Azure
28Azure ConString, RSS
29Middleware for backward compatibility
30Identical Tables in EFCore
31Multiple Data in EFCore
32Dot net try again
33Start Azure Function
34Azure function - deploy
35Solving my problems
36IAsyncEnumerable transformed to IEnumerable and making Azure Functions works
37Azure functions - final
38Review of 37 hours
39Last Commit in AzureDevOps
40Create Angular WebSite
41Add static Angular to WebAPI .NET Core
42Docker for Angular
43Angular and CORS
44SSL , VSCode, Docker
45Routing in Angular
46RxJS for Routing
47RxJs Unsubscribe

My take on battles in IT

 

First battle : VBScript vs JavaScript. Both were scripting on the browser. VBScript loose because NetScape did not implement it.

Second battle: Microsoft vs Java. Starts with a Microsoft Java implementation  – then C# takes over.

Third battle: MVC vs Silvelight . MVC wons – Silvelight does not work against Chrome.

Fourth battle : Desktop vs Mobile+Web   –  Web wins by large ,  And with Electron  + Cordova , web wins back

Now there are

  1. WebAssembly vs Web. I bet on Web.
  2. Odata vs GraphQL . I bet on GraphQL . OData was too linked to EF ( although now can work without)
  3. DataScience: Python vs R . I hope to win either ML.NET, either JavaScript.

 

What are the battles that you observe ?

Sometimes it’s difficult

I am a good contributor(+moderator) at www.asp.net  forums ( and I love MVC ). Sometimes it’s very difficult to stay calm . Let’s make an example:

 

[new programmer first post]

Hi I am new in ASP.NET mvc 3

I want to insert/modify collection on the page without refresh.

[ code for database first]

Now on create product View I want to add a composite in IList<Composite> Composites collection.

 

 

[My answer]

2 things here:
Modify a collection in MVC : http://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx

Send via ajax : http://bit.ly/mvc_ajax_jquery

 

[new programmer answer after 4 ( FOUR!) minutes]

Hi ignatandrei

Thanks for the reply.

But I have no idea how to implement this thing.

can you give me a small example regarding this.

I have tried many times but not successed.

 

[My answer]

quoting “I have no idea how to implement this thing” from new programmer

What thing of the 2 I have shown you ?
More, I admire your fast reading if you read 2 tutorials(max 6  minutes)  so fast , download codes , reproduce and decide that you do not understand.

 

[new programmer]

Hello ignatandrei

I am sorry… The links which you have posted was not underlined/highlighted; so that’s why I thought  it were like suggentions. because of that misunderstanding I replied you back for demo application.

 

 

And then the usual combination of “ I am getting an error” – although my tutorial it handles errors – both from server side and communication side

However, when someone asks for help it is good to READ what other said – even it was suggestions…

And , as I say, sometimes it is difficult to stay calm. What have you answered?

This software is free

image

 

This is an MVC add-on to add a messaging system to any MVC application. It costs me 0$ to make this program ( not yet finished, but free source at http://messagemvc.codeplex.com/  and the related posts are at http://msprogrammer.serviciipeweb.ro/category/howto/asp-net-mvc/mvc-4/mvc-messaging-system-mvc-4-asp-net-mvc-howto/ )

Home Computer – already done for browsing the internet.

Download Visual Studio Express – free .

Download Sql Server Express – free.

Download latest bits of EF 4.2 – to work with SqlServer Compact too – free.

(Connection to internet : 25 $ – but was already done for browsing the internet)

Installing and configuring software on my PC – 0 $.

All I have done is to sit on my home desk and tapping into the keyboard. But this is does not costs , right?

Making, Planning, testing, deploying – 0$.

[quote from=http://www.petapixel.com/2012/01/10/this-photograph-is-not-free/ ]

So if you’re a magazine, website, corporation, sports team, or advertiser developer who wishes to use this photo  software , please don’t   come and ask to use it for free, or in exchange for credit or “exposure”.

[/quote]

Do not give feedback . Just rant about how bad code smells ,about how OOP and SOLID and Design Patterns are not made clear and how Testing is not properly handled. After all, it is free , right?

Sql developer versus C#(.NET ) developer

I am not very well yet from my operation – so I can not write yet a tutorial.

But I want to propose you the following difference: Sql developer versus C# developer.

In my opinion , nowadays, if you program some application , you MUST have some database. More, the retrieving of data from the dtabase is a matter of relative speed to be seen by the user. So , for me, every .NET programmer should know about indexes / schema / foreign keys / users and so on. More, it has to know about connection pooling and stored procedures.

So, in my opinion ,  you can not be a .NET programmer without knowing much about databases.

What do you think, dear reader?

( This post is generated from a discussion in that the guy says that “I’m a C# developer, not a SQL developer.” and then leaving hints like “Any organization that follows a business practice of SQL users on databases needs to fire their DBA and find someone with the knowledge and foresight of how to scale security in db roles and filter the access through the domain admins (i.e., adding users to a user group in AD).”  and then “was the primary DBA for a number of years covering SQL7-SQL 2005. “)

What do you think about the discussion ?  And about the sql developer versus .net developer?

Andrei Ignat weekly software news(mostly .NET)

* indicates required

Please select all the ways you would like to hear from me:

You can unsubscribe at any time by clicking the link in the footer of our emails. For information about our privacy practices, please visit our website.

We use Mailchimp as our marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp's privacy practices here.