teleren/devto huggingface dataset:
Compare well. React or React.js?
Tags: javascript, vue, react, angular
Published: 2019-11-05 09:08:11

Hello everybody. Recently I was searching for differences among hot javascript frameworks: Angular, React and Vue. In most resources the comparisons were among popularity, performance and learning curve. In popularity section, there were some criteria such as Stackoverflow Survey stats, Github stats (stars, contributors), NPM downloads and the one thing I want to talk about: **Google Trends**.

In most cases Google Trends comparison was unfair. Why? See below image:

![Unfair comparison among react, vue.js and angular.](https://thepracticaldev.s3.amazonaws.com/i/fcr0akkwvj0hk5jrxj4m.png)

In this chart, the comparison is among these words: react, vue.js and angular. As you can see, “vue.js” line is clung to the bottom while “react” and “angular” lines make more sense. Why this happens? Let’s remove “.js” from “vue.js” term and add it to “react”:

![Unfair comparison among react.js, vue and angular.](https://thepracticaldev.s3.amazonaws.com/i/g05501cj7sjevnvvaz4m.png)

Can you see it? This time that story happened to react.

So let’s do a fairly comparison, among these terms: “react”, “angular” and “vue” (all terms are without “.js” suffix):

![Fair comparison among react, vue and angular.](https://thepracticaldev.s3.amazonaws.com/i/ahsy16gp4ruk06pywq0v.png)

IMO, this comparison is more fair, real and makes more sense ;)
Don’t write Android apps like it’s 2009!
Tags: android, mobile, java, kotlin
Published: 2019-11-05 08:39:05

The following is based on my experience working on various Android apps for the past few years and seeing how the framework and the development ecosystem evolved over time.

## Concurrency
1. Avoid Async tasks, really do not use them. Kotlin coroutines (👍) or RxJava are much nicer to use.
2. Don't use Loaders, if you don't know what they are don't bother really.
3. Don't use bare threads or manage them on your own.

## Clean Code
1. Use a dependency injection framework, Koin is great to start with.
2. Avoid dagger in your first project.
3. Don't use Guice!

## UI
1. Use Jetpack Components instead of the original Android Support Libraries. And when going through old tutorials remember to replace dependencies with their `andoridx.*` equivalent.
2. The recommendation now is to build single Activity applications (or small number of activities) which contradicts the old advice of having a ton of activities. JetPack navigation works great if you follow this advice.
3. Don't use headless fragments for communicating between them within an activity. Maintain view state via ViewModels and shared ViewModels instead.
4. `ConstraintLayout` is great, give it a try.
5. Use `RecyclerView` instead of `ListView`, `GridView`, `GridLayout`, …
6. Favor Jetpack Fragments over platform Fragments.

## Push notifications
1. GCM is deprecated, use FCM instead.
2. Starting in Android 8.0 (API level 26), all notifications must be assigned to a channel, without a notification channel, the notification will not appear and the system logs an error.

## Other
1. Eclipse, what is that! Android Studio is great.
2. Use Room if you need to manage your internal databases. You can use them with Kotlin coroutines as well.
3. Use exo player for audio and video playback.
4. Use Kotlin instead of Java and make use of what Kotlin has to offer instead of writing Java code disguised in Kotlin syntax.
5. `DownloadService` is still great.
6. Keep an eye on Compose.
4 Tips for Newbie Software Developer 🥳
Tags: productivity, beginners
Published: 2019-11-05 08:36:47

So... I just got a job in a software company in the bay area!! One of my questions is how I can keep improving as a software engineer? I've put together some of my thoughts and tips for beginners. 

### 1. Optimize your code 

This isn't applicable for beginners only, even if you're a very experienced software developer, you should always optimize your code. Practice making your code better for readability, stable performance and maintainability. Fix what isn't broken. You can go through the codes you've written in the past and optimize them. 

### 2. Learn the program, not only the language

Just build something. Build anything. Sometimes your head is way too deep in the books and resources you just lose your potentiality. Some of the newbie software developers I know always rely on the books to find the "perfect first language". Nah, it doesn't matter. Your language doesn't matter. What matters is your ability to program and code. Learn the program.

### 3. Improve soft skills and productivity 

Coding isn't everything. No company would want to hire a person that has nothing without the coding ability. Spend sometimes outside of the computer and improve your soft skills. Personally I think communication skill is *very* important. Learn to communicate with your teams. Talk to people. There are tons of [productivity tools](https://quire.io/compare/best-productivity-apps) for you to work with your team. Use some of the apps to collaborate with the team and maintain the tasks progress ([Github Projects](https://developer.github.com/v3/projects/), [Quire](https://quire.io), [Trello](https://trello.com), etc. are one of the best task management software for developers). 

### 4. Know your limitation 

Don't be afraid to admit with your team that you don't know or need more time to fix the bugs. Make mistakes, ask questions, take advantages of the resources like [Stackoverflow](https://stackoverflow.com) or [Github](https://github.com) to ask questions. Compare yourself with no one but your old version. Keep going, keep moving forward :)
Visual Studio Online - Minhas considerações
Tags: vscode, vsonline, developmnt
Published: 2019-11-05 08:33:16

Vejo como um enorme passo para a galera **dev**, principalmente aqueles que trabalham com múltiplos **ambientes** e em múltiplos **dispositivos**.

Já vejo a alta possibilidade de ser **produtivo** utilizando um **tablet**, o real desenvolvimento por meio de alguma plataforma **mobile** parece estar crescendo de uma forma muito concreta.

Segue um dos posts falando sobre o [#vsonline](https://devblogs.microsoft.com/visualstudio/announcing-visual-studio-online-public-preview/)

Bora discutir sobre galera...
How I filter my arrays.
Tags: javascript, beginners, productivity
Published: 2019-11-05 08:28:07

Javascipt has a very active community and that provides developers with a plethora of options in when it comes to solving a simple problem. 

Although I myself love to use libraries like lodash or underscore when it comes to iterating on arrays or objects. I suppose for a beginner being able to read and understand MDN docs is really really important to get that strong foundation. 

MDN however has a tendency of being a tad bit technical, which may or may not intimidate beginner coders.

Anyways, this article is here to simplify or simply put forward a few of the everyday use-cases.

**Filtering an array**
So, keeping aside the libraries I'm going to show you a set of functions which you will help you filter an array in different ways and are supported natively by the language.

+ Find a value:
  Use ```array.find(callback)``` : It will stop and return the value as soon as the condition is satisfied.

+ Filter on the basis of a condition
  Use ```array.filter(callback)```: It will iterate through the whole array and return a new array with only those elements which satisfy the condition.

_**filter** can be used for **find** use-case but filter will iterate the whole array/list even if the first element was the only one that satisfied our condition_

+ Find if atleast one element in list satisfies our condition
 Use ```array.some(callback)```: It will stop and return a boolean value based on if the condition is satisfied (does not iterate the whole list).

_**some** has its own use case because find will return you the value but if you just want to check, a boolean value is well better just to maintain a standard practice_

+ Find if all the elements in list satisfy our condition
 Use ```array.every(callback)```: It will iterate through the complete array and return a boolean according to the condition i.e. **true** _if all elements satisfy our condition_ **false** _if any one of the elements do not satisfy our condition_

------

###Examples of all the above written functions
{% replit @mak119/arrayFunctionsForFiltering %}
365 Days of Coding Challenge: Day 4
Tags: codingphase, coding365challenge
Published: 2019-11-05 08:13:46

---
title: 365 Days of Coding Challenge: Day 4
published: true
description: Day 4 of my attempt to complete 365 days of coding
tags: #CodingPhase #Coding365Challenge
---

<p>
Sorry everyone for the late post. Today is my fourth day of <a href="https://codingphase.com">Joe Santos' (aka CodingPhase.com) Coding365Challenge</a>. I am still working on this HTML email. With this latest work, I switched from using the Bootstrap framework to <a href="https://codepen.io/idrissalemairethiam/pen/BaaYERX">ZURB's Foundation for Emails</a> as I realized that the Bootstrap framework was not displaying properly in several email clients (ie. Outlook).
<p>As I noted above, this method displays better and uses HTML tables (!!!).  In the coming days, I will be working more with the Foundation for Email framework to become more productive with producing layouts.</p>
<p>Here is the link to my CodePen for Day 4 and a screenshot below:
<a href="https://codepen.io/idrissalemairethiam/pen/BaaYERX">https://codepen.io/idrissalemairethiam/pen/BaaYERX</a></p>


![#CodingPhase #Coding365Challenge: Idrissa Lemaire Thiam's screenshot for Day 4](https://thepracticaldev.s3.amazonaws.com/i/upf0xea5p1b0num86pfo.jpg)
5 Terms Everyone in the Group Interview Should Know
Tags: career
Published: 2019-11-05 07:24:28

The Interview process is a great way to learn something new and apart from this, recruiters can save plenty of time and effort as well. 

The Interview is a process of selecting the best candidates out of several candidates which involves various stages, the interviewer focus on candidates' behavior, attitude, confidence and more so that they can get to know some glimpse and helps them to make the decision.

There are various advantages of group Interview compare to the Individual Interview such as

Quick selection

No matter how long the strength of the candidates will be, you can follow the same structure of the candidates for all of the candidates. It is easy to determine the candidates to whom you will reject or accept.

Scope of the discussion

In this scope, the candidates can speak about their opinion and also lets the interviewer understand the behavior and attitude of the candidate. They can also analyze how they try to convince, whether he/ she is introvert or extrovert and more.

Communication skills

Communication skills are one of the best ways to represent your words, convince them what you want to do and it is one of the best ways to prove yourself. Good communication skills will help your business to grow.

No further reviews needs

When you conduct group interviews you find that most or all of your questions were covered and at a certain point, you are much more clear to take the straightforward decision so there is no need to take further reviews. 

Build confidence

It can be noticed that many candidates don’t feel confidence initially so for the group interview is a good option to build confidence as it can be seen that other candidates prefer to answer so by observing them the candidates feel confident and start participating in the entire Interview process.

I hope that I covered many areas and will help you to achieve your goal.

A group interview is a good option when you have a large volume of candidates and that makes you save time, efforts, enhance the candidate's experience and builds trust at the same time.
	 	 	
About iSmartRecruit
We provide a recruitment tool that helps recruiters and corporate HRs to easily manage and transform their way of recruitment. We are the global players serving in 25+ countries, we frequently upgrade our tool as per the market needs and always appreciate our clients, prospects suggestions and we try our best to implement it. For more information, visit: www.ismartrecruit.com or mail us at sales@ismartrecruit.com we are here to help you.
Bootsmart multivendor marketplace
Published: 2019-11-05 07:11:59

INTRIGUING ECOMMERCE MULTIVENDOR MARKETPLACE SCRIPT!!!!!!!!!!!! Here comes the incredible and terrific #ecommerce multivendor marketplace solution to make your traditional business the trending one like #flipkart ot #amazon. Just take a look over the below link.

Get it here:
https://bootsgrid.com/bootsmart-multivendor-script/

#ecommerce #multivendor #ecommercescript #multivendorscript #marketplacescript #multivendorclone #bootsmartmultivendorclone #multivendorclonebootsmart #flipkartclonebootsmart #amazonclonebootsmart #bootsmartflipkartclone #bootsmartamazonclone #ebayclonebootsmart #bootsmartebayclone #onlineshopping #onlineshoppingcart #multivendormarketplacescript #onlineshopingmarketplace #multivendorscriptbootsmart #bootsmartmultivendorscript #bootsmartmultivendorclonescript #multivendorclonescriptbootsmart #bootsmartmultivendormarketplacescript #multivendormarketplacescriptbootsmart #phpclonescriptbootsmart #phpmultivendorscript #phpcopyscript #phpcodeignterscript
Method Chaining in JavaScript
Tags: javascript, chaining, methods
Published: 2019-11-05 07:10:39

> [Originally published in my blog](https://www.oriechinedu.com/posts/method-chaining-in-javascript)

Method chaining is a mechanism of calling a method on another method of the same object. There are different reasons for method chaining for different people. One of the major reasons for chaining methods is to ensure a cleaner and more readable code. Let's consider an example below:

```javascript
var recipeObj = new Recipe();
recipeObj.addIngredient('salt');
recipeObj.addIngredient('pepper');
recipeObj.getIngredients()
```
With method chaining, the code snippet above can be refactored to:

```javascript
var recipeObj = new Recipe();

recipeObj
.addIngredient('salt')
.addIngredient('pepper')
.getIngredients();
```
Looking at both snippets above, one would agree that the second is cleaner than the first.

## **What makes method chaining possible?**

What makes the method chaining possible is the `this` keyword. In JavaScript, the `this` keyword refers to the current object in which it is called. Hence, when a method returns `this`, it simply returns an instance of the object in which it is returned. Since the returned value is an object instance, it is, therefore, possible for other methods of the object to be called on the returned value which is its instance.

## Method Chaining Example in ES5

```javascript
function Recipe() {
  this.ingredients = [];
}
 Recipe.prototype.addIngredient = function (ingredient) {
   this.ingredients.push(ingredient);
   return this; // this makes chaining possible
 }

 Recipe.prototype.getIngredients = function () {
   if (!this.ingredients.length) {
     console.log('There is no ingredient in this recipe');
   } else {
     console.log(this.ingredients.toString());
   }
 }

 var recipeObj = new Recipe();

 recipeObj
 .addIngredient('salt')
 .addIngredient('pepper')
 .addIngredient('maggi')
 .getIngredients()

//salt,pepper,maggi
```

## Method Chaining Example in ES6

```javascript
class RecipeClass {
  constructor() {
    this.ingredients = [];
  }

  addIngredient = (ingredient) => {
    this.ingredients.push(ingredient);
    return this;
  }

  getIngredients = () => {
    if (!this.ingredients.length) {
     console.log('There is no ingredient in this recipe');
   } else {
     console.log(this.ingredients.toString());
   }
  }
}

 const recipeObj2 = new RecipeClass();

 recipeObj2
 .addIngredient('garlic')
 .addIngredient('pepper')
 .addIngredient('maggi')
 .getIngredients()

//garlic,pepper,maggi
```
## **Conclusion**
In this short article, I explained the concept of method chaining in Javascript and demonstrated how it can be achieved using the `this` keyword. You can give it a try. ✌️
for-in and for-of with arrays.
Tags: javascript, beginners, productivity
Published: 2019-11-05 06:48:44

So in the beginning of my career I was working for a project where I had to deal with a lot of arrays and objects. Also there was a requirement of an asynchronous task within the loop!
On taking up the task I was like, "Eh, I'm going to complete this thing in no time and then watch an episode ;-)".

``` for () { await *db_call* } ```

But then as soon as I finished up writing my code, I tested it (just the response as I was too confident of the logic and implementation) and was surprised to see "undefined undefined undefined.....".

Now "How to do an asynchronous task in a loop?" is a separate post. Here I will talk about how I approached looping.

JavaScript has way too many methods to loop and doing asynchronous tasks within each one has a different level of difficulty but since this post is for beginners, the most basic loop is the for loop.
Yup, talking about the omnipresent for(var i = 0; i<limit; i++){}.
If we are talking about ES6, we also get very basic and easy to use (with easy to do async tasks facility) for-in and for-of loops.

What I learned is what I am going to share with you in the simplest way possible.

Syntax: _for(let item in array){}_ -> **item will hold index of arrays**
Syntax: _for(let item of array){}_ -> **item will hold element of arrays**

Therefore, we can also call them as:

for-in -> 
```for(let index in array) 
    {
      // body
    }```

for-of -> 
```for(let element of array) 
    {
      // body
    }```

# Example:
## for-in
{% replit @mak119/usingFor-inWithArrays %}

# Example:
## for-of
{% replit @mak119/usingFor-ofWithArrays %}
Some of the Git commands you must know for open-source contribution.
Published: 2019-11-05 06:47:38

For every developer out there, mostly the junior developers like me that want to improve their skills in this field of coding, should look more into open-source contributions & attending meetups at both local and remote level.

let's dive in:-
For a repository you want to contribute to (given that the issue is open and known to you, maybe - like after communicating to the mentor),

> ### a) Fork the repository you want to contribute to.
1. You should be logged into GitHub with your account.
1. Find the GitHub repository with which you’d like to work.
1. Click the Fork button on the upper right-hand side of the repository’s page.

### b) Clone the repository in your command line.
> `git clone <repo_url>` 
##### e.g.
> `git clone https://github.com/lailahgrant/reactWork.git`

### c) Change location(directory) into the cloned repo

> `cd reactWork`

### d)create a branch(where you will push your changes & not to the `master`) e.g
> `git checkout -b lailah`
#### `lailah` in this context is your branch name(branch name can be any meaningful name).

> ###  In case you make changes on the project, talk to the person and make a pull request(PR).

###  e) To check which branch you are on (you must be on your branch), Run
> `git status`
 
### f) To add all files you have changed, Run
> ```git add .```

### g) Commit your changed with a meaningful message, Run
> `git commit -m "meaningful message about your changes"`

### h) Now it is time to push your changes to your branch, Run
> `git push origin lailah`
##### or
> `git push --set-upstream origin lailah`

## Thanks for your time hopefully you found this article helpful.
25 Days to Release a Game
Tags: python, gameoff, github
Published: 2019-11-05 06:25:27

I've decided I need to brush up on my Python, so I've opted to take part in this year's [Game Off](https://itch.io/jam/game-off-2019), GitHub and itch.io's annual competition for game developers, or aspiring ones. 

This year's theme is **leaps and bounds**, for which I already have a couple of ideas.

There really isn't a huge need to read this post, so I'll end it here. It's just an effort to make my plans public to ensure I stick with it.

![Countdown to GitHub GameOff](https://thepracticaldev.s3.amazonaws.com/i/rkha1ccttrm0gc4kozvz.png)
When Builder is anti-pattern
Tags: java, lang, beginners
Published: 2019-11-05 05:16:26

---
title: When Builder is anti-pattern
published: true
description: Blind use of patterns considered harmful
tags: #java #lang #beginners
---

Some time ago I worked on the project which was full of "best practices", applied thoroughly everywhere. One of such "best practices" was mandatory use of Builder to create POJO's. Most of the POJO's boilerplate code was generated by IDE plugin, but it was only tiny portion of code. Actual problem was the use of these POJO's. Code was flooded with pieces like this:

```java
    final MyPojo pojo = MyPojo.newBuilder()
                              .setThis(...)
                              .setThat(...)
                              .setSomethingElse(...)
                              ...
                              .build();
``` 
Such an overuse of the builders has several negative effects:
 - code is unnecessarily verbose (I'd even say heavily noisy)
 - code is error prone

While first issue is more matter of taste, second one is not:  
__There is no way to tell at compile time if all necessary fields are set.__ 

Plain all-args constructor or factory method works better in this case - compiler will make sure that I'll pass all parameters necessary to create POJO. How correct are these parameters it's the another story, but all of them definitely will be there. With builder I can easily omit one or two. Issue will appear later, at run time, when I get NPE.

The bright mind who introduced that practice in mentioned above project, decided that best way to solve the problem is to add validation into the `build()` method. It resulted that instead of getting NPE's in random locations, we started getting them inside `build()` methods. Nice improvement, isn't it? 

The described above anti-pattern is an example of wider class of heavy design mistakes - shifting errors from compile time to run time. Such a shift is call for troubles of any size, from longer and more painful development to huge losses for those who uses the application. 

So, what's the correct use of Builder? 

My criteria of correct use of Builder pattern is extremely simple: 
__The `build()` method must produce *complete* instance. All necessary fields must be set to reasonable defaults if user did not provide values for them.__

POJO's rarely fall into category of classes which can be built this way. Usually POJO has most or all fields necessary to represent information which just does not have reasonable default values.

Another place where Builder is often used are things like server or client configurations and usually Builder's are perfectly fine to this kind of applications.
Stacks 
Tags: computerscience, algorithms, datastructures, csharp
Published: 2019-11-05 05:13:23

## Resources

1. [Stack overview](https://www.interviewcake.com/concept/java/stack)
1. [Stack implementation](https://www.geeksforgeeks.org/stack-data-structure-introduction-program/)
1. [Stack overview and implementation](https://brilliant.org/wiki/stacks/)

Takeaways:

* Stacks are LIFO (Last In First Out) - similar to a stack of books. When you retrieve an element from a Stack, you get the element that was added most recently.
* The last element added to a Stack is called the "top" element. This makes sense if you think about the stacking books analogy - the book you add last will be at the top!
* Stacks have fast operations: adding (pushing), removing (popping), and retrieving the top/last element (peeking) are all `O(1)` (constant).
* Space is `O(n)`.
* Stacks are commonly implemented with Arrays or Linked Lists. To keep my implementation simple, I went with a regular (versus dynamic) array - this means the consumer of the Stack class is required to provide a size on initialization.

Here's the finished implementation with test code:

{% gist https://gist.github.com/jbolton209/3fcdfea2073fd8637659e0b3e0a3e813 %}

As always, if you found any errors in this post please let me know!