Moment For Technology

Kotlin tutorial (5) type

Write at the beginning: I plan to write a Kotlin series of tutorials, one is to make my own memory and understanding more profound, two is to share with the students who also want to learn Kotlin. The knowledge points in this series of articles will be written in order from the book "Kotlin In Action". While displaying the knowledge points in the book, I will also add corresponding Java code for comparative learning and better understanding. Java...

Gnawing concurrency (11) : reordering of memory models

In many cases, accessing a program variable (object instance field, class static field, and array element) may be executed in a different order than the order specified by program semantics. For example, if a thread writes values to field A and then to field B, and the value of B does not depend on the value of A, the processor can freely adjust its execution...

JavaScript array of eighteen martial arts

The index of a JavaScript array is a 32-bit number based on zero, the first element index is 0, and the array can hold up to 4294967295 (that is, 2^32-1) elements. JavaScript arrays are dynamic, they grow or shrink as needed, and there is no need to declare a fixed size when creating an array or to reallocate space when the array size changes. Jar...

Kotlin's trick of Reified Type Parameter (Part 2)

Today we begin our series of original articles. First of all, why not use this article as a translation? I read the author's original text, and this blog will cover everything in it. In this article you will learn all about the Reified parameter in Kotlin generics, including its basic usage, source code, and usage scenarios. With the introduction of the previous article, I believe you are interested in Kotlin's...

Super mini compiler

Introduction: While reading The Babel document, I came into contact with The Super Tiny Compiler. The annotations in it are easy to understand and explain. Why should Origin My GitHub focus on most compilers

An easy way to remember Kotlin's parameters and arguments

I recently delve into the generics syntax in Kotlin and find that it is very different from generics in Java, and that Kotlin's generics are syntactically safer to use than those in Java. But it turns out that Kotlin generics are suddenly getting a lot of terminology, covariant, contravariant, invariant, star projection; Type parameters, type arguments, type arguments, class, type, subclass, etc.

Efficient String Concatenation in Go (2)

In the last article on string concatenation (1) of Go language string Efficient concatenation, we demonstrated a variety of string concatenation methods, and used an example to test their performance. Through comparison, we found that the Builder with high performance did not play its supposed performance, but + sign concatenation, Even the strings.Join method performs better.

On Variables and Constants in Kotlin's Grammar (II)

2. Kotlin has a type inference mechanism. When a variable or constant is initialized, it can omit the type declaration, and it will use the type of the variable according to the type of the initialized value. 5. Java generally starts with a type followed by a name, and the type cannot be omitted; Such operations are not possible in Kotlin. Because in Kotlin types can be omitted, which means...

Explore the WebPack plugin mechanism

Webpack is both a joy and a worry, powerful but with a learning cost. Before exploring the WebPack plugin mechanism, one interesting thing to understand is that the WebPack plugin mechanism is the backbone of the entire WebPack tool, and webPack itself is built using this plugin mechanism. Therefore in the in-depth understanding of WebPA...

Search
About
mo4tech.com (Moment For Technology) is a global community with thousands techies from across the global hang out!Passionate technologists, be it gadget freaks, tech enthusiasts, coders, technopreneurs, or CIOs, you would find them all here.