teleren/devto huggingface dataset:
What is Hoisting😰😰 in JavaScript
Tags: javascript, webdev, hoisting, beginners
Published: 2018-04-28 00:43:32

---
title: What is Hoisting😰😰 in JavaScript
published: true
description: hoisting in javascript confusion
tags: javascript,webdev,hoisting,beginners
cover_image: https://cdn.pixabay.com/photo/2017/02/17/05/29/chains-2073385_960_720.jpg
---

**Hoisting is not something functions and variables are moving to the top.
Actually, they are not moving technically anywhere.**

The thing happens at the time of function declaration the complete function
is sitting in the memory.

For variable declaration, JavaScript engine initializes with the value "undefined" at the time of creation.i used debugger to stop the running code at line 6.

For example 
![hoisting](https://thepracticaldev.s3.amazonaws.com/i/twbpr35szbfthd2si62h.gif)

Have you Observed one thing in above image JavaScript is already initialized with value 'undefined'?

Whenever JavaScript engine runs the line 6 then it updates the undefined to 'hoisting'.

For functions, the full function is added to the memory space.

That is the reason we can invoke the functions anywhere in the file but not variables.for variables, we only used once it is declared first.

## Have you checked hoisting for the let and var keywords?

for 'let' keyword if you try to access the variable before the declaration javascript engine hits the error.

![hoisting](https://thepracticaldev.s3.amazonaws.com/i/yf0z2gqviit8ouds4gz0.png)

for 'var' it doesn't show any error.
![hoisting](https://thepracticaldev.s3.amazonaws.com/i/4wjm6pvndlnh1o2q3399.png)


Hope you guys love these.


# Check out [My Book On JavaScript](https://dev.to/saigowthamr/learn-javascript-with-examples---book-35k7)
Avoid the dysfunctional trap
Tags: culture, devtips
Published: 2018-04-27 23:34:41

---
title: Avoid the dysfunctional trap
published: true
description: 
tags: #culture #devtips
---

I can't help it sharing this entertaining and very original article by Peter Norvig mixing healthy lifestyles and (bad?) programming habits.

https://medium.com/@peternorvig/functional-lifestyles-training-47984a3cd2ba
How do you use monorepo with #lerna to your FrontEnd and BackEnd?
Tags: lerna, node, javascript, help
Published: 2018-04-27 20:38:26

---
title: How do you use monorepo with #lerna to your FrontEnd and BackEnd?
published: true
description: I am doing a new architecture of the project it is React and NodeJs in the backend API. So I think Monorepo to the project is more convenient. And I would like to know how you are doing yours.
tags: #lerna #nodejs #javascript #help
---
How do I write this HTML line better
Tags: html, help
Published: 2018-04-27 18:54:00

---
title: How do I write this HTML line better
published: true
description: HTML Suggestions
tags: html, help
---

Just getting back into programming, know the basic's and a bit more but I tend to write bad code(I think anyways).

https://codepen.io/anon/pen/yjVqXQ

My question is, do I have to use span tags in this to make it work? I am trying to set it up so in css I'll be making ex nihilo sit on-top of SOFTWARE. It just looks weird to me. Would making two h1's and put it into a flex box better?
How Did Browser Cookies Get Their Name?
Published: 2018-04-27 17:12:00

---
title: How Did Browser Cookies Get Their Name?
published: true
description: discuss
tags: 
---

I just wrote a rather [long post](https://ua1.us/news/tech-history/how-did-browser-cookies-get-their-name/) about where I think browser cookies got their name, but what do you think?
How Did Browser Cookies Get Their Name?
Tags: fun, techhistory, cookies, webdev
Published: 2018-04-27 17:09:45

---
title: How Did Browser Cookies Get Their Name?
published: true
tags: Fun,Tech History, Cookies, webdev
canonical_url: https://ua1.us/news/tech-history/how-did-browser-cookies-get-their-name/
---

[![my cookies can't be dipped in milk t-shirt](https://ua1.us/wp-content/uploads/2018/03/mockup-972658b2-300x300.jpg)](https://ua1.us/tech/t-shirts/my-cookies-cant-be-dipped-in-milk-funny-tech-t-shirt/)<figcaption>My Cookies Can’t Be Dipped In Milk</figcaption>

One thing software developers do very well is name things. Typically, after an engineer gets done developing a piece of software or a concept, they look around for a name. Quite literally, they look around at objects that are sitting near them and adopt that as the name for their new widget. If you’ve been developing anything recently, you will see many funny names. For example, I had no clue this actually existed, but I searched for “bananajs” and guess what!? Github hosts a project called BananaJS. You get my point? We know that there are many funny names for libraries, but I’ve always been intrigued by that text file the browser uses to store data about your session, the Browser Cookie! How did browser cookies get their name?

## The Real Story Behind Browser Cookies

There are many myths around how browser cookies got their name. Many of which turned out to be proven as false. The one viable standing theory is that browser cookies were named after a pre-existing concept in computer science called “magic cookies.” Magic cookies were designed to carry information between two communicating applications.

Usually, the secondary application cared nothing about the magic cookie that was passed to it. Rather when the secondary application responded back to the primary, the magic cookie was passed back to provide the primary application with some context about the response it got back.

**Back To The “How Did Browser Cookies Get Their Name” question**

What we do know is that browser cookies most likely got their name from the concept of magic cookies. But what is unclear is the context about how magic cookies got their name.

## Magic Cookies Name Origin – My Best Guess

If I had to guess, from the research I’ve done, magic cookies (the computer science concept) got their name from a drug, LSD, popularized around the time of the computer science concept. LSD was frequently referred to as “magic cookies”

**Here’s why:**

The tie between the concept of the two different meanings behind “magic cookies” are that they were both popularized in the same time frame. Also, we do know from the explanation of Steve Job’s experience with LSD that there were many software engineers at the time partaking.

Or maybe it’s all just a coincidence. What are your thoughts?

The post [How Did Browser Cookies Get Their Name?](https://ua1.us/news/tech-history/how-did-browser-cookies-get-their-name/) appeared first on [UA1 Labs](https://ua1.us).
How I improve my programming skill
Tags: beginners, study
Published: 2018-04-26 19:48:47

---
title: How I improve my programming skill
published: true
description: 
tags: beginner,study
---

As a programmer, I always try to see how can I continue to learn and become better. Of course, I can continue to practice, by writing more code. That may get me to some certain point but then I feel isolated. Because the code I write is in my head, the thing I do tend to be use by myself. It's similar to you don't know how good you are until you see others do it.

In other field, people improve by constantly getting feedback. Example they re-watch how they do something and try to improve. They try to meet with people better than them and try to see what they can learn. You want to cook something and meet with other to exchange tip. You want to swim better and watch expert do it.

On the age of internet, information is everywhere. Hacker News, Dev.To, HackerNoon...it's a lot to consume. But one thing is they are talked at a higher level, about design decision, about infrastructure. You can listen to programming podcast, but then again, I feel like they are more about information and perspective than to really improve skill. 

One day, I stumble upon the idea of why not seeing how people review code. You got to see how best programmers review other code, how do they said, what are their concern.

I think you should started by looking at your dependencies, your Gemfile, package.json, composer.json, Gopkg.toml, mix.ex and spend 45-60mins per day see how people do code review. Or event looking at your framework, your language.

Example let take a look at this PR: https://github.com/rails/rails/pull/31989

The description is very informative. It explains what it's, the problem it solve, the drawback. By forcing myself to write about something in plain text, I have to think deeply rather than just bang out code and call it a day.

Then you see people review code. 

Or in this PR: https://github.com/fastlane/fastlane/pull/11329#discussion_r158537954 I learn about a better approach to handle and throw error very elegant.

That's how I improve myself? What about you?
What are The Major Implementation Challenges in Blockchain
Tags: blog, blockchain, blockchainappdevel, challenges
Published: 2018-05-02 10:55:41

---
title: What are The Major Implementation Challenges in Blockchain
published: true
tags: Blog,Blockchain,Blockchain App Devel,Challenges
canonical_url: 
---
![](https://www.itfirms.co/wp-content/uploads/2018/04/The-Major-Implementation-Challenges-in-Blockchain.jpg)
Blockchain is a revolutionary technology but there are many implement challenges. If you are planning to work on blockchain then first you should know all about the challenges. [https://www.itfirms.co/the-major-implementation-challenges-in-blockchain/](https://www.itfirms.co/the-major-implementation-challenges-in-blockchain/)
Difference between Heredoc and Nowdoc 🤔
Tags: php, stringparsing, strings
Published: 2018-04-27 12:31:16

---
title: Difference between Heredoc and Nowdoc 🤔
published: true
description: i always get confused between heredoc and nowdoc so this blog is for summarizing the difference between them.
tags: php, string_parsing, strings
---

### Heredoc
heredoc will evaluate your variables and place them exactly where you placed in the string.
Example:
```

$name = "Ahmed Khaled";

$here_doc = <<<EOT
My name is "$name" and 
i love programming

EOT;

echo $here_doc;
```
Output:
```
My name is "Ahmed Khaled" and 
i love programming
```

### Nowdoc
nowdoc will never evaluates your variables in the string 

Example:
```

$name = "Ahmed Khaled";

$here_doc = <<<'EOT'
My name is "$name" and 
i love programming

EOT;

echo $here_doc;
```
Output:
```
My name is "$name" and 
i love programming
```
What made you look at a project and submit a PR? Or Not?
Tags: discuss, opensource, github, web
Published: 2018-04-27 12:29:38

---
title: What made you look at a project and submit a PR? Or Not?
published: true
description: What makes you contribute or not contribute to an open source project?
tags: #discuss #opensource #github #web
---

I remember the first pull request I did on an open source project, and it was because I "knew" right away how to fix the issue. The code was well documented, the README was welcoming in a sense that there wasn't a mystery into what the project was doing and there were defined tests.

I was a newb to GitHub, never forked anything, didn't know even how to PR. Spent more time looking up how to do all of that.  What was merge, squash etc...

### First Timers Only

There is a great site called https://www.firsttimersonly.com/ if you are looking for a project that has simple issues to fix or never contributed before.

http://up-for-grabs.net - another great site that aggregates all types of projects from various languages that tag their issues with **help wanted**, **jump in**, and/or **up-for-grabs**.

Sometimes documentation is a great way to contribute to a project. [https://docs.microsoft.com/](https://docs.microsoft.com/?WT.mc_id=devto-twitter-shboyer) has a TON of their projects on there and all of the docs are open source and accepts pull requests. [ASP.NET](https://docs.microsoft.com/aspnet/core/?view=aspnetcore-2.1&WT.mc_id=devto-twitter-shboyer) and even [Azure](https://docs.microsoft.com/azure/?WT.mc_id=devto-twitter-shboyer) docs are there for updating.

### What keeps you from contributing?

* First timer?
* My code stinks?
* Where do I start?

Post a comment here or [@spboyer](https://twitter.com/spboyer)
What is the best way to search full name in MySQL (1m rows)?
Tags: sql, mysql, help
Published: 2018-04-27 12:24:32

---
title: What is the best way to search full name in MySQL (1m rows)?
published: true
description: 
tags: sql, mysql, help
---

Hi. I need some help. Currently I have elastic search but it is very annoying (needs lots of ram, shutdowns everytime), So I want to get rid of it and get back to mysql search.
I have table with 1m rows.
Searchable columns: name, name_original (ofthen blank). Both of them are 2-3 words each, varchar 255.

How would you organize search?
What is your understanding of software architecture?
Tags: architecture, discuss
Published: 2018-04-27 12:11:46

---
title: What is your understanding of software architecture?
published: true
description: 
tags: #softwarearchitecture, discuss
---

When you are faced with a new project, how do you plan it's design to eventually translate into code? Since there is no right way in programming, what is your way?
Friday Blast #36
Tags: fridayblast, links, post
Published: 2019-01-20 15:25:21

---
title: Friday Blast #36
published: true
tags: friday_blast,links,post
canonical_url: https://horia141.com/friday-blast-36.html
series: "Friday Blast"
---

Last week I wanted to better understand JS modules, so the bulk of the links are related to this topic. It’s a fast moving domain, so the articles cover a lot of ground.

[JavaScript Modules (2016)](http://jsmodules.io/) - a primer on the actual module system currently being implemented in browser side JavaScript. The way we’ll do things “soon”.

[Eloquent JavaScript - Modules (2016)](https://eloquentjavascript.net/10_modules.html) - an overview of some of the older “module formats” and of the new module system and its capabilities. Covers hand-rolled module systems, as well as CommonJS and the new module systems, building & bundling. It looks at larger issues of packages, module design etc.

[JavaScript modules (2018)](https://spring.io/understanding/javascript-modules) - covers AMD, CommonJS and ES6 modules.

[A 10 minute primer to JavaScript modules, module formats, module loaders and module bundlers (2017)](https://www.jvandemo.com/a-10-minute-primer-to-javascript-modules-module-formats-module-loaders-and-module-bundlers/) - covers custom modules (how you’d build them by hand), AMD, CommonJS and ES6 modules. But also things like loaders and bundlers, which are also a big part of the technology needed to use modules properly.

[JavaScript modules - a beginner’s guide (2016)](https://medium.freecodecamp.org/javascript-modules-a-beginner-s-guide-783f7d7a5fcc) - a larger article focusing on the rationale for using modules, a lot of custom module patterns, AMD, CommonJS, UMD, ES6 modules. Still waiting for part 2 which deals with bundlers.

[Can I please store images in the database now? (2018)](https://dzone.com/articles/can-i-please-store-images-in-the-database-now) - apparently the oft-repeated anti-pattern isn’t such a big issue anymore. Databases are perfectly capable of doing a good job with `BLOB`s. However, whether you want to store them there as part of a larger application is another question. Still, for internal apps, or ones where there is a very tight relationship between the data and image/video/PDF stored as a `BLOB`, it might make perfect sense.
Insightful Mental Model in Microservice Communication.
Tags: repost, microservice, microservices, communicationmodel
Published: 2018-04-27 08:03:38

---
title: Insightful Mental Model in Microservice Communication.
published: true
description: A simple reference post on communication models in Microservices.
tags: re-post, microservice, microservices, communication model
---

This is a short post really. I have always had a hard time with the mental model of where the communication paradigms of Request-Response and Event-Sourcing/CQRS model of communication should be used in a microservice. 

There are usual questions in my mental model like:

1. Is it all Events/CQRS model for all microservice and interactions with the each other and the frontends ?
2. How do you deal with situations that can't work asynchronously like Login or Registration, Which fit well to a Request-Response model but might require some work if we want to do so asynchronously in an Event based approach?
3. Whether this paradigms must be used singularly or combined ?
4. If combined how and what boundaries define how they work in the full scope of things?

But reading this post [Microservice Principles: Smart Endpoints and Dumb Pipes](https://medium.com/@nathankpeck/microservice-principles-smart-endpoints-and-dumb-pipes-5691d410700f) by Nathan Peck really helped.

Sometimes being used to developing monoliths can cause some mental block in how you model microservice implementation mentally, and though I have read at length, only a few posts like this, do help to further help clarify and simplify my thoughts.

I do hope you gain from the post as well.

Best Regards,
Alex.
Dos and don’ts when convincing colleagues to do functional programming.
Tags: functionalprogrammin, programming, javascript
Published: 2021-12-19 14:02:38

---
title: Dos and don’ts when convincing colleagues to do functional programming.
published: true
date: 2018-04-27 07:06:38 UTC
tags: functionalprogrammin,programming,javascript
canonical_url: 
cover_image: https://cdn-images-1.medium.com/max/1000/0*qA58qTocb9FimXMM
---

#### A shortlist to help you persuade your teammates to adopt functional programming (or any technology/practice/tool currently unknown to your team).


Like many others, I fell in love with functional [programming](https://hackernoon.com/tagged/programming), the problem was that I was the only one in my team.

I believed that functional programming could have a great impact on our code base that’s why I’ve tried to convince my fellow developers to make the change.

These are my dos and don’ts from that experience.

### Don’t sell it as the solution for everything

**First,**  **it’s not 😬.**

Yeah sure, functional programming is awesome and solves many issues but it’s not a silver bullet and has many other pitfalls. Telling everybody that it will solve all their problems will just create very high expectations that will crash on the first obstacle.

### Do present it as another approach to solving problems

Try to take a specific issue and show your team how it can be done in a functional way. In that way, the benefits will be clear and a lot easier to digest. Choose a complicated pipeline that, with the help of [Either monad](https://github.com/folktale/data.either#readme), will become clearer.

### Don’t write your next feature in a completely functional way

Okay, so the feature is written flawlessly **but** you are the only one that can understand that code 🤓. It’s way more important to have a unified code base than having your feature written in an [adequate way](https://drboolean.gitbooks.io/mostly-adequate-guide-old/content/). You will create **confusion** and make your team feel **overwhelmed** by the names and unfamiliar patterns.

```
const simple = fn1 => fn2 => fn3 => fn4 => fn1(fn2(fn3, fn4)); WTF?!?
```

### Do a workshop

A workshop is a wonderful way to teach new techs and paradigms. Start from the very basic and move to more advanced areas, take an existing feature, and refactor it together while indicating the best practices and the benefits.

### Don’t fight

Many people just love wasting time and fighting over stupid things like tabs vs. spaces, vim vs. emacs … **imperative vs. functional** 😤. Try as much as possible to avoid any battle because they will make people automatically reject the functional [ideas](https://hackernoon.com/tagged/ideas).

### Do be flexible

It’s ok if someone mixed some imperative code inside your beautiful functional module. Go to this developer and open a discussion about why he/she chose that way and show him the other approach and be open to accepting his way.

_Changes are a process, don’t give up and stop writing functional code in your job projects._

_Do you have any_ **_tips_** _from your experience? Please share them!_
Introducing »Relaxed« – A cross platform terminal theme
Tags: terminal, iterm, hyper, showdev
Published: 2018-04-26 19:22:32

---
title: Introducing »Relaxed« – A cross platform terminal theme
published: true
description: A theme to take a more relaxed view of things.
tags: Terminal, iTerm, Hyper, showdev
---

I've invested a lot of time in optimizing my development environment and workspace — and typefaces and color schemes are a large part of that. For me different color schemes (as well as typefaces) both set the mood for my development environment, as well as offer utility in the way that I parse text. 

I fine-tuned my iTerm theme for quite a while and recently released it as cross platform theme which is available for Hyper, iTerm, macOS Terminal, Konsole, PuTTY, Terminator, Termite, Xfce Terminal and Xresources 🕶️

Check <https://github.com/mischah/Relaxed> to get it.

**All colors:**
![Screenshot](https://thepracticaldev.s3.amazonaws.com/i/59slv71jdnn69zeds2te.png)

**In action:**
![Screenshot](https://thepracticaldev.s3.amazonaws.com/i/44fe9m81tvthwzcry1ot.png)


---

### Update:

Now also available as theme for Visual Studio Code:

* https://github.com/Relaxed-Theme/vscode-theme-relaxed
* https://marketplace.visualstudio.com/items?itemName=mischah.relaxed-theme

![Screenshot](https://thepracticaldev.s3.amazonaws.com/i/vfb6wj6ghao242op1zm9.png)

### Update:

Now also available as theme for Atom:

* https://github.com/Relaxed-Theme/atom-relaxed-syntax
* https://atom.io/packages/atom-relaxed-syntax

![Screenshot](https://thepracticaldev.s3.amazonaws.com/i/m55g7l9etmgrx0rpo05i.png)
What do you think of the new Go logo?
Tags: discuss, go
Published: 2018-04-26 21:20:12

---
title: What do you think of the new Go logo?
published: true
description: 
tags: discuss, go 
cover_image: https://thepracticaldev.s3.amazonaws.com/i/gwaut04lt6ie67vrfw8w.jpg
---

I got a hilarious message from my friend about Go's [new look & logo announcement](https://blog.golang.org/go-brand). It went something like this: 

Friend: LOOK AT THIS BULLSHIT 
Friend: WHERE DAT GOPHIE

Then I sent her the fine print:

>Rest easy, our beloved Gopher Mascot remains at the center of our brand.
[JS] Do you use 'with' in JavaScript?
Tags: discuss, javascript
Published: 2018-04-26 20:57:28

---
title: [JS] Do you use 'with' in JavaScript?
published: true
description: I rarely come across anyone using it.
tags: discuss, javascript
---

```js
let a = document.createElement('a')
with(a) {
  setAttribute ('href', 'http://google.com/')
}

console.log(a.getAttribute('href')) // http://google.com/

let object = {
  id: 14904, 
  value: 'Main Street Avenue'
}

with(object) {
  console.log(id, value) // 14904, Main Street Avenue
}

let fs = require ('fs')
with(fs) {
  readFile('log.txt')
}
```

I rarely if ever come across someone using _with_. Some sources consider it deprecated and advise against it but in my experience every JavaScript interpreter understands it and behaves like expected.

> Use of the with statement is not recommended, as it may be the source of confusing bugs and compatibility issues. See the "Ambiguity Contra" paragraph in the "Description" section below for details.
The with statement extends the scope chain for a statement.

Source: [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/with)

<blockquote>What about your experience, are you _with_ me?<blockquote>