teleren/devto huggingface dataset:
I’ve Got 99 Problems but Learning TypeScript Ain’t One
Tags: discuss, webdev, programming, javascript
Published: 2022-12-07 12:11:31

> Why have all JavaScript developers not moved to TypeScript?

I asked this question on Twitter last week and got ~100 replies.

![To all JavaScript developers who have not moved to TypeScript — Why?](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3uto8rrbud9yv303gs5b.png)

Sharing my learnings from the responses, as it gives insight into what keeps developers from migrating to new tech. Even when the alternative is better.

Let’s get into it.

## TL;DR

- [Conquering JavaScript first](#conquering-javascript-first)
- [Vanilla JavaScript works](#vanilla-javascript-works)
- [Sorry, too soon](#sorry-too-soon)
- [Well, it depends](#well-it-depends)
- [ECMA is getting there](#ecma-is-getting-there)

## Conquering JavaScript first 👨‍🏫️

A lot of newbies and beginners gave the “I am still learning JS” response.

Understandably they don’t want to take up more than they can chew at the moment.

Most of them are interested in trying it out in future, whereas some were looking for guidance on if they should.

## Vanilla JavaScript works 👌

Developers already working with JS, had a pressing question → “What’s the need?”.

They don’t plan to migrate due to having a large codebase written in JavaScript, ease of debugging, or simply because they are comfortable with JS as it gets the job done.

Their motto: “If it works, don’t touch it”.

## Sorry, too soon 🕒

Some experienced JS developers have learned TypeScript in plans, but think the right time has not come yet.

Unlike developers who are not willing to migrate, these devs see value in TypeScript. Just that they didn’t get the right project yet, which justifies the learning curve.

Also, they are hoping that tooling (like support for running TS code natively in the browser) will improve in the future.

## Well, it depends 🧐

Some developers have spent time learning TypeScript, but don't use it for every project.

As per them, it’s suited when:
- Working in a team
- Writing production apps
- Codebase is huge

They said "For personal projects and simple apps, TypeScript is an overkill".

## ECMA is getting there 🏁

Lastly, a few responses were about ECMA 6 already supporting enough modernity to write clean code in JS.

These devs suggest, if you understand JavaScript well enough with tooling built around it, you don’t need TypeScript.

Also, they are hopeful that useful features in TypeScript will eventually be included in native JavaScript so why bother with 2 learning curves.

## Wrapping up 📝

Share in comments your motivation to move or not move to TypeScript?

If you liked this post, you can follow me for more of these.
Solving day 07 of Advent of Code 2022 in JavaScript
Tags: challenge, adventofcode, javascript, video
Published: 2022-12-07 12:09:26

---
title: Solving day 07 of Advent of Code 2022 in JavaScript
published: true
description: JavaScript walkthrough of Advent of Code 2022 (day 07)
tags: challenge, AdventOfCode, javascript, video
series: Advent of Code 2022 in Javascript
---

{% youtube ZNLF2DavA6U %}
GraphQL Yoga NestJS integration now supports NestJS v9 and Yoga v3
Tags: graphql, node, typescript, yoga
Published: 2022-12-07 12:03:25

> This article was published on Tuesday, December 6, 2022 by [Denis Badurina](https://twitter.com/enisdenjo) @ [The Guild Blog](https://the-guild.dev/)

The latest version
[v0.2.0 of `@graphql-yoga/nestjs`](https://github.com/charlypoly/graphql-yoga-nestjs/releases/tag/v0.2.0),
the NestJS GraphQL Yoga driver, added support for NestJS v9.

That also includes updating GraphQL Yoga to the latest
[v3 release with all its new features](/blog/graphql-yoga-v3)!

## NestJS V9

Just recently, NestJS, a framework for building efficient, scalable Node.js server-side
applications, has released a new version v9. Fixes and improvements are encompasing the complete
framework, be sure to do an update!

Read more about the new release on the
["NestJS v9 is now available!" announcement](https://trilon.io/blog/nestjs-9-is-now-available).

### NestJS V8 Still Supported

Even with the added v9 support, v8 will still be supported. You do not have to make any adjustments
to your code.

### Migrating from NestJS V8

We recommend you consult the great
[Migration guide from NestJS](https://docs.nestjs.com/migration-guide) for migrating NestJS itself
and simply doing an update to
[v0.2.0 of `@graphql-yoga/nestjs`](https://github.com/charlypoly/graphql-yoga-nestjs/releases/tag/v0.2.0).

We love supporting our NestJS users and the NestJS community as a whole. We see more and more NestJS
developers migrating to Yoga, the best and most feature rich GraphQL server out there.

Please try it out, share with us your feedback and let us know how we can make NestJS developers
lives better!
Hyperiondev Web Dev bootcamp - day 3
Tags: webdev, beginners, codenewbie, bootcamp
Published: 2022-12-07 12:01:15

**Onwards**

So after the three hour lecture yesterday I'm getting close to popping a message over to the team to request that the tutors attempt to stay on topic for the lecture as advertised. I imagine after this week things should settle down some but yesterday I just ended up muting the tab and carried on doing the exercises I was on.
I think this is a bit of a problem with the way this bootcamp is run. We have all the coursework already so if the urge takes you, you could romp on through it. Problem being that when you get stuck you're going to have quite a wait until the relevant lecture takes place. I'm just finishing up task 6 and the scheduled lecture today is covering task 3. I know of a few students who are already into tasks 13 upwards. 
I'm fine with this so long as they don't start asking questions about where they are in the lectures that aren't meant to be covering that info. We have the option for 1:1 mentor calls for such situations.

So, mini-rant over.
Task 5 - Further conditionals (Switch statements)
Quick and easy lecture covering the usage and syntax of switch statements. Followed by a couple of exercises to make sure we understand if / if else, switch statements and nesting those together to solve logic problems.

I like that the resources we are given don't fully explain how to achieve our solutions and that we need to do a little further digging around ourselves (with correct citing of info used). It gets us used to doing just that very thing when we get stuck later on in our journey.

Live Lecture later, let's hope it's a little shorter today.

Then I'm on with Task 6 - Our first capstone project, which is building a JS temperature convertor. Nothing ground breaking but a good recap of everything taught so far.

Until tomorrow friends.
Sending SMS with nodejs using sendchamp SMS API
Tags: sendchamp, sms, api, javascript
Published: 2022-12-07 11:50:23

The [Sendchamp SMS API](https://sendchamp.readme.io/reference/send-sms-api) allows you to send SMS anywhere around the world. With your verified Sender ID, you can use the SMS API to facilitate outbound messages.

In this article, you will learn how to send SMS messages with Node.js.

## **Prerequisite**

Before you can get started, make sure you have:

- JavaScript knowledge and familiarity with nodejs.
- Nodejs installed on your machine
- Sendchamp account
 
To get started with Sendchamp SMS API, [sign up on Sendchamp](https://my.sendchamp.com/?utm_campaign=sendchamp_developers_website&utm_medium=webl&utm_source=sendchamp_developers_website) to get your API credentials. Once you signed up, go to your [Sendchamp Dashboard](https://my.sendchamp.com) to get your API key in the account settings section and you will find APIs & Webhook.

## Setting up your Nodejs Application

Create a `.js` file, let’s call it `index.js`, and in the file, initialize an instance with your credentials:

```javascript
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.sendchamp.com/api/v1/sms/send',
  'headers': {
    'Accept': 'application/json',
    'Authorization': 'Bearer ACCESS_KEY',
    'Content-Type': 'application/json'
  },

```

Make sure to replace `ACCESS_KEY` with your correct public access key on your sendchamp dashboard.

## Sending SMS Messages

To send a message, pass the Sender ID you are sending the message from, a recipient number, message to be sent and the route. 

Let’s try to hard-code a phone number (which should start with a country code, e.g. “2349039099438”) and a message to test out the SMS API:

```javascript
body: JSON.stringify({"to":["2349039099438"],"message":"Testing Sendchamp SMS API","sender_name":"Sendchamp", "route":"dnd"})
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
```
Let’s see if we will get an SMS.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/abllt6i2nzgyxkxc4lqh.jpg)

 Leave a comment if you need further clarifications. You can join our developer community [here](https://community.sendchamp.com)
What is a UI Kit and Why You Should Be Using One
Tags: uiweekly, beginners, design, ux
Published: 2022-12-07 11:37:03

Building an app or website for your business is a crucial step in the right direction, but it can also feel overwhelming.

It’s easy to get bogged down by all the little details, and if you’re not careful, it’s easy to end up with a product that doesn’t even resemble what you wanted. But don’t worry! We’ve got your back! This blog post will explore the benefits of UI kits and design systems for your business.

## What Is A UI Kit?

UI KIT stands for User Interface Kit, a design bundle of ready-to-use components, assets, styles, icons, buttons, fonts, and typography that can be used to build an app or website design.

## Why Use UI Kits To Create A Design System?

UI kit is the perfect way to make your design feel more cohesive and sleek.

[Read More About UI kits](https://fabrx.co/blog/what-is-a-ui-kits-and-why-you-should-be-using-one/)
Piko-piko OS. A homemade 16-bit x86 toy operating system for fun.
Published: 2022-12-07 11:33:18

So I made a [16-bit x86 toy OS in pure assembly](https://github.com/RechieKho/piko-piko). 3 months ago, I found a very fun [tutorial](https://github.com/cfenollosa/os-tutorial) on github that is about Operating system development. I read the first few chapter and from there I made a very simple, extensible (?) toy operating system that could run on hardware (yes, it is madness). 

## Piko-piko OS overview
As the title stated, it is a toy os so itself doesn't do much. Still, the language is still turing complete. Here is an example that prints Hello world 10 times.

```sh
00000 set 0 10
00001 say n "Hello world"
00002 sub 0 $0 1
00003 cmp $0 0
00004 june 1
```

The language is more or less like an interpreted assembly language without label. It can read user input, print to output, basic arithmetic, save & load data and conditional jumps. [Here](https://github.com/RechieKho/piko-piko/wiki/commands-reference) is all the commands included. I'll write a more user-friendly tutorial to kick start your Piko-piko OS coding journey, but right now you can only 

In Piko-piko OS, you can either enter the command to the prompt to run the command directly or using `=` command to save lines of command to buffer and run it all together with `run` command. By default, there is 3 buffer. Each buffer can only holds 2560 lines of text.

Piko-piko OS is self-contained, which means that it does not rely on any other code and won't effect other files except itself. When saving & loading data, it does read and write to itself **only**.

## Practicality?
Yes, it is not practical but it is a very educational resource to learn lower-level programming and really knowing how machine work. Still, you can use it to:
- Show off
- Stop your child from watch too much youtube by locking them up in Piko-piko OS.

It is a very cool experience to be able to make an operating from scratch. I might be able to share the experience of developing Piko-piko OS on the next blog post.
White Label SEO & Digital Marketing World Class White Label Digital Services
Published: 2022-12-07 11:14:49

We understand that running a digital marketing agency can be tough job, especially offering wide range of digital marketing services for clients and at the same time focus on generating new agency clients for the business.

You may be an amazing web designer, or top rated Facebook advertising agency, but it takes too much learning curve to start offering SEO or Google ads to be able to offer such services to client.

By partnering with HighGround, not only you will get proven results for client but this will also help your marketing agency to earn higher profit margin through our white label system.

From our well created SOP, clients will not be able to see who is working on the project and we will be working on the campaigns under your brand ( White label )

https://highground.asia

#highground #digitalmarketingagency #whitelabelseo #whitelabelmarketing #whitelabelfacebookads

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mzol422oh163yk3pcbuo.jpg)
Debug your React app like a Pro
Tags: webdev, programming, react, tutorial
Published: 2022-12-07 11:09:40

When hunting for actual bugs in the code, we need to focus on tools and systematic processes to analyse the code in search of what's not working and accept the fact that the person that wrote the code may not be available to answer our questions. Sometimes, though, the bug might have been introduced by ourselves 🙋‍♂️, and we can find it difficult to step in the shoes of our past selves in order to understand why we did what we did. No matter what's the case, they all have something in common: we need to use tools to help us debug the app and find what's wrong with it.

I have come up with a shortlist of tools/methods that when implemented correctly, you'll be debugging like a pro. So let's get started. 
![debug](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jshdhucz1v04zdgv5o77.gif)


**React Dev Tools.**
React Developer Tools is a browser DevTools extension. It allows you to inspect the React component hierarchies in the Chrome Developer Tools. The tool helps track the state and to have a holistic overview of the component hierarchy.
![devtool](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3p6ro1como20tn103qid.gif)



**Why Did You Render?**
Why-did-you-render by Welldone Software monkey patches React to notify you about potentially avoidable re-renders. (Works with React Native as well.). It can help you to simply track when and why a certain component re-renders.
![wdyr](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cmjmuuuhs29qtt5qg7xc.png)




**Realize For React**
Realize is a browser extension for React component tree visualizer. As React applications scale, it becomes more difficult to track state and to have a holistic overview of the component hierarchy. Realize is a tool to help developers visualize the structure and state flow of their React applications, especially when they are growing in scale and complexity.
![realize](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k4gpvttoghioos2hvf33.png)


**Chrome Performance Profiler**
The Profiler measures how often a React application renders and what the “cost” of rendering is. Its purpose is to help identify parts of an application that are slow and may benefit from optimizations such as memoization.
![pro](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ld5z4qn58z94rhw887zh.png)


**Sapling: Extension On VSCode**
Sapling is a VS Code extension built with React developers in mind.
With Sapling, you don't have to guess at the parent component of your current file. You can build your tree by selecting any component file as the root and get information about the available props at any level.
![sap](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3oh699sb7nln5pehmob8.gif)




_PS: I'm sure I haven't covered all the techniques available for debugging a React app, so if you have one that's your favourite and that is not listed here, please share it in the comments so we can all learn from it. 😊_

**Thats it!! #HappyCoding**

![cheers](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rzdyj0mv74w1c8k8gd24.png)
Easy Steps To Create Rock-Paper-Scissors Game with Python
Tags: programming, python, rockpaperscissors, coding
Published: 2022-12-07 11:07:45

```
import random

def the_game():
  player_choice = input("Enter a choice (rock, paper or scissors): ")
  options = ["rock", "paper", "scissors"]
  computer_choice = random.choice(options)
  response = {"player": player_choice, "computer": computer_choice}
  return response

def check_winner(player, computer):
  print(f"You chose {player}, computer chose {computer}")
  if player == computer:
    return "A tie!"
  elif player == "rock":
    if computer == "scissors":
      return "Rock smashes scissors! You win!"
    else:
      return "Paper covers rock. You lose."
  elif player == "paper":
    if computer == "paper":
      return "Paper covers rock. You win!"
    else:
      return "Scissors cuts paper. You lose."
  elif player == "scissors":
    if computer == "paper":
      return "Scissors cuts paper. You win!"
    else:
      return "Rock smashes scissors! You lose."

response = the_game()
score = check_winner(response["player"], response["computer"])
print(score)

```
How to start a profitable micro-startup without quitting your job? [Day #12]
Tags: startup, entrepreneurship, webdev, inspiration
Published: 2022-12-07 10:55:08

[For a solopreneur that wants to start their own products immediately and thinks that having a full-time job is just delaying their dreams. Keep calm, it’s possible to have both, building your dream while having a full-time/part-time job.](https://medium.com/@journeypreneur/how-to-start-a-profitable-micro-startup-without-quitting-your-job-day-12-1d8537cacedf)
Remote Kubernetes jobs: How many are there? What do the trends suggest?
Tags: kubernetes, career, devops, docker
Published: 2022-12-07 10:45:35

Remote jobs are the talk of the town, and why shouldn't they be? Everyone is looking for some sort of _remoteness_ in their current or next job.

So what about remote Kubernetes jobs? Where is the trend headed?

To seek answers to the above questions (and perhaps more), we at [Kube Careers](https://kube.careers) took our job listing data for Q3 2022 (July to September) and analysed it to derive a few patterns.

Before you read further, know that:
- At Kube Careers, we only include job listings with a clear salary range, and which have Kubernetes as a requirement and not a nice to have/plus.
- Our dataset is small, with **86** job listings from July to September 2022.

Here are some of the interesting things we found.

For Q3 2022, only 7% of the jobs mentioned a Remote only working nature. Of the others, Europe had the most Kubernetes jobs at 40%, APAC (Asia Pacific) at 33%, and North America at 16%.

![jobs_by_region](https://user-images.githubusercontent.com/72087695/197392516-1e2a112d-ee32-46ea-857c-9c5a6f1fa2b9.png)

### What about remote jobs? What's the current scenario like?

*It's complicated, and how!*

Remote work mentions stand at *34%* of the total jobs published this quarter. This metric is down by almost *half* when compared to the Q3 2021 quarter.

![remoteworkmentions_comparo](https://user-images.githubusercontent.com/72087695/198157946-828be852-8d73-4d5a-bf09-fa7e63aacee5.png)

It also must be noted that **there exist different tiers of remote work.**

There are remote-only jobs that allow employees to work from anywhere in the world without needing to visit any of the company offices. Then there are remote-hybrid jobs that require the employee to be present in the same country/state as the company office and occasional office visits.

This quarter, a total of **23** job descriptions mentioned a *remote-hybrid* working setup, while only **6** job descriptions asked for a *remote-only* setup.

![remotevsoffice](https://user-images.githubusercontent.com/72087695/198157785-750ada90-7c82-448a-9d58-9d337c78794c.png)

### Has the scenario changed over the quarters?

**It has.**

If we normalise and then compare the numbers for Q3 of 2021 vs 2022, we find interesting things.

![remotevsoffice_comparo](https://user-images.githubusercontent.com/72087695/198800920-2a777b6a-e581-4967-bb98-86c479e96643.png)

What is apparent is the fall of remote work and the rise of office-only jobs between the two quarters.

What is the reason for the fall? There could be numerous reasons contributing to the tilt. Still, one of the reasons could be the lifting of the COVID restrictions and the industry inviting its employees to the offices (at least partially).

Like what you read?


Click [here](https://kube.careers/kubernetes-trend-report-2022-q3) if you'd like to read our detailed job trends report for Q3 2022, which includes salary ranges, popular technologies and skills listed in job descriptions, and much more.
Things I learned this week - Week 48 (2022 ed.)
Published: 2022-12-07 10:45:30

1. Build chrome extension with Vue

{% embed https://www.youtube.com/watch?v=xyrWIRdGLmw %}

Refernces:
- https://github.com/antfu/vitesse-webext

2. 3 VUE design patterns

{% embed https://www.youtube.com/watch?v=e8AOeEAeoR8 %}
Tricky Unpacking In Python
Tags: python, beginners, tutorial, codenewbie
Published: 2022-12-07 08:03:51

Imagine, you iterate through a collection, which contains some other collections.

Like so: list of lists

```
In [32]: L = [ [i] for i in range(10) ]

In [33]: L
Out[33]: [[0], [1], [2], [3], [4], [5], [6], [7], [8], [9]]
```

One obvious way to iterate over inner values is to use indexing:


```
In [24]: [ i[0] for i in L ]
Out[24]: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
```

Well, there is another way to do so. Almost so :) 

```
In [24]: [ i for i, in L ]
Out[24]: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
```


In fact, it is single element unpacking. It works, because in python **commas** "construct" tuples, not *brackets*

```
In [29]: 5,
Out[29]: (5,)

In [30]: (5)
Out[30]: 5
```

## Are there any differences?

Yeap.

This unpacking seems to be faster than reading by index. Not much, by ~10%.

```
In [24]: L = [ [i] for i in range(1000) ]

In [25]: %timeit [ i for i, in L ]
19.7 µs ± 31.4 ns per loop (mean ± std. dev. of 7 runs, 100,000 loops each)

In [26]: %timeit [ i[0] for i in L ]
22.1 µs ± 150 ns per loop (mean ± std. dev. of 7 runs, 10,000 loops each)
```

Also, there is logical difference.

If we take a list of empty lists as input, both statements will fall with different exceptions:

```
In [30]: [ i[0] for i in L+[[]] ]
# IndexError: list index out of range

In [31]: [ i for i, in L+[[]] ]
# ValueError: not enough values to unpack (expected 1, got 0)
```

However, if we have more than 1 element in any of inner lists, then:
  - unpacking will fall with `ValueError: too many values to unpack (expected 1)`
  - and reading by index will *silently* return first elements of lists

["Explicit is better than implicit"](https://peps.python.org/pep-0020/) - they say, huh?

Hope you enjoyed! :)
JS Functions
Tags: javascript, beginners, programming, functional
Published: 2022-12-07 10:22:00

Functions are statements that perform some tasks. We define function using function keyword. Then we name the function and open curly braces{}, in which the statements are written. A function performs the task when we “call” it.

**Example:**

```
function age(x){
alert(x " years old")
}
```
if we write 
`age(19)
`
A window will be opened in which will be written 

_19 years old._

The function receives what are written in the brackets. It do the the operations with the arguments which were given and returns us the final result. We can create function once and reuse it. We can call it every time with different arguments and get different results. The variables which are declared inside the function are not visible outside the function. There also exists function composition. We can have functions inside functions.