Showing posts with label How Julia start to read CSharp 2000 things series. Show all posts
Showing posts with label How Julia start to read CSharp 2000 things series. Show all posts

Wednesday, March 28, 2018

2,000 Things You Should Know About C#

March 28, 2018

Introduction


It is time for me to slow down to practice data structure and algorithm, and think about how to advance myself as  a C# programmer. One thing I like to do is to learn something quickly. I spent over one hour today to study interface from 2,000 things you should know about C#.

Interface




  • #434 – Interfaces
  • #435 – Implementing an Interface
  • #436 – The Implementation of an Interface Can Be a Subset of the Class
  • #437 – Access Interface Members through an Interface Variable
  • #438 – Benefits of Using Interfaces
  • #440 – A Class Can Implement More than One Interface
  • #441 – Implementing Interface Members Explicitly
  • #442 – Explicit Interface Implementation Allows Duplicate Member Names
  • #443 – An Interface Cannot Contain Fields
  • #444 – Interfaces Can Inherit from Other Interfaces
  • #445 – Differences Between an Interface and an Abstract Class
  • #446 – Deciding Between an Abstract Class and an Interface
  • #447 – Use as Operator to Get At an Object’s Interfaces
  • #448 – Use the is Operator to See if an Object Implements an Interface
  • #449 – You Can Pass an Interface Variable to a Method
  • #450 – Interfaces Should Normally Start with the Letter ‘I’
  • #451 – Implement Interface Explicitly to Simplify How a Class Appears to Clients
  • #454 – Return an Interface as a Return Value from a Method
  • #455 – Define an Interface Based on Existing Members of a Class
  • #456 – Explicitly Implemented Interface Members Are Automatically Private
  • #536 – Using a Generic Interface
  • #537 – Implement a Generic Interface with a Generic Class
  • #612 – Members of an Interface Are Implicitly Public
  • #613 – Interfaces Cannot Contain Static Members
  • #647 – A struct Can Implement an Interface
  • #799 – Interface Members Are Implicitly Public
  • #1,067 – Covariance and Generic Interfaces
  • #1,068 – Generic IEnumerable Interface Is Covariant
  • #1,069 – Contravariance and Generic Interfaces


  • It will take me 2 hours to go over those items.

    Wednesday, September 20, 2017

    Understanding C# Array class

    Sept. 20, 2017

    Introduction


    I had a mocking interview at 10:00 pm, and I like to write Array.IndexOf but I need to search Google for the help. I asked myself why it is not array.IndexOf() instead of calling an abstract class Array.IndexOf assuming that array is an object of Array class.

    Here is my C# practice. I has a few issues to use Array.IndexOf instead of using hashmap to save the index.

    Understanding C# Array


    I like to read a few articles to get more educated on C# Array.

    Read c# Array -
    Read 10 minutes - C# Arrays Tutorial
    https://msdn.microsoft.com/en-us/library/aa288453(v=vs.71).aspx

    20 minutes reading:
    http://www.c-sharpcorner.com/article/working-with-arrays-in-C-Sharp/

    Study stackoverflow posts related to C# Array -

    More reading:
    https://www.codeproject.com/Articles/6118/All-about-abstract-classes



    Csharp 2000 things



    Work on C# 2000 things, the following image is highlighted by search keyword: Array


    Plan to spend 10 minutes for each item related to Array, some of them are Julia's favorites.

    #136, Sorting an Array of Values Based on an Array

    Julia's ranking: 10 out of 10

    #135, Implementing IComparable to Allow Sorting a Custom Type

    9 out 10

    #137, Sorting an Array Using an Independent Comparer method

    9 out 10


    Actionable Items



    Plan to work on medium level algorithm called "Non-overlapping intervals". The link is here.


    Follow up 


    June 8, 2018

    I spent over 20 minutes to look into more carefully about C# Array abstract class. It is true that Array.IndexOf is a static method, so that the call of the function should look like Array.IndexOf, instead of str.IndexOf. Compared to API SetValue as public  function, it will be called differently.

    My second question is why IndexOf API is static but SetValue is non-static. Maybe we can read Array C# class source and then figure out why.

    Wednesday, September 6, 2017

    Booking reading: C# tutorial

    Sept. 6, 2017

    #CSharpTutorial #BookReading #AdvancedTopics 


    Introduction


    It is never too late to read a C# tutorial. Today I spent over one hour to read C# tutorial, and then I read the first time about C# reference types. There are four types which are class types, interface types, array types, and delegate types.

    I like to spend 30 minutes a time, a few times to read the book. Meanwhile, I like to use C# tutorial to help me do some research on language itself, and find some interesting and quality material to read to enhance my C# knowledge. The material I am looking for should not focus on the theory, better practical, work on small coding examples.

    C# tutorial 


    A few things I like to do:
    1. Plan to spend 30 minutes a time to read the tutorial.
    2. Write down new concepts here.
    3. Try to go over the tutorial in September.

    9/11/2017

    Read page 1 and look into the declaration "C# is a simple, modern, object-oriented, and type-safe programming language."

    Plan to look into the keyword: type-safe programming language C# -

    15 minutes read:

    "Learn C# tutorials", the article link is here.

    9/12/2017

    Read page 1 arguments:

    "The type-safe design of the language makes it impossible to read from uninitialized variables, to index arrays beyond their bounds, or to perform unchecked type casts."

    Questions:

    - uninitialized variables - how the design make default initialization in C#
    - index arrays beyond their bounds -
    - unchecked type cast - what is the unchecked type cast?

    Look into type-safe design of C#, name three of them.

    Each common mistake plan to read 5 minutes.
    Buggy C# code: The 10 most common mistakes that C# developers make -

    C5 Generic Collection Library for C# and LCI - the github link is here.
    Read page 1 argument:

    "C# Has a Unified Type System. All C# types, including primitive types such as int and double, inherit from a single root object type. Thus, all types share a set of common operations, and values of any type can be stored, transported, and operated upon in a consistent manner. Furthermore, C# supports both user-defined reference types and value types, allowing dynamic allocation of objects as well as in-line storage of lightweight structures.".

    I did Google on this, and then surprisingly I came cross the search result: #950 – C# Has a Unified Type System, I immediately decided to learn from the series of Csharp 2000 things.

    Plan to go over 2000 things 30 minutes a time. Write down my favorite learning here.

    2,000 things you should know about C#, the link is here.

    Follow up


    May 21, 2018

    What I did is to review the blog, and then I also make the blog more readable. I added a few labels for easy to access. I specially like to document how I approach my goal to advance my C# skills.

    Reading a book takes time. I like to use C# tutorial book to guide me to find interesting research topic. 

    Feb. 20, 2024
    I decided to read C# tutorial again. I searched my blog using keyword: C# tutorial, and then I found the book to read.