Tag:control flow

  • Dart tutorial 02 – control flow, exception

    Time:2021-2-15

    We’ve finished learning about variables, types and functions in Dart (if you haven’t read it yet, please read it)Dart tutorial 01 – variables, types, functions)Now let’s look at the control flow and exception handling in dart. control flow If – else If else in dart is very simple and very similar to other languages. You […]

  • Using kotlin to develop Android Applications (2) – kotlin basic syntax

    Time:2021-2-2

    Basic Kotlin Language Variable variable var a: String = “initial” // Declares a mutable variable and initializing it val b: Int = 1 // Declares an immutable variable and initializing it val c = 3 var e: Int Println (E) // compiler error: it must be initialized before the first read Function function Default parameter […]

  • Rust study notes

    Time:2020-12-30

    Rust study notes[Variables: VariablesMutable: mutableCompile: compileUnoptimized: not optimizedMismatched: improper collocationScalar: scalarCompound: compound typeParse: a grammatical analysisAnnotation: Annotationtype annotations neededInfer: inferPanic, panicWrapping: wrapping] COMM PROGRAMMING CONCEPTS{variables, basic types, functions, comments, and control flows} KEYWORDSkeywordAppendix AAppendix A Variables and MutabilityVariables and variability Variables in rust are immutable by default. Error: cannot assign twice to immutable variable let […]

  • Rust match and if let

    Time:2020-12-29

    The match Control Flow OperatorControl flow operator match Patterns That Bind to ValuesMode of binding values[ugly programs,isn’t it?] fn main() { let x = Week:: Weekend(Home:: Music); let r = match_week(x); println!(“Hello, {:?}!”, r); } #[derive(Debug)] enum Work { Chinese, Computer, English, Math, Nature, } #[derive(Debug)] enum Home { Music, Sleep, Swimming, } #[derive(Debug)] enum […]

  • Those confusing technical concepts

    Time:2020-12-8

    Only when the basic things are done well can the highest principle be produced. As programmers, especially newcomers, there are similar and relevant technical concepts, which are sometimes maddening, especially during interviews. The understanding of the concept of technology, to a certain extent, can reflect the level of a person. The following is my understanding […]

  • Redux asynchronous action solution

    Time:2020-4-30

    Redux asynchronous action solution Without middleware, store.dispatch can only receive a common object as an action. When dealing with asynchronous action, we need to dispatch after async function await in asynchronous callback or promise function then. dispatch({ type:’before-load’ }) fetch(‘http://myapi.com/${userId}’).then({ response =>dispatch({ type:’load’, payload:response }) }) This can really solve the problem, especially in small […]

  • C# for cycle

    Time:2019-11-22

    I. Introduction A for loop is a repetitive control structure that allows a written loop to execute a specific number of times. Two. Grammar For (expression1; expression2; expression3) { Circulatory body; } Here is the control flow for the for loop: Expression 1Will be executed first and only once. This step allows you to declare […]

  • The Chinese version of Apple’s official swift tutorial the swift programming language

    Time:2019-11-7

    brief introduction Welcome to swift About Swift Version Compatibility First sight of Swift Swift version history Swift tutorial Base part Basic operators Strings and characters Collection type control flow function closure enumeration Class and structure attribute Method subscript inherit Tectonic process Deconstruction process Optional chain error handling Type conversion Nested Type extend Agreement generic paradigm […]