On 14 January 2021, results from the State of JavaScript 2020 Survey were released. The results were gathered from 23,765 developers in 137 countries, covering people’s usages and opinions of JavaScript features, technologies, tools, and more. Below I have highlighted my main takeaways from the survey. Hopefully, they will shed some light on how you can best equip yourself in 2021!
The technologies that were most used were largely unchanged last year. TypeScript is still the most-used JavaScript flavor, React is still the most-used frontend library, and Express is still the most-used backend library. …
In 2020 I tried building up a reading habit again. I’ve also started following a few cool podcasts and found some great online resources. This is just a casual post compiling a list of things I’ve enjoyed the most in 2020.
Basically an introduction to philosophy course disguised as a novel. Sophie’s World details the conversations 14-year-old Sophie had with her mentor, with topics spanning thousands of years from Greek philosophers to Marxism. Very dense materials, but very eye-opening. I’ll definitely reread it sometime in the future.
I have read a few dystopian novels, but none was as spine-chilling as…
Today, we have React components — and that’s it.
However, the React team is now experimenting with a new idea of separating components into two types: Client Components and Server Components. The proposal is to start differentiating them by file extensions (.client.js
and .server.js
). So what are they?
Client Components are just the components we have today.
Server Components, on the other hand, are a new type of component that is first rendered on the server side before being sent to the client side.
At first glance, it sounds very similar to server-side rendering (SSR). …
Have you ever wondered how a new line is stored on a computer? You know, what happens when you hit “enter” in a text editor?
On Windows, a new line is stored as the weird sequence \r\n
. For example, the following text:
Hello
World!
Is actually stored as Hello\r\nWorld!
on a Windows system.
It turns out \r
is called a carriage return and \n
is called a line feed. They are special characters that have their origins from typewriters. …
The new Apple Silicon Macs have been out for a while now. The machines have shown drastic processing power and battery improvements while being at the same price point. As a result, most tech reviewers have no issue recommending them to people for everyday use.
However, the story is different for software developers.
There are currently two main concerns with the new lineup. First, there’s limited external monitor support. The new M1 MacBook Air and MacBook Pro only support one external monitor via Thunderbolt 3. The Mac mini, which does not have a built-in monitor, supports two external monitors via…
Ionic is a framework for building hybrid mobile apps. A mobile app is hybrid when it’s built on a mix of web technologies (e.g., HTML, CSS, JavaScript) and libraries for accessing native-mobile functionalities (e.g., Cordova plugins).
Hybrid mobile app frameworks have a long history. The first of its kind was PhoneGap, created by the software company Nitobi. Nitobi was later acquired by Adobe, who donated the PhoneGap codebase to Apache. Adobe kept the PhoneGap trademark, but the donated software was renamed Apache Cordova.
Then Ionic came along.
Ionic isn’t a single framework. It’s an umbrella term that refers to the…
In 2019, I graduated with a bachelor’s degree in computer engineering. Shortly after, I joined a company in Hong Kong as a software engineer. I have now been in this position for around six months.
Now that I have had time to collect my thoughts, I’d like to share with you my experience thus far. I hope it will be helpful to any new or aspiring software engineers.
Relax. Your company probably already has a list of to-dos for you. Things like setting up your bank account, going through training, getting access to computers and doors…
When you finally arrive…
I have graduated from UST’s BEng program with a major in Computer Engineering (CPEG). Here I want to leave some thoughts on the lecturers and courses that I liked and didn’t like. Needless to say, these thoughts are subjective and not everyone will agree with them. But I hope they would still be helpful to some people.
Here are my favorite lecturers. Knowledgeable in their fields. Passionate about teaching. Genuinely care about students. Basically they are so good I am confident recommending ANY course taught by them.
In ELEC1100, we learnt about the fundamentals of electric circuits and Boolean logic…
Given an array nums
of n integers where n > 1, return an array output
such that output[i]
is equal to the product of all the elements of nums
except nums[i]
.
O(n) runtime, O(n) space
vector<int> productExceptSelf(vector<int>& nums) {
int n = nums.size(); // Initialize vectors (i.e. arrays) of n 1’s vector<int> result(n, 1);
vector<int> fromBegin(n, 1);
vector<int> fromEnd(n, 1); for(int i=1; i<n; i++){
fromBegin[i] = fromBegin[i-1] * nums[i-1];
fromEnd[i] = fromEnd[i-1] * nums[n-i];
}
for(int i=0; i<n; i++){
result[i] = fromBegin[i] * fromEnd[n-1-i];
}
return result;
}
Explanation:
Let’s take nums = [1,2,3,4,5]
as an example.
After the 1st pass,
fromBegin = [1…
Given an array of integers, return indices of the two numbers such that they add up to a specific target. For example,
nums = [2, 7, 11, 15]
target = 9return [0, 1]
vector<int> twoSum(vector<int>& nums, int target) {
vector<int> result;
for(int j=1; j < nums.size(); j++){
for(int i=0; i < j; i++){
if(nums[i] + nums[j] == target){
result.push_back(i);
result.push_back(j);
return result;
}
}
}
return result; // no results found, return empty vector
}
vector<int> twoSum(vector<int>& nums, int target) { // maps remainder (target - current_val) to vector index (i)
// e.g. …