teleren/devto huggingface dataset:
The Function of Objects in Javascript
Tags: objects, javascript, this, method
Published: 2018-10-31 17:18:47

---
title: The Function of Objects in Javascript
published: true
description: 
tags: Objects, Javascript, this, Method
---
![](https://thepracticaldev.s3.amazonaws.com/i/zsw1a582x1gz55hcix3h.png)

Hello fellow Javascript coders,

This article will provide a clear and succinct explanation of the qualities of objects in Javascript and the various uses that each type of implementation has in creating the most efficient and least memory-intensive functions. 

In its very definition, Javascript is a prototypal object-oriented language which means that everything in JS is an object of some type except for the primitive data types (number, string, and boolean). An object can have properties that can be called using dot notation. For example, we can take a look at this object: 

`var car1 = {
company: 'Ford',
model: 'Mustang',
color: 'red',
isLocked: false
};`

The object `car1` has three properties `company, model, and color` and the line `car1.model` will, in turn, return the value `'Mustang'`. Objects can also have methods which are functions that are specific to the object and are not defined above or outside its scope. We can take the same `car1` object and add two methods `paintBlue()` and `lock()`:

`var car1 = {
company: 'Ford',
model: 'Mustang',
color: 'red',
isLocked: false,
paintBlue() {
    this.color = 'blue';
},
lock() {
    this.isLocked = true;
}
};`

Now that these methods are added in the `car1` object, they can be called using dot notation just like any other property. For example, `car1.paintBlue()` will change `car1.color` from `'red'` to `'blue'`. Note, also, that the `this` keyword has to be used to allow the object to reference its own property and not change the scope of the function. 

With the functionality of properties and methods, objects are very integral in creating helpful Javascript functions and, even, full-stack web applications.
Go's ORM framework GORM best practices indefinite parameter usage
Tags: go, gorm, google, transalte
Published: 2018-11-01 03:52:55

---
title: Go's ORM framework GORM best practices indefinite parameter usage
published: true
description: 
tags: go, gorm, google, transalte
---

This is translated by Google.

[link-->](https://translate.google.com/translate?sl=auto&tl=en&js=y&prev=_t&hl=en&ie=UTF-8&u=https%3A%2F%2Fjingwei.link%2F2018%2F10%2F31%2Fgolang-variadic-with-gorm.html%3Fhmsr%3Dtoutiao.io%26utm_medium%3Dtoutiao.io%26utm_source%3Dtoutiao.io&edit-text=&act=url)

Hope dev.to can support google translate.
Foreach array loop breakdown
Published: 2018-10-31 23:44:19

---
title: Foreach array loop breakdown
published: true
description: breaking down For each loops to make it easier.
tags: 
---

Hello guys, I am still a beginner in using JavaScript, but I am here to share one of the hardest problem my colleagues and I have encountered while learning JavaScript. Foreach array looping is not one of the hardest method, but was one of the hardest method to get in to habit. Since we have learned for loop before foreach array loop and everything, I think, could have been done the same without using foreach array loop. 

Here is a simple example on for loop:

![alt text](https://thepracticaldev.s3.amazonaws.com/i/nnb65dxv6w7my7v3snih.PNG)

The output of the console log for loop is:

![alt text](https://thepracticaldev.s3.amazonaws.com/i/ruurz6irhmblcgn5itxk.PNG)


Also, this is a simple example on Foreach loop is:

![alt text](https://thepracticaldev.s3.amazonaws.com/i/bwrzbueyxqsf0nydoiyw.PNG)

The output of the console log for Foreach loop is:

![alt text](https://thepracticaldev.s3.amazonaws.com/i/ruurz6irhmblcgn5itxk.PNG)

If you take a look at both examples, way the code is written is different but both of the loops have the same output.

So, in theory, exampleArray.forEach method is equal to for(let i=0; i < exampleArray.length;i++) and the function inside the forloop is equal to function inside the forEach loop.

![alt text](https://thepracticaldev.s3.amazonaws.com/i/f6v45ilx1d2iivo4djmv.PNG)

Ob-course we know there are no variable i in foreach loop so to create methods using the variable i it would be better to use forloop. 

Here is another example including the if statement inside a forloop:

![alt text](https://thepracticaldev.s3.amazonaws.com/i/1nvf0htxnydrqs8nsue6.PNG)

And a example of foreach loop with if statement:

![alt text](https://thepracticaldev.s3.amazonaws.com/i/c0228f08tnsauguuj1qx.PNG)

In this examples, if statements are included in both of the forloop and foreach loop. In the forloop example, the array is represented using array variable name followed by a bracket. The i in bracket is a number that represents the position of the currently selected array. The for loop checks if the array is smaller then three and adds three if true and does nothing to the array if false. In the foreach example, number represents each of the array in order and it checks if the number in array 0 or 1 is smaller than the value of 3 and adds values of 3 if the number in each of the array is smaller then 3. So the upside for using forloop is array can be picked out with the pointer, but the downside would be that the code is much longer and messer.
📊 Languages' Popularity on DEV
Tags: meta, discuss, javascript
Published: 2018-10-31 23:42:56

---
title: 📊 Languages' Popularity on DEV
published: true
description: Some statistics about language tags on DEV
tags: meta, discuss, javascript
cover_image: https://thepracticaldev.s3.amazonaws.com/i/dib1fun606s5xd3sfn3h.png
---

Today, while writing an article on `PHP` resources on DEV, I found myself comparing the number of articles of the most popular language tags out there (`PHP`, `JS`, `Go`, ...).

Finally, I searched a bit and I did it for every languages.

Before today, I just had the feeling that many posts were about `Javascript` or related stuff. The fact is that the results are amazing: 56% of the posts related to programming languages are about `Javascript`! 😲

Language | Framework or related | # | %
--- | --- | --- | ---
Ada | | 1 | 0.01%
Julia | | 1 | 0.01%
Cobol | | 2 | 0.02%
Smalltalk | | 2 | 0.02%
Objective-C | | 5 | 0.04%
Lua | | 11 | 0.09%
Erlang | | 14 | 0.12%
R | |22|0.19%
Haskell | |22|0.19%
Lisp | |24|0.20%
 | *incl Scheme* | *5*|*0.04%*
Crystal | |26|0.22%
Dart | |34|0.29%
Perl | |35|0.30%
Clojure | |42|0.35%
Scala | |49|0.41%
Elm | |75|0.63%
C++ | |88|0.74%
Rust | |121|1.02%
C | |154|1.30%
Kotlin | |156|1.32%
.NET | |156|1.32%
Elixir | |167|1.41%
Swift | |169|1.43%
C# | |200|1.69%
Android | |374|3.15%
Java | |383|3.23%
Go | |393|3.31%
PHP | |725|6.11%
 | *incl Symfony* | *14*|*0.12%*
 | *incl Laravel* | *182*|*1.53%*
Ruby | |859|7.24%
 | *incl Rails* | *324*|*2.73%*
Python | |865|7.29%
 |*incl Django* | *95*|*0.80%*
Javascript | |6684|56.36%
 | *incl jQuery* | *38*|*0.32%*
 | *incl Express* | *78*|*0.66%*
 | *incl Redux* | *128*|*1.08%*
 | *incl Typescript* | *188*|*1.59%*
 | *incl Angular* | *260*|*2.19%*
 | *incl Vue.js* | *368*|*3.10%*
 | *incl React Native* |*382*|*3.22%*
 | *incl Node.js* | *782*|*6.59%*
 | *incl React* | *1066* | *8.99%*
**TOTAL** | |**11859**|**100.00%**

> I included frameworks, libraries and variants in their related languages (e.g. `jQuery` in `Javascript`.

More than `Javascript`, the statistics show that frontend languages, frameworks and libraries are massively tagged unlike backend ones that are under-represented.

A language like `Go` only has 3.3% of the language tags, which is very low compared to the *real* popularity of the language.

`Haskell` is almost inexistent whereas it's very popular in functional programming.

I don't know what to think about this 🤔. And you?
Advice on .ly domains.
Tags: anonymous, discuss
Published: 2018-10-31 22:03:20

---
title: "Advice on .ly domains."
published: true
tags: anonymous, discuss
---

_This is an anonymous post sent in by a member who does not want their name disclosed. Please be thoughtful with your responses, as these are usually tough posts to write. Email sloan@dev.to if you'd like to leave an anonymous comment._

Does anyone have experience with .ly domain names? I'd love one for my personal site but have ran into some issues. So I am an American and .ly domains are owned by the country of Libya. That was the first red flag for me. The second is that there is no anonymous registration. The faq says:

"We don’t have this service included at the time being, but we are working to add it soon.
However, you do not have to supply a private address or phone number for the contact persons registered on the domain. It is sufficient to supply contact information for the organisation, as long as the contact person can be reached by email."

The domain name I have in mind would be perfect for my personal site but i'm wary of the no anonymous registration. Does anyone have any advice on what I can do to acquire a .ly domain name as safely as possible? Or should I completely avoid it? Thanks for your help.
Did your workplace do anything for Halloween?
Tags: halloween, discuss, workplace
Published: 2018-10-31 19:44:36

---
title: Did your workplace do anything for Halloween?
published: true
description: Spreading spooky tricks and treats during the day
tags: halloween, discuss, workplace
cover_image: https://images.unsplash.com/photo-1538507168208-a8c9d63cdcf8
---

My office doesn't officially do anything, but I know some teams did a potluck and some people put out candy jars for the day, while other people dressed up (subtly).

Some things I did for the spirit of the season:

* Decorated my cubicle with orang string lights
* Set out sour candies for anyone walking by
* Put together personalized treat bags for each person on my team with candy, bubbles, glow sticks, stickers, and googly eyes in them
* Made extra bags of good stuff to hand out to people walking by
* Wore branded stuff so if someone asked about a costume, I was in one, but it is just kinda casual cosplay for the workplace

Bubbles are fantastic because you can blow them at the curmudgeons who are determined to not have fun! :D

As it's my favorite time of year, did anyone else do anything? I'd love to hear stories! [AskAManager](https://www.askamanager.org/2018/10/nightmare-on-dilberts-street.html) has a post on workplace horror stories, but fun ones are great, too!
Twitter, Hashtags, and the Curious Dev
Tags: twitter, hashtags, discuss
Published: 2018-10-31 18:42:36

---
title: Twitter, Hashtags, and the Curious Dev
published: true
description: What's your opinion on the more generic hashtag usage on Twitter
tags: #Twitter #Hashtags #Discussion
---

Hi,

Regular lurker, first time poster.
Short version:

When you're looking for things on twitter related to programming, are you searching for hashtags or just words? Or do you look for people and look at who they interact with?

Backstory:

I'm a hobbyist dev who has spent most of his life in support type roles, learning programming as a means to an end (either to create tools to help my life or to work with the application I was supporting that had some sdk/api/language elements).

I managed to get a job doing social media for <redacted> for one of their general developer handles because I could speak developer, I could read code, I understood social media (as much as anyone can), and I wasn't a developer who would get paid bigger bucks.

The current mood on twitter is to move away from hashtags. Twitters search is far better these days and you don't need to search for #cocoa or #cpp anymore, you can just search for the terms, although, of course, you can subscribe to that hashtag, but, the thing is, I really don't believe people do that.

My breaking point with hashtags probably came when I saw a hashtag of #news (or maybe it was #apps). Because who is going to subscribe to that hashtag and dig through all the obvious detritus just to get the nuggets they want.

I've galaxy brain meme'd myself to the realization that the only really good hashtags are event related (even pseudo-events like movie releases) or joke hashtags. I can make allowances for product names that are really specific (ie, Excel but not Word. GoogleDocs but not Spreadsheets) but as it gets more generic (iOS, Android) it begins to feel pointless. And I do realize that this becomes a case-by-case basis thing, but that's okay. There shouldn't be a global rule on this. I wouldn't expect Microsoft to think that it'd be smart to hashtag Windows (the curse of a generic word name) but I know they like to hashtag languages.

The problem is proving that to the powers that be. Because there's always traffic that pulls in hashtags, making it seem inflated. No real twitter monitoring shows 'This person found your tweet by way of the #HASHTAG and then clicked through your link AND spent 10 minutes on your page, clicking through to a couple other articles' (yes, I recognize some of that is trackable, but, by and large it's piecing it together and you need to be using the right services that let you do it, which if you don't own the purse strings, is a challenge.

So, since this is probably the most welcoming community for developers, I wanted to ask my question here.
Do you have a space to "geek out"?
Tags: askdev, nerdherd, discuss
Published: 2018-10-31 18:36:37

---
title: Do you have a space to "geek out"?
published: true
description: Where the inner geek comes out?
tags: askdev,nerdherd,discuss
---

As I sit back in my office chair, I wonder if anyone else has a dedicated space that they can just "geek out" in? A space full of technology, whatever it may be - low tech / high tech - something they hold proud in the world of technology?

For me, it's a room with 7ft long desk, with my computer and external monitors, printer, and a punch of posters/stickers, and RGB lighting where I can go and "geek out" when I want /or/ need to.

What's your geek out space?
Been a while
Tags: wordpress
Published: 2018-10-31 17:39:24

---
title: Been a while
published: true
description: Back at it. 
tags: #wordpress
---
Been gone for a minute. Been working on 2D and 3D art. On the WordPress kick right now. Didn’t realize how much I would like the structure. So much of it makes sense. Seems like a lot of the heavy lifting is taken care of on the backend. So I’ll be trying to level up WP skills for the next little while. Hit me up if ya have tips, tricks, or whatever. I’ll be around.
[Video] The State of HTTP Headers with Andrew Betts
Tags: webdev, learning, security, webperf
Published: 2018-10-31 17:07:24

---
title: [Video] The State of HTTP Headers with Andrew Betts
published: true
description: In this video I chat with Andrew Betts about the state of HTTP headers and how developers can use them to enhance web performance and security.
tags: webdev, learning, security, webperf
---

In this video I chat with Andrew Betts (TPM and Developer Advocate at Fastly) about the state of HTTP headers, their adoption, and how developers can use them to enhance web performance and security.
{% youtube riPSW5P127M %}
Trying to Understand Open Source
Tags: help, beginners, github
Published: 2018-10-31 16:16:30

---
title: Trying to Understand Open Source
published: true
description: 
tags: #help, #beginner, #github
---

Hey all! So I'm trying to understand some things about GitHub. I've gotten good at using terminal to commit and push / pull to my own repositories and whatnot.

What I'm not grasping is how people contribute to other people's repositories. If you can only see the code, how can you make sense of exactly what to contribute? I understand how to fork and make a pull request and everything, I just don't know what to contribute or how people know what to contribute. Help? :)
Thanks, Hacktoberfest!
Tags: hacktoberfest, opensource
Published: 2018-10-31 16:08:25

---
title: Thanks, Hacktoberfest!
published: true
description: 
tags: 
  - 'hacktoberfest'
  - 'opensource'
---

This year was the first time I heard about Hacktoberfest, and it has been just an amazing experience. 

As the creator and maintainer of [Orchid](https://orchid.netlify.com/), I was completely amazed and humbled to get its first PRs from other contributors this month, and it also hit 100 stars on Github! So I just wanted to say thanks and brag on these folks a bit:

- I have been in a process of migrating all of Orchid's code from Java to Kotlin, and [Andrey Mochalov](https://github.com/epidemia) helped greatly with that effort, converting several dozen files. 
- [Yaroslav Matveychuk](https://github.com/yaroslavm) added a new publication mechanism, which creates a Github Release at the same time as the site is published. This has been really nice, as Orchid's own release notes are now being updated with every new version.
- [Bastien Jansen](https://github.com/bjansen) created a Maven plugin, so that Orchid sites can be easily integrated into Maven projects and continuously deployed right along with the project. Previously, only Gradle was supported.

But I also contributed back to the open-source community as a contributor as well, and here are my final stats:

![My Hacktoberfest stats](https://thepracticaldev.s3.amazonaws.com/i/1peugyg2y8vjjfilkhyo.png)

I have been working to get both [https://strikt.io/](https://strikt.io/) and [http://pebbletemplates.github.io/pebble/](http://pebbletemplates.github.io/pebble/) building and deploying their documentation sites with Orchid. These are both really great projects, I've been using them for quite a while, and you should definitely go check them out!

What projects did you help out with this Hacktoberfest?
How to Point New Devs to Older Posts?
Tags: discuss
Published: 2018-10-31 15:56:04

---
title: How to Point New Devs to Older Posts?
published: true
description: 
tags: discuss, discuss
---
From what I can see, there is a huge waft of new Devs joining us every day.

I'd love to be able to point them (or some of them) to existing posts.  I have a few posts describing gems I've put up over at RubyGems.org, which some may find useful.

I don't want to re-post, and I'm reluctant even to post a new link, because **spam**.  (Note that I am not linking here.)

Any suggestions about getting through to the new people?  Or do we just hope they find things on their own?
What tips do you have for homebrew users?
Tags: discuss
Published: 2018-10-31 15:04:44

---
title: What tips do you have for homebrew users?
published: true
description: I recovered 110 GB of disk space with one command, and now I'm wondering what else I'm missing from homebrew.
tags: discuss
---

This morning, I recovered 110 GB of disk space thanks to one command.

I'm a heavy homebrew user. I install packages all the time. On top of that, I brew update and brew upgrade quite often. I like to stay up to date.

Over the years, I continued to install packages, update, and upgrade them. All the while I was ignoring one important command.

## My Story

This morning, I was greeted with this alert. Hmmmm... I thought. What could this be?

![The Low Disk Space Alert](https://thepracticaldev.s3.amazonaws.com/i/635r8fzvxxni7yjqxmo0.png)

My documents folder had a few gigabytes of data, but that wasn't filling up my entire disk. That's when I started exploring homebrew packages. I realized I had been keeping many, many old homebrew packages around for no reason.

## The Command

That's when I ran the command `brew cleanup`. Oh boy, I was in for a surprise. My terminal started spitting out line after line of this:

![brew cleanup log](https://thepracticaldev.s3.amazonaws.com/i/y2s2rxw2a99pfhqc657g.png)

That's a lot of disk space!

After that completed (which took about 15 minutes), I suddenly had 120 GB of free space to work with. And that got me thinking, what else do I not know about homebrew? Do you have any tips for us homebrew users out there?
How to become git pro?
Tags: discuss, git, learn
Published: 2018-10-31 14:28:13

---
title: How to become git pro?
published: true
description: Learn git. But how?
cover_image: https://git-lfs.github.com/images/facebook-promo.png
tags: discuss, git, learn
---

How to learn git? I want to become a pro/master.

I know most of you say [start reading the docs](https://git-scm.com/). I want to try a different way.

Yeah, videos are good too. Anyone else got any idea.
Most Popular Development Posts Of The Week (31 October 2018)
Tags: react, productivity, webdev
Published: 2018-11-01 08:02:48

---
title: Most Popular Development Posts Of The Week (31 October 2018)
published: true
tags: react,productivity,webdev
canonical_url: https://medium.com/daily-now/most-popular-development-posts-of-the-week-31-october-2018-e4dfc104228
cover_image: https://cdn-images-1.medium.com/max/1024/1*rRpTqDvZNsrsJeHtkkA4rw.jpeg
---

<figcaption>When you find an idea that you just can’t stop thinking about, that’s probably a good one to pursue</figcaption>

- [A fantastic vscode theme for humans](https://app.dailynow.co/r/2ec1231cb923060f76cf3117ee140e64)
- [Top 12 Things That Destroy Developer Productivity](https://app.dailynow.co/r/e815f7b5906e894b416b332301c112b1) by [John Lafleur](https://medium.com/u/a7d714669aa6)
- [These tools will help you write clean code](https://app.dailynow.co/r/99fe01e4a833e8e606561a95b4f2cd14) by [Adeel Ibrahim](https://medium.com/u/632c75672ed5)
- [Top 5 JavaScript Editors for Web Developers](https://app.dailynow.co/r/5b32ec58b14ca24fd78bf74cb7dc1877)
- [Writing an Amazing Code Review Checklist](https://app.dailynow.co/r/44b6523d55804402029c74de26546b07) by [James Gallagher](https://medium.com/u/ffe0d5deb49)
- [An Introduction to Deep Learning](https://app.dailynow.co/r/c33d5cc6d95ab556daa7a6911f3c3b90) by [James Liang](https://medium.com/u/23b962bce579)
- [32 Lines of Code](https://app.dailynow.co/r/388056f1a0cb5acb63cf92e37186500e)
- [Google CodeIn 2018 is here!](https://app.dailynow.co/r/9fdc2ef52c5bde831c093dde88527e54)
- [How to code like a Hacker in the terminal](https://app.dailynow.co/r/72d6542baeacfee8e1618aa316e4fa8d) by [Caleb Taylor](https://medium.com/u/8f2668739633)
- [Intro to Hooks](https://app.dailynow.co/r/f36726adcc890f3594b1d5b3363d8273)

* * *

[_Thanks to Daily_](https://www.dailynow.co/) _developers can focus on code instead of searching for news. Get immediate access to all these posts and much more just by opening a new tab._

![](https://cdn-images-1.medium.com/max/1024/1*m8Uf-6F4Q5AOp_wW6tbKSQ.jpeg)
In the market for a new laptop! Ideas?
Tags: workstations, discuss
Published: 2018-10-31 13:52:42

---
title: In the market for a new laptop! Ideas?
published: true
description: What's the best one for a full-stack developer?
tags: workstations, discuss
---
## Mo' Computers Mo' Problems 💻

I'm looking to scale back how many devices I use. Currently I have a 2015 Macbook Air, which has slowed down considerably, and doesn't have enough RAM to keep up with running local servers, Sketch/Figma, VSCode, Chrome and Firefox open at once. 

My solution to that has been running Linux on an old laptop which is basically a brick with no battery life (so a desktop replacement). It's been annoying to split my time between the two, since it feels like a waste of two machines that could be used by everyday users.

To that effect, I'd like to give away or sell my current computers and replace it with a new one that fits the right criteria.

I'm a React developer who's messing with backend stuff in Python, plus I do some light design work.

Here's what I'm looking for in my next workstation:

- Runs OSX or Linux (which basically means any computer works)
- HD Screen (Retina or 1080p)
- Good quality touchpad for design work
- 16gb of RAM
- Decent battery life
- 256GB SSD or better
- i7 processor
- Portable

Some options I was looking at:
- Dell XPS 15
- Macbook Pro 15
- The new Macbook Air
- LG Gram

### What's your workstation like? ❓
If you've tried any of the above, what do you like/dislike about them?  

Let's chat in the comments below! 👇