اشتراک‌ها
9 نکته مفید برای استقرار امن و نگهداری تمیز اپلیکیشن های بزرگ

An application’s code base is a living entity. It keeps growing, changing, and adapting. There’s always a new feature to add, more bugs to solve, and new bugs that are created as a result. As the teams grow, the code changes more often and there are ever more features, more issues, and more bugs. Thorough manual testing becomes impossible the bigger your application gets and as you ship more frequently. 

9 نکته مفید برای استقرار امن و نگهداری تمیز اپلیکیشن های بزرگ
اشتراک‌ها
کتابخانه dropzone
Dropzone.js is a light weight JavaScript library that turns an HTML element into a dropzone. This means that a user can drag and drop a file onto it, and the file gets uploaded to the server via AJAX.  Demo
کتابخانه dropzone
اشتراک‌ها
صدور Exception یا بازگشت Result به عنوان خروجی متد، برای رسیدگی به خطاها

Summary

It’s pretty easy to differentiate use cases for Result and exceptions. Whenever the failure is something you expect and know how to deal with – catch it at the lowest level possible and convert into a Result instance. If you don’t know how to deal with it – let it propagate and interrupt the current business operation. Don’t catch exceptions you don’t know what to do about. 

صدور Exception یا بازگشت Result به عنوان خروجی متد، برای رسیدگی به خطاها
اشتراک‌ها
مقایسه React و Angular 4

When you start working on a new web application you will probably need to analyze different tools to deal with the different functionalities that you have to work on. As soon as you start searching for alternatives you are going to run across Angular and React, they are without any doubt two of the major options to consider, at least till today.

مقایسه React و Angular 4
اشتراک‌ها
روش های مقایسه اشیاء با null

Check

Code 

Description

Is Null
if(variable is null) return true;

  • 🙂 This syntax supports static analysis such that later code will know whether variable is null or not.
  • 🙁 Doesn’t produce a warning even when comparing against a non-nullable value type making the code to check pointless.
  • 😐 Requires C# 7.0 because it leverages type pattern matching.
Is Not Null
if(variable is { }) return false

  • 🙂 This syntax supports static analysis such that later code will know whether variable is null or not.
  • 😐 Requires C# 8.0 since this is the method for checking for not null using property pattern matching.
Is Not Null
if(variable is object) return false

  • 🙂 Triggers a warning when comparing a non-nullable value type which could never be null
  • 🙂 This syntax works with C# 8.0’s static analysis so later code will know that variable has been checked for null.
  • Checks if the value not null by testing whether it is of type object.  (Relies on the fact that null values are not of type object.)
Is Null
if(variable == null) return true

  • 🙂 The only way to check for null prior to C# 7.0.
  • 🙁 However, because the equality operator can be overridden, this has the (remote) possibility of failing or introducing a performance issue.
Is Not Null
if(variable != null) return false

  • 🙂 The only way to check for not null prior to C# 7.0.
  • 😐 Since the not-equal operator can be overridden, this has the (remote) possibility of failing or introducing a performance issue. 
روش های مقایسه اشیاء با null
اشتراک‌ها
کتاب رایگان Scala Succinctly

Learning a new programming language can be a daunting task, but Scala Succinctly makes it a simple matter. Author Chris Rose guides readers through the basics of Scala, from installation to syntax shorthand, so that they can get up and running quickly.

Table of Contents
  1. Introduction
  2. Variables and Values
  3. Expressions and Functions
  4. Control Structures
  5. Arrays and Lists
  6. Other Collection Types
  7. Classes and Objects
  8. Pattern Matching
  9. Closures
  10. Conclusion 
کتاب رایگان Scala Succinctly