teleren/devto huggingface dataset:
What Would Your Perfect Programming Language Look Like?
Tags: discuss, programming
Published: 2019-11-14 05:33:14

---
title: What Would Your Perfect Programming Language Look Like?
published: true
description: Just want to hear everyone's thoughts describing your perfect language.
tags: #discuss,#programming
---

So throughout my career I have learned a number of languages and all have their pros and cons. PHP has some weird choices, Python's OOP seems meh, Go is verbose, and JS can be confusing. This has got me thinking: what features and syntax could I combine to create the "perfect" language for me.

I'll share my thoughts first and I hope to hear from you all on what would be perfect for you!

Starting off I like OOP, so my fictional language would have OOP components. I also like having the flexibility to just write functions. So a mix like Python and PHP. I like static typing and performance, so pre-compiled and optimized it is. I don't write drivers, games, or OSes so I will forgo explicit memory management for convenience at the cost of performance. I like Go's and typescripts type inference so lets keep that, but with the option of explicit declaration. Go's multiple return types is kind of magical, so lets keep that. But let us keep exceptions and try/catch because that cuts down verbosity. Let's also take another page from Go and keep the language fairly simple. It is 2019 so  multithreading/coroutines must be easy to use. Oh and JS has these effortless awesome maps called objects, lets keep as much of that as we can with static typing. 

So what could my smashed together language look like? Well lets take a peak...

Classes

```

//hmm interfaces can define properties too like typescript...
//also imports are simple directories relative to the src folder or vendor folder.
//with the exception of the standard library
import AnimalInterface from App/Animals

class Dog implements AnimalInterface
{
  protected sound = "woof!"; //infers string
  public hasFur: boolean;
  
  //I'm torn as to whether I want the word function, func, fn or nothing...
  public func makeNoise(): void {
    print(this.sound);
  }

  public func getDetails(): (boolean, string) {
    return this.hasFur, this.sound;
  }
}
```

Looping

```
numbers = [1, 2, 3, 4];
map = {
 "dog": "bark",
 "cat": "meow"
}; //string => string map

//hmm do i like the map type syntax from go?
anotherMap: map[string]string = {}

for number in numbers {
  print(number);
}

for i = 0; i < 3; i++ {
 number = numbers[i];
 print(number);
}
```


This is hardly everything in a language, but hey it is a start! Now it is your turn.
Apprenez à développer des applications décentralisée sur la Blockchain WAVES.
Tags: wavesplatform, france, blockchain, ride
Published: 2019-11-14 05:21:10

Bienvenue sur Waves Dev France !

Si vous êtes intéressé par l'apprentissage du développement d'application décentralisées nous sommes la pour vous aider!

La Blockchain Waves à démarré un nouveau programme d'éducation sur plusieurs pays afin d'aider GRATUITEMENT les développeurs à se former sur la plateforme WAVES.

Je suis actuellement en charge de la France (et des Philippines) et je travail à la préparation de futures webinars gratuits prévus pour début 2020

Si cela vous interesse alors restez connectés via nos différents réseaux sociaux afin d'être les premiers informés des dates : 

TELEGRAM: https://t.me/wavesdappsFR
TWITTER: https://twitter.com/WavesDevFr
FACEBOOK: https://www.facebook.com/wavesfr/
MEETUP: https://www.meetup.com/Paris-Waves-Blockchain-Meetup-Group/
What API documentation generator/tool do you use?
Tags: discuss, documentation
Published: 2019-11-14 05:19:27

What API documentation generator / tool are you folks using?

Hard requirement for me is version-able documentation - you can change versions on the documentation page in case you're not up-to-date and get whatever we've set as the documentation at that version. Ideally the documentation would show a pull request-like output (red deleted, green added) between versions as well. I remember there being a documentation generator that did this some years ago but cannot remember the name. Pretty sure the maintainers stopped working on it.

I am really trying to avoid Swagger/OpenAPISpec. I have not enjoyed using it in the past. Coming from a security background, Swagger's maintainers' [misunderstanding](https://swagger.io/docs/open-source-tools/swagger-ui/usage/cors/) of some pretty important concept like CORS bothers me in an irrational way. (Hint: [CORS is not, as they claim, a security control; it is a security bypass](https://youtu.be/tH-HG4b4GYQ?t=2170)).

I've heard good things about <https://readme.com>, however I do not like that there is not a single example of their product on their site. They make you contact them to register before - presumably - you get to see what their product actually looks like.

EDIT: The readme founder has helpfully commented below and explained that the company logos listed on the web page link to each company's respective public docs. They serve as good examples of the product.

<https://readthedocs.org/> seems decent and has that versioning support I am interested in.

I could build a [GitHub Learning Lab](https://lab.github.com/) for my API... /s.

What do you folks use? If you use the OpenAPISpec, as I imagine most do, what tools do you use to generate your docs? Do you like what you use? What is it missing?

EDIT: Good folks in the comments have reminded me that [ApiDoc](https://apidocjs.com/example/) is the documentation that I describe above and couldn't remember the name of. There are some really interesting new products in the comments; I am not sure which I will proceed with.
Learn how to develop dApp on Waves Blockchain
Tags: wavesplatform, philippines, blockchain, ride
Published: 2019-11-14 05:14:19

Welcome to Waves Dev Philippines !

If you are interested into learning Blockchain Decentralized Applications development, we got your covered!

Waves Blockchain recently started a Lead Program over several countries with the main goal to bring Blockchain Development FREE education.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/64nukttyxf759i0f4cvt.png)

I'm currently in charge of Philippines (as well as France) and im working on FREE workshops preparation for early 2020.

Please stay tunned and join our social networks to be updated:

TELEGRAM: https://t.me/wavesDevPh
TWITTER: https://twitter.com/WavesDevPh
FACEBOOK: https://www.facebook.com/WavesPhilippines/
MEETUP: https://www.meetup.com/waves-blockchain-community-ph/
Introduction to Ethereum ERC20 tokens for beginners
Tags: blockchain, ethereum, solidity, tokens
Published: 2019-11-14 04:57:10

---
title: Introduction to Ethereum ERC20 tokens for beginners
published: true
description: 
tags: blockchain, ethereum, solidity, tokens
canonical_url: https://www.youtube.com/watch?v=o9Ux3xDrkIo
---

ERC20 tokens are the most popular type of tokens on Ethereum. They can represent fungible assets like company shares, virtual currencies, vouchers, etc..

In this ERC20 token tutorial, I will walk you through the specification of ERC20. We will go through all the functions of the specification, including the transfer functions:

- simple transfer with transfer()
- delegated transfer with approve + transferFrom()

For delegated transfers I will give you a practical example by explaining how decentralized exchanges (DEX) transfer tokens with approve and transferFrom.

If you are a developers who want to understand how erc20 work and how you can transfer erc20 in your smart contract, [this video](https://www.youtube.com/watch?v=o9Ux3xDrkIo&list=PLbbtODcOYIoGOvl0KH57_nfvEKOYV6qdT&index=2) is for you :)

{% youtube o9Ux3xDrkIo %}
React.memo, useMemo, and useCallback for Performance Optimizations in React
Tags: javascript, react, tutorial
Published: 2019-11-14 04:25:20

---
title: React.memo, useMemo, and useCallback for Performance Optimizations in React
published: true
description: Learn how to optimize React Components using React.memo, useMemo, and useCallback hooks.
tags: javascript, react, tutorial
canonical_url: https://codebushi.com/react-performance-optimizations/
---

*This article was originally published at [codebushi.com](https://codebushi.com/react-performance-optimizations/)*

{% youtube 4BranN3qnDU %}

Key Takeaways From The Video:

4:40 - When a Parent Component re-renders, all Child components will re-render as well.

5:30 - React.memo is a higher order component, used with functional components. React.memo will compare the previous props to the next props, and if different, will re-render the component.

6:52 - JavaScript Primitives (string, number, boolean) being passed as a prop will work fine with React.memo.

7:30 - Arrays, Objects, and Functions being passed as a prop will not work with React.memo alone. You'll need to use hooks like useMemo around the Array or Object.

8:17 - In a functional component, every re-render will cause everything in the function body to be "re-created". So Arrays, Objects, and Functions will be new and different on every re-render. When these are passes to the Child Component, it will cause the Child to re-render.

8:55 - Wrapping Arrays and Objects with the useMemo hook will solve this problem. Better yet, if the dependency array is empty, you should just hoist it out of the function body.

14:24 - When passing Functions down as props, and when Functions are used in a dependency array, wrap them in the useCallback hook to avoid re-renders and prevent useEffects from firing on each re-render.

20:30 - Don't just memoize all the things. Here is the blog post by Kent about when you should use these memoization techniques:  https://kentcdodds.com/blog/usememo-and-usecallback

Finished Code: https://github.com/codebushi/react-memo

If you like the YouTube content, please support it by [subscribing to the channel!](https://www.youtube.com/channel/UCS6lPt9btmTG3GkU82ELygA)
Updating redux-form fields using bindActionCreators
Tags: react, redux, reduxform
Published: 2019-11-14 04:22:54

---
title: Updating redux-form fields using bindActionCreators
published: true
description: I have a `redux-form` that contains a dropdown dependent on the selected value of another dropdown.
tags: React, Redux, redux-form
---

I have a `redux-form` that contains a dropdown dependent on the selected value of another dropdown.

I have a filter method to slim down the options from the state and fill my dependent dropdown, and it looks great.

I noticed that I had to select a dropdown item from the dependent dropdown to have the value updated in the store.

That's how I found out about `redux-form` [Action Creators](https://redux-form.com/6.0.0-alpha.4/docs/api/actioncreators.md/). They are the internal actions from `redux-form`  to dispatch them as we need.

My interest was to change that field when filtering the dependent dropdown options. `redux-form` provides the `change` method for cases like this.

Setting it up was as simple as:

```javascript
import { bindActionCreators } from 'redux'
import { Field, change } from 'redux-form'

// other imports ...
```

```javascript
const mapDispatchToProps = (dispatch) => ({
  updateField: bindActionCreators((field, data) => {
    change(FORM_NAME, field, data)
  }, dispatch)
})
```

Then using it:

```javascript
this.props.updateField('dependent_field_name', newValue)
```

Something important to note and quoting redux's [documentation](https://redux.js.org/api/bindactioncreators#bindactioncreatorsactioncreators-dispatch) on `bindActionCreators`:

> The only use case for bindActionCreators is when you want to pass some action creators down to a component that isn't aware of Redux, and you don't want to pass dispatch or the Redux store to it.
Any active contributors on Stackoverflow?
Tags: discuss
Published: 2019-11-14 04:05:07

Reputation values are changing across Stack Overflow

https://stackoverflow.blog/2019/11/13/were-rewarding-the-question-askers/


I got 600 reputations. It is a good chance for me because of its added value for good questions. what about others and whats your thoughts on this change?
The Micropreneur Toolkit
Tags: startup, sideprojects
Published: 2019-11-14 03:59:22

If you’re building a software product during your nights and weekends, then you don’t have any time or money to waste. That doesn’t stop most people from writing code they don’t have to write, spending time configuring things they don’t have to configure, and paying bills they don’t have to pay.

Here are some tools I’ve found that will save you thousands of dollars and hours as you build a software product in your spare time:

## A static site generator (e.g. Hugo, Jekyll, Gatsby)

What it is: A tool that transforms a config file and markdown files (that you write) into a complete website.

What it replaces: Wordpress, Squarespace, or a bespoke website written from scratch.

Why it’s better:

* Cheap (plenty of free themes and great ones for less than $100).
* Quick to configure (you’re just editing a config file and writing markdown).
* Totally customizable (you can always edit the HTML and CSS if you want to).
* Hostable for free on Netlify (because there’s no PHP backend like Wordpress).

## Netlify

What it is: A hosting platform with excellent tooling.

What it replaces: AWS EC2, Digital Ocean, a server in your garage.

Why it’s better:

* No server to manage.
* Completely free for teams of one.
* Amazing integrations with GitHub (every time you open a PR it creates a unique URL previewing the changes).
* Handles migrations and rollbacks for you (just click a button).
* Automatically requests and renews SSL certs for you (once you configure it).

## Firebase

What it is: A service built on top of Google Cloud that solves common problems for you. It was originally intended to support mobile apps but works just as well for SaaS.

What it replaces: A standard backend web API.

Why it’s better:

* Handles common use-cases like account creation, email validation, and password resets (you just make an API call from the front-end and Firebase handles the rest).
* Database support (SQL and NoSQL) that you can effectively and securely query from front-end code.
* Extremely cheap (especially for MVPs). You’re charged based on usage - not a flat fee per month like if you were running a server.

## Looka.com

What it is: A website that lets you design your own logo by browsing through thousands of variations on logos, colors, and fonts.

What it replaces: Making something yourself or hiring a designer for thousands of dollars.

Why it’s better:

* Probably higher quality than something you could do yourself.
* Fast (you’ll be done in 30 minutes).
* Cheap (you can get both SVGs and PNGs for $65).

## Unsplash.com

What it is: A place to find high-quality images.

What it replaces: Subscribing to some image repository, limiting yourself to images in the public domain, or desperately searching for “free images” and hoping they don’t have an attribution clause.

Why it’s better:

* Hundreds of thousands of images.
* Free.
* No attribution necessary.

Those are some of the tools I’ve found especially useful in my micropreneurial journey. Hope you found it useful! Anything I’m missing?
How to iterate Object literal's values in JavasCript without dot notation or any other way.
Tags: javascript
Published: 2019-11-14 02:55:32

Hi, my name is Ayyub Ali and this is my first post in Dev community world.
This kind of reminds me my days of learning to code scary and excited, please don't judge me because of my poor writing skills, all I want is to create something useful to the beginners out there, who might be searching answers for an easy thing like getting values of an awful looking old Object literals in JavaScript. this is going to be quick easy to read a post, while maintaining the ability to make this post intriguing and comprehensive at the same time. 
Ok, I have introduced my self in a humble way. but too much humbleness brings humiliation, So now let's set up our playground to show off this code.
Click the link below.
 
https://thepracticaldev.s3.amazonaws.com/i/ddpyyy8hfojkjw41dq6z.png
There you go that was it
Here Is The Powerful Guide Of Spread Operator/Syntax In ES6
Tags: javascript, tutorial, webdev
Published: 2019-11-14 02:52:07

Spread Operator in [ES6](https://buginit.com/tag/javascript/) or syntax ( according to MDN it is syntax) so let’s call it syntax. Well, they also call it **three dot operator**.

**So how it looks like?** Oh, it is simply three dots `...`

**When did it release?** Of course in ES6.

**What it actually does?** The spread operator in [ES6](https://buginit.com/tag/javascript/) turns iterable values into arguments. we will come back on definition later, for now

## Let’s understand with an example.
Let say: you have two [arrays](https://buginit.com/tag/arrays/) called `mid` and `all`. And you have to insert `mid` in the middle of `all`. Quickly!!!

```javascript
let mid = [3, 4];
let all = [1, 2, ...mid, 5, 6];
```

Expected Output: `[1, 2, 3, 4, 5, 6]`

Awesome!! That’s all, Yeah you got it!!

![a meme for you](https://buginit.com/wp-content/uploads/2019/10/ive-never-been-proud-of-you-meme-300x261.jpg)


According to MDN, Here you got the long boring definition below:

Spread syntax allows an iterable such as an array expression or string to be expanded in places where zero or more arguments (for function calls) or elements (for array literals) are expected, or an object expression to be expanded in places where zero or more key-value pairs (for object literals) are expected.


**So that’s all, do I know all about it?** Naa! man, life isn’t that easy 🙁

#### **What actually you can do with spread syntax? Let’s break it down with examples in short.**

## #1 Apply for new

When calling a constructor with new it’s not possible to directly use an array as arguments. But now you can use an array directly for example:-


```javascript
var dateFields = [1970, 0, 1];  // 1 Jan 1970
var d = new Date(...dateFields);
```

### [To see all 6 types of example the complete guide of Spread Operator/Syntax In ES6](https://buginit.com/javascript/here-is-the-powerful-guide-of-spread-operator-syntax/)
Wanting to learn Gastby turned into running an impeachment website. 
Tags: showdev, gatsby, react, javascript
Published: 2019-11-14 02:18:24

**tl;dr** I built https://www.impeachment.dev/ with Gatsby

### 🕰 Background

A few weeks back, I was having a conversation with my mother and was attempting to explain everything that was going on with the current impeachment inquiry happening in the United States. 

I quickly realized it would be easier if I could send her a timeline of events that lead to this point. After searching Google and couldn't come up with a timeline, I thought about creating my own! I figured that most of the information on the site would be static, and since I wanted to learn more about JAMstack, I went with Gatsby.

### 🤯 What I Learned
1. Gatsby is AMAZING if you want to quickly build out a website using the templates provided in their documentation. Most of my dev time was spent customizing what I wanted the site to look like, and very little time on configuration.
2. Adding a pipeline from Github → Netlify build was 😘👌\*chef's kiss\*. Setup took all of 5 minutes and now anytime `master` is updated, the website is updated within a few minutes allowing me to push out updates fairly quickly!
3. Writing & researching about politics in a non-biased way is fairly difficult, but was a fun challenge for me!

### 🔨 Build Tools
- [Gastby](https://www.gatsbyjs.org/) + [Gatsby Starter Kit](https://github.com/gatsbyjs/gatsby-starter-default)
- [Semantic UI](https://react.semantic-ui.com) + [Vertical Timeline Component](https://github.com/veysiyildiz/vertical-timeline-component-for-react)
- [Mocha](https://mochajs.org/) & [Enzyme](https://airbnb.io/enzyme/)
- [CircleCI](https://circleci.com/) (Going to move to Github Actions soon!)
- [Netlify](https://www.netlify.com/)

### 🤔 What Now?
- Well, currently I'm trying to update it as often as possible, but it's becoming increasingly harder with how fast information is coming out. (contributors welcome 😉)
- I think optimizing the site would be next. Currently the search function isn't the fastest or most performant, so updating that would be great.
- Possibly build out individual profiles for the "key people" that would then produce an individual timeline of events for each person.

⬇️ Check out the website ⬇️
https://www.impeachment.dev/

⬇️ Want to contribute? (PRs are very welcomed, still missing info!) ⬇️
https://github.com/tylerbmcsilva/impeachment-2019
Darkmode.js Emoji Rendering Fix
Tags: javascript, css, wecoded, theycoded
Published: 2019-11-14 01:31:37

As of recent web designers and developers have been implementing a dark/light mode toggle feature on their websites. I decided to try it out by adding a widget via [Darkmode.js](https://darkmodejs.learn.uno/). 

#Ways to Implement:
- via JSDelivr CDN.
- using NPM.
- Enable/disable Darkmode programatically.

I used the CDN and the following object to render the widget.
After saving, I ran into an issue with the label not rendering the emoji. 

#My document:

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/pp2t6q6dc79ymjmh8rjt.png)


#Alternate document:

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/a0mf8iojbiwobntpv3hu.png)


I tried a few things like viewing my document in different browsers, editing the options, adding a positive value for the z-index and hardcoding the emoji within the document, etc. 

I then decided to try the ::after pseudo element.

#Fix:

```css
.darkmode-toggle::after {
content: "🌓";
}
```
#My Updated Document:
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/l121zi5e6nshehhqrsst.png)


That fixed the issue.

There are probably other fixes out there, this was mine. [Here] (https://github.com/sandoche/Darkmode.js/issues) is the issues page.
Recommended Terminal for Windows?
Tags: discuss, productivity
Published: 2019-11-14 01:17:29

For years I've been using ConEmu for basic Git/cmd commands. It would look something like this. Quite simple, but would get the job done after spending a few minutes configuring and setting _tasks_ accordingly.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/q26k6nls5q7da9dgrqzv.gif)

Lately, however, I had to dig deeper into servers and ConEmu started to fail on me. SSH-ing into a remote server, connecting to a specific docker container and trying to _nano_ a basic file wouldn't allow me to properly visualize the file (let alone navigate or modify it).

Therefore, here's my question for my fellow Windows users: what do you use / recommend? I'm kinda stuck and I'm not sure how to proceed in my  day-to-day tasks.

P.S. I've read about the new `Windows Terminal` (preview). Haven't tried it yet, but I assume there's gonna be a while until a stable version will be released.
Ex-Googler lifts the lid on search myths
Tags: seo, proptech, realestsate, search
Published: 2019-11-14 00:43:28

x-Googler lifts the lid on search myths, key takeaways.

SEO is renowned for misinformation, misunderstandings, and misconceptions. This is in no small part due to Google being somewhat of a black box in order to try and limit gaming of SERPs.

However, in recent times, Google has taken noticeable steps to become more transparent through increased activity in the SEO community.

    SEO is not a one-time thing it’s ongoing.
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/jt0tiui0f58tt8z1kl83.jpg)
prop.tech seo myths for realty websites

2. It is true new domains do infact experience a honeymoon period.

3. The basics, speed, links, neighborhood really really matter.

4. The idea Google has a personal vendetta solely against your site is always proven wrong with a quick audit.

5. Freshness matters.

6. Paid spend does not influence organic signals.

7. All sites are repairable if you work with them.

    hashtag#sites hashtag#seonews Very interesting read. #proptech