teleren/devto huggingface dataset:
Passing Go (Not the Language)
Tags: programming, javascript, code
Published: 2019-02-21 22:32:54

---
title: Passing Go (Not the Language)
published: true
description: Learning Programming, For Real This Time
tags: programming, javascript, code
---

![Monopoly board with a view of the "Go" square](https://www.zerodayfinance.com/wp-content/uploads/2018/02/monopoly-go.jpg)

I've been programming on and off for the past several years, always picking up new ideas and skills along the way, but never really breaking through to the level of understanding required to complete any significant personal projects or use programming as a core function of my job.

A little SQL here, a bit of load testing in Groovy there... some JavaScript apps for fun on the side, but never a really proper deep dive into software engineering or a career in code. All that changes now. In my new role, I will be automating our test cases using [Cypress](https://www.cypress.io/) and I must say, I'm excited.

So many of my future plans will be made possible once I move from an amateur understanding to something more functional. Starting as late as I am, I will probably never be a *great* programmer, but that's not the goal here. The goal is to amplify my function as a tester on my team and to open the door to greater experimentation and learning down the road of life.

I'll be tracking my learning progress on this blog here, so if you're interested in observing someone learn how to program (for real), stay tuned.
var vs dynamic in Dart
Tags: dart, var, dynamic
Published: 2019-02-21 22:21:24

---
title: var vs dynamic in Dart
published: true
description: This post is about dart variable declaration using var and dynamic
tags: dart, var, dynamic
cover_image: https://thepracticaldev.s3.amazonaws.com/i/opmhwu9g97yhwbor9q5p.png
---

#### In Dart and JavaScript we have var keyword for the variable declaration but both are not same.

There is the dynamic keyword for variable declaration in Dart which is equivalent to JavaScript var keyword.

Dart var keyword is very much similar to javascript var keyword but not the exact same. Most of Dart developer uses Dart var as JS var which is not correct. Let's understand this by some examples. 

I will give 4 different examples.

# Example 1

In JavaScript and Dart, we can store any kind of data in a variable which has been defined using var keyword.

### Dart
```dart
// This is valid Example this will work
void main() {
     var x = 'Maths pi';
     var y = 3.14;

     print(x); // Maths pi
     print(y); // 3.14
}
```
### JavaScript
```js
// This is valid Example this will work
 var x = 'Maths pi';
 var y = 3.14;

 console.log(x); // Maths pi
 console.log(y); // 3.14
```
# Example 2

In JavaScript and Dart, we can store different kind of data in the same variable.

### Dart
```dart
// This is valid Example this will work
void main() {
    var x ;
    x = 'Math pi';
    print(x); // Maths pi

    x = 3.14;
    print(x); // 3.14
}
```
### JavaScript
```js
// This is valid Example this will work
 var x ;
 x = 'Math pi';
 console.log(x); // Maths pi

 x = 3.14;
 console.log(x); // 3.14
```
# Example 3
Now I am going to mix Example 1 and Example 2
Now I am going to initialize the variable and trying to store different data type in the same variable. This is going to give me some error because this is not valid in Dart but its valid in JavaScript.
###### This is the place where `var` behaves differently in Dart
### Dart
```dart
// This is invalid Example this will work
void main() {

     var x = 'Math pi';
     print(x);  // Maths pi


     x = 3.14;  // Compilation failed error because
                // you are trying to assign double to String variable.
     print(x);
}
```
### JavaScript
```js
// This is valid Example this will work
 var x ;
 x = 'Math pi';
 console.log(x); // Maths pi
 x = 3.14;
 console.log(x); // 3.14
```
# Example 4
If we had used dynamic instead of var in Dart code we haven't got error because dart dynamic is same as JavaScript var.
### Dart
```dart
// This is invalid Example this will not work
void main() {
     var x = 'Math pi';
     print(x); // Maths pi
     x = 3.14; 
     print(x); // expected 3.14
}
```
### JavaScript
```js
// This is valid Example this will work
 var x ;
 x = 'Math pi';
 console.log(x); // Maths pi
 x = 3.14;
 console.log(x); // 3.14
```

#This is my first post here. If you like it let me so that I can be motivated to post here
TFW You Realize What Technical Debt Actually Means
Tags: technicaldebt, softwaredevelopment
Published: 2019-02-21 21:57:12

---
title: TFW You Realize What Technical Debt Actually Means
published: true
description: How I realized what technical debt actually stands for.
tags: technical debt, software development
---

A few weeks ago I set out to write a blog post about technical debt and the
complexities of getting rid of it, or some of it, when you work for a company.

I wanted to see what others had written about it and of course I landed on
[Martin Fowler's article about technical debt](https://martinfowler.com/bliki/TechnicalDebt.html).
When I started reading it I realized that up to that point I didn't really know
what tech debt was.

It seams that while being confronted with the eternal vastness of software
engineering, this is what my brain does: when I hear a term for the first time
and I can deduce its approximate meaning from context, I store it as a known
term. Even though I don't know exactly what it is.

What I deduced it to be was: "Legacy code, that makes it hard to maintain your
code or to add features."

And every time I heard or used the term "technical debt" there was a tiny little
voice in the back of my head going: "Why is it "debt"!? I don't get it."

Anyways good ol' Martin cleaned up that part of my brain and made it crystal
clear for me:

> Technical Debt is a wonderful metaphor developed by Ward Cunningham to help us
> think about this problem. In this metaphor, doing things the quick and dirty
> way sets us up with a technical debt, which is similar to a financial debt.
>
> Like a financial debt, the technical debt incurs interest payments, which come
> in the form of the extra effort that we have to do in future development
> because of the quick and dirty design choice.
>
> We can choose to continue paying the interest, or we can pay down the
> principal by refactoring the quick and dirty design into the better design.
> Although it costs to pay down the principal, we gain by reduced interest
> payments in the future.

It's a _metaphor_! It is actually a term that was invented in order to explain
consequences of sloppy coding to people in suits!

Fowler goes on to write:

> The metaphor also explains why it may be sensible to do the quick and dirty
> approach. Just as a business incurs some debt to take advantage of a market
> opportunity developers may incur technical debt to hit an important deadline.
>
> The all too common problem is that development organizations let their debt
> get out of control and spend most of their future development effort paying
> crippling interest payments.

Thank. You. Technical debt can lead to **crippling interest payments**. These
can slow down your development teams so badly that you can't compete anymore.

The term "technical debt" carries all the information you need in order to make
the argument to company leadership why getting rid of it or keeping it at bay
may be a wise business decision.

Who knew?! 😂
Why Do "Gaps In Your Resume" Matter?
Tags: discuss
Published: 2019-02-21 20:32:18

---
title: Why Do "Gaps In Your Resume" Matter?
published: true
description: 
tags: #discuss
---

To me it seems a personal question which has no professional bearing.

So, why does it seem to be almost mandatory to ask such questions from the employer's point of view. 

How do you respond when you would rather not?
Building Product Is Similar to Packing a Backpack
Tags: insight, productdevelopment, mvp, scopecreep
Published: 2019-02-21 20:21:52

---
title: Building Product Is Similar to Packing a Backpack
published: true
description: A small insight on how packing your backpack has similarities to building a product
tags: insight,product development, mvp, scope creep
cover_image: https://thepracticaldev.s3.amazonaws.com/i/yrzpytt952kco2al7s6j.PNG
---
![](https://thepracticaldev.s3.amazonaws.com/i/yrzpytt952kco2al7s6j.PNG)

When you're building your product, think of it as if you're packing your backpack🎒.

You need for it to only carry along what is needed for the trip you're going to take.

And you need to take as little as possible because every ounce of extra will make you work harder over time 📈.

This applies one-on-one for building product, too: pack too many features or just that little functionality that you want to put in there quickly... And you'll probably end up carrying its weight - whether it is in the form of fixing bugs, handling support, longer deployment cycles, etc.

So when you're defining your MVP, or building that Proof of Concept, think wisely about what you're going to put in "your backpack" next time, as it might just be extra weight later 🏋️‍♂️.

Trust me, I've had my share of lessons regarding this 👨🏻‍🏫...

Pack light and necessities only for the occasion and the trip you want to take.

Like, Share or tag this with someone who needs to read this right now 🙌🏻

Code Hard, Ship Harder ✌🏻
I Ported Sudoku to Your URL Bar and It Plays like a Dream
Tags: sudoku, showdev, frontend, javascript
Published: 2019-02-21 19:22:12

---
title: I Ported Sudoku to Your URL Bar and It Plays like a Dream
published: true
description: This is the story of a weekend project that no one told me not to do.
tags: sudoku, showdev, front-end, javascript
cover_image: https://thepracticaldev.s3.amazonaws.com/i/1mp3bmv7dyrryev0m67a.gif
canonical_url: https://healeycodes.com/sudoku/front-end/javascript/2019/02/21/secret-sudoku.html
---

Zero refreshes required. This is Sudoku as you've never seen it. Away from the prying eyes of your co-workers and your boss. Powered by the dark arts of `window.location.hash`. So powerful that just loading the page will cause your browser's history to rue the day.

![Secret Sudoku](https://thepracticaldev.s3.amazonaws.com/i/1mp3bmv7dyrryev0m67a.gif)

Playable [right here](https://healeycodes.github.io/secret-sudoku/), Secret Suduko unlocked a series of unique experiences for me. It's not every day that you find yourself brute forcing a 19th-century newspaper puzzle. Or, better yet, getting Travis CI to do it for you.

```javascript
test('app plays without error', () => {
    const game = main(this, sudoku);
    game.startGame();
    for (let i = 0; i < 20000; i++) {
        // 0-81, 0-9
        if (game.play(Math.floor(Math.random() * 82), Math.floor(Math.random() * 10)) === true) {
            /* This test will usually complete the game six times over,
               adjust the difficulty randomly on completion */
            game.startGame(Math.floor(Math.random() * 6));
        };
    }
});
```

It turns out that all you need are some emotes, a few eventlisteners, and a dream. Many thanks to Rob McGuire-Dale and his wonderful Sudoku [generator/solver](https://github.com/robatron/sudoku.js).

```javascript
// Main render functions
this.squaresFilled = () => this.board.join('').match(/[^.]/g).length
this.completeness = () => `${this.squaresFilled()}/81`;
this.start = () => `Secret_Sudoku_~_${this.completeness()}_~_row:`;
this.render = (extra = '') => {
    window.location.hash = `${this.start()}${this.rowMap[this.row]}__${this.prettifyRow(this.currRow(), this.cursor)}${extra}`;
}
```

Secret Sudoku is the perfect project to work on to help me relax in the evenings. It makes programming feel far more fun than logic abstraction should. Taking pull-requests today and every day hereafter.

{% github https://github.com/healeycodes/secret-sudoku %}

<hr>

Join 150+ people signed up to my [newsletter](https://buttondown.email/healeycodes) on programming and personal growth!

I tweet about tech [@healeycodes](https://twitter.com/healeycodes).
Laravel Session configuration on Heroku
Tags: heroku, laravel
Published: 2019-02-21 19:24:08

---
title: Laravel Session configuration on Heroku
published: true
tags: heroku,laravel
canonical_url: https://medium.com/@DynoTower/laravel-session-configuration-on-heroku-d5635e0ce88e
---

#### Laravel on Heroku — Tip #6

Laravel by default will save sessions into a directory on disk, which isn’t ideal, because Heroku uses an ephemeral filesystem (explained in [Tip #5](https://dev.to/dynotower/logging-with-laravel-on-heroku-46db-temp-slug-8321570)).

You have to use another session driver. Laravel ships with several great drivers out of the box:

- Cookie
- Database
- Redis

In this example, we use Redis (personally we use always Redis, also for Cache and Queue).

1. You have to change the default session driver to Redis in _config/session.php_:

{% gist https://gist.github.com/sgasser/fdd34abed734b9dc12ed623068089b62 %}

or by setting the SESSION\_DRIVER environment variable:

```
heroku config:set SESSION\_DRIVER=redis
```

2. Don’t forget to add the [Redis Heroku Addon](https://elements.heroku.com/addons/heroku-redis):

```
heroku addons:create heroku-redis:hobby-dev
```

3. Use our [Tip #1](https://dev.to/dynotower/use-heroku-environment-variables-in-your-laravel-app-4f3i) to use Heroku environment variables in your Laravel app.

That’s it, now your session will not expire again after restart or deploy 🚀

### Want more tips like these?

You should follow me on [Twitter](https://twitter.com/AutoIdle)! And if you’re building on Heroku, you should check out [AutoIdle](https://autoidle.com) — the automated way to save money on your staging and review apps.
State Machine in a nutshell
Tags: ruby, statemachine, water
Published: 2019-02-21 18:15:13

---
title: State Machine in a nutshell
published: true
description: "Sometimes we need to apply a state in some cases when we want to modify a status of an object. A basic example is water state: gaseous, liquid and solid and the events responsible for change it"
tags: ruby, state machine, water 
---

Sometimes we need to apply a state in some cases when we want to modify a status of an object. A basic example is water state: gaseous, liquid and solid and the events responsible for change it:

```ruby
Object: Water
Event: Fusion
States: From solid to liquid
Event: Evaporation
States: From liquid to gaseous
Event: Condensation
States: From gaseous to liquid
Event: Solidification
States: From liquid to solid
```

Look at this as a simple example that happens around us. As in many other cases, we can apply it in programming using something called state machine.

![State Machine code screenshot](https://thepracticaldev.s3.amazonaws.com/i/s7enneflko6syr2zp99a.png)

In the above example, we have different states and events responsible for change these states. `Proposed`, `accepted`, `rejected` and `pending` are possible states for a object and the state of an object can change when an event occurs. Pretty similar to the example of water states, right?
Weeknotes #2
Published: 2019-02-23 22:51:34

---
title: Weeknotes #2
published: true
tags: 
canonical_url: 
---

## Monday

Fixed design bugs on timbly.com, more responsive, using tachyons.

Had to figure out how to tell if a slot is empty on a Vue component (TS class).


```ts
public get hasDefaultSlot() {
    return !!this.$slots.default;
}
```

It’s 2019 and CSS is awesome. But, we [still can’t](https://stackoverflow.com/questions/31974448/how-can-i-prevent-having-just-one-hanging-word-on-a-new-line-in-an-html-element) prevent orphan words when wrapping lines of text.

Have you tried [Sublime Merge](https://www.sublimemerge.com/)? I opened it again today – I like it, but I think I still prefer [fork](https://git-fork.com/).

## Tuesday

I’m using the AWS Amplify SDK, and it’s pretty decent. Fully featured authentication implementation. Their [docs are nice](https://aws-amplify.github.io/docs/js/), and they ship Vue and Reat UI components.

## Wednesday

[A super usefuly way to get basic SVG icons quickly](https://iconsvg.xyz/)

## Thursday

Doing a lot of Git rebase from multiple developers.

Trying to get [fontawesome-vue](https://github.com/FortAwesome/vue-fontawesome) to actually do treeshaking… with limited success.

## Friday

[An article about running puppeteer automatically](https://docs.browserless.io/blog/2018/06/04/puppeteer-best-practices.html)

[A good starting place for automated chrome screenshots](https://github.com/nezhar/chrome-shots)

Lot’s of time automating visual regressing tests.
Logging with Laravel on Heroku
Tags: laravel, heroku, logging
Published: 2019-02-21 19:24:05

---
title: Logging with Laravel on Heroku
published: true
tags: laravel,heroku,logging
canonical_url: https://medium.com/@DynoTower/logging-laravel-on-heroku-4b74c82ea4fd
---

#### Laravel on Heroku — Tip #5

![](https://cdn-images-1.medium.com/max/1024/0*v3fvMLA9GJAIDRZm)<figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=medium&amp;utm_medium=referral">Markus Spiske</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption>

Laravel by default will log errors and messages into a directory on disk, which isn’t ideal, because Heroku uses an [ephemeral filesystem](https://devcenter.heroku.com/articles/dynos#ephemeral-filesystem), that means that any changes to the filesystem whilst the dyno is running only last until that dyno is shut down or restarted. Each dyno boots with a clean copy of the filesystem from the most recent deploy. This is similar to how many container-based systems, such as Docker, operate.

Change the log destination on Heroku:

```
heroku config:set LOG\_CHANNEL=errorlog
```

Now you can tail the logs live:

```
heroku logs -t
```

That’s it. 🚀

### Want more tips like these?

You should follow me on [Twitter](https://twitter.com/AutoIdle)! And if you’re building on Heroku, you should check out [AutoIdle](https://autoidle.com) — the automated way to save money on your staging and review apps.
Nondeterminism in purely functional languages?
Tags: discuss, purity, functional
Published: 2019-02-21 17:19:05

---
title: Nondeterminism in purely functional languages?
published: true
description: 
tags: #discuss, #purity, #fp
---

This is something I have been wondering for a while. Is there a place for nondeterministic functions in a purely functional language?
I'm talking about nondeterminism as in [nondeterministic algorithms](https://en.wikipedia.org/wiki/Nondeterministic_algorithm), not [NTMs](https://en.wikipedia.org/wiki/Non-deterministic_Turing_machine) or [nondeterministic programming](https://en.wikipedia.org/wiki/Nondeterministic_programming). A function that may return different outputs for the same input.

Traditionally, one would achieve nondeterminism with a pseudorandom function, using a seed for an RNG. The seed needs to be incremented for every call to the function ergo you have a side-effect. 

But let's pretend our CPU has a quantum random number generator: it can quantum entangle and collapse 2 qbits to generate a true random number. To the best of my knowledge, this would be truly side effect free. Alternatively, we simply don't give a shit about the underlying implementation of the random function and pretend It Just Works™.

The use of nondeterministic functions obviously breaks referential transparency. Should we care? 
It does make memoization impossible for some functions, but if nondeterminism can be statically identified, this would not affect any functions that can theoretically be memoized anyway.

It shouldn't matter for lazy evaluation. Random 'choice' is random, regardless of order, a true random function wouldn't care when it is called.

It shouldn't affect the Curry-Howard correspondence, as it doesn't change the type system.

It shouldn't really affect the isomorphism with category theory, as while we may no longer have equality of values for many cases, we still have equivalence. Two random numbers are equivalent in that they are both random numbers.

However, I cannot help but feel I am missing something important here. I haven't been able to find any academic literature about the subject, but then again I suck at finding academic literature.
How Agile Teams Grow Toxic! Episode 1 | Founder Values
Tags: caree, agile, startup
Published: 2019-02-21 17:17:17

---
title: How Agile Teams Grow Toxic! Episode 1 | Founder Values
published: true
cover_image: https://thepracticaldev.s3.amazonaws.com/i/7hslucfeloeekpqkoncg.png
description: In this episode, I discuss how the core value or motivation that founders had when starting the software company impacts culture and career opportunities for programmers and other hires.
tags: #caree #agile #startup
---

One of the most frustrating things over my career has been working at companies where the workplace culture has become toxic.

Think of working with people who regularly tell each other what they want to hear, lie to cover their own mistakes, and put each other in a box of what they can and cannot do to help the software product succeed in its market.

This video kicks off a series called ***How Agile Teams Grow Toxic***.

## [📺 Watch this video on YouTube](https://www.youtube.com/watch?v=Bg-RepBrzOE&index=2&list=PL32pD389V8xtck2HrQfWn13bW0vWThiqK&t=0s)

I'll share the dark side of human behavior on projects, and why the situation can seem almost impossible to improve.

Though many companies hire agile coaches to try and improve the way they deliver, in my experience **it's leaders are the ones who most need "agile transformation"**.

In this episode, I discuss how the core value or motivation that founders had when starting the software company impacts culture and career opportunities for programmers and other hires.

Most software companies or projects are started for one of the following 3 reasons:

1. Money
1. Fame
1. Impact

It's preferable if you can find a company with founders (or leadership if the founder left) that are motivated by impact.

But this won't guarantee that the project will be successful!

You should also look at where the founders skills originated. Did they come from a business, or engineering background? This will give you some ideas as well about the founder values.

Ultimately, you want to find a software company or product where the leadership are looking to YOU for innovation and help. Not treating you like a pawn who can only crank out code and shouldn't think about the business or its products.

I discuss a simple way to research founders and other members of the management team at a company to get an idea of whether the culture there is healthy.

# [📺 Watch this video on YouTube](https://www.youtube.com/watch?v=Bg-RepBrzOE&index=2&list=PL32pD389V8xtck2HrQfWn13bW0vWThiqK&t=0s)

Or listen as a podcast:
[🎧 Soundcloud](https://soundcloud.com/jayme-edwards-media/how-agile-teams-grow-toxic-ep-1-founder-values)

<hr />[🔔 Subscribe for over 100 videos on healthy software development](https://YouTube.com/c/JaymeEdwardsmedia?sub_confirmation=1)
Fix for IISExpress Cannot read configuration file redirection.config issue on VMWARE.
Published: 2019-02-21 17:16:57

---
title: Fix for IISExpress Cannot read configuration file redirection.config issue on VMWARE.
published: true
description: How to fix the file access issue when running VMWARE on a Mac
tags: 
---

Issue: When trying to create a Visual Studio solution on VMWARE VM running on a Mac you get the following error: 

`IISExpress 8 Cannot read configuration file redirection.config`

[This thread](https://stackoverflow.com/questions/15897726/iisexpress-8-cannot-read-configuration-file-redirection-config) provides some insight into the issue. 

What's the problem?

When creating a new web solution, VS checks all the IIS config files. The process fails if it can't access it.

Solution:

Turns out that VMWARE will map your host's `Documents` directory to Window's `Documents` directory. This means that VS cannot access the files.

Steps:

1. Turn off sharing the `Documents` directory on the host.
2. Copy the Directory `C:\Program Files\IIS Express`.
3. Paste it into `%userprofile%\Documents`
4. Restart Visual Studio.