teleren/devto huggingface dataset:
Why is there no need for Multicase matching in Elm
Tags: webdev, elm
Published: 2018-02-10 22:38:36

---
title: "Why is there no need for Multicase matching in Elm"
published: true
tags: web-development,elm
canonical_url: 
---

As a beginner developer with Elm, I quickly ended up both loving the union types and the \_ operator but founded a tad bit irritating the absence of Multicase matching until&nbsp;… Until I saw the&nbsp;[light](http://stackoverflow.com/questions/41118171/handling-multiple-match-cases-with-single-statement-in-elm)!

### TL;DR?

Use the following pattern whenever you have some behaviour shared by several constructor of your union types and stay away from the \_ operator!

{% gist https://gist.github.com/leojpod/4deed6eb660ccf77dcd8285a71ed6641 %}

### The problem with single case&nbsp;matching

Let's say I want to create a task tracking software. I might end up with this Item type to describe my&nbsp;model:

{% gist https://gist.github.com/leojpod/5c1d674b68def2e66143729e4727c2d3 %}

As you can guess, a lot of operations are gonna require the same treatment for most kind of Item&nbsp;: assigning the item to somebody, changing the start or end date, adding/editing a description,&nbsp;… while there will be some that will differ. So how can we deal with&nbsp;that?

### Using the underscore matching

When I encountered this problem my first idea was to use the \_ to match all the kind of Item that didn't require a specific treatment for any given case&nbsp;... of&nbsp;. There are two main problems with that approach: we can't get the properties and it introduce potential **BUGS!** And by that I mean problems and unexpected behaviour that won't be caught up by the compiler. But first let's see how it&nbsp;looks:

{% gist https://gist.github.com/leojpod/c95e0f0127558b5bb53cced6db0218ce %}

Let's take back the Item example and let's pretend that we want to create a new kind of Item&nbsp;: milestone. Say milestones do not have start date but are just used as deadlines. Say my app is pretty developed and I am doing a lot of things on my Item and use the underscore matching a lot. By adding a new kind of Item in my union type I'd expect the compiler to throw a bunch of errors at my face directly which will not happen in that case: my new kind Milestone would already be matched by the \_ so there will not be anything wrong that will be caught by the compiler. Yet I probably don' t want my Milestone items to be dealt with like any other items… So I would have to resolve to looking up for any \_ and make sure that I adapt the code manually.

### The replacement

Use let&nbsp;… in! (or make another helper function)… It really is as simple as that… instead of making multicase matching, put the common treatment in a function within the let&nbsp;... in or put it outside if the treatment is consequent and use it afterwards:

{% gist https://gist.github.com/leojpod/05d60a80504ce19d6a60f351acb050c8 %}

And voilÃ ! It sounds pretty stupid but I hope it&nbsp;helps!

[Here](https://gitlab.com/leojpod/elm-task-stuff) is a small "project" showing this… nothing fancy, only one message and one&nbsp;button.
Hi, I'm Brian Schlining
Tags: introductions
Published: 2017-03-30 14:53:16

---
title: Hi, I'm Brian Schlining
published: true
description: My introduction post
cover_image: 
tags: introductions
---

I have been coding for 22 years.

You can find me on GitHub as [hohonuuli](https://github.com/hohonuuli)

I mostly program in these languages: Scala, Java, Python, Matlab, SQL, Groovy.
Hi, I'm Cool Cmsc
Tags: quietly
Published: 2017-03-30 13:40:06

---
title: Hi, I'm Cool Cmsc
published: true
description: Me
post cover_image: https://thepracticaldev.s3.amazonaws.com/i/84cyvsarsv15oh6p7ok6.jpeg
tags: Quietly
---

I have not been coding.

You can find me on Twitter as [@Coolcmsc](https://twitter.com/Coolcmsc)

I live in Cupertino.

I work.

I don't program.

I am currently learning about password managers.

Nice to meet you.
Hi, I'm Rob McCardle
Tags: introductions
Published: 2017-03-30 10:37:58

---
title: Hi, I'm Rob McCardle
published: true
description: My introduction post
cover_image: 
tags: introductions
---

I have been coding for 18 years.

You can find me on GitHub as [robmccardle](https://github.com/robmccardle)

I live in Buckinghamshire, UK.

I mostly don't program any more but am fond of lots of languages.

I am currently learning more about React.

Nice to meet you.
Hi, I'm Christian
Tags: introductions
Published: 2017-03-30 09:17:03

---
title: Hi, I'm Christian
published: true
description: My introduction post
cover_image: 
tags: introductions
---

I have been coding for about 10 years.

You can find me on GitHub as [donut87](https://github.com/donut87)

I live in Berlin.

I mostly program in these languages: Java.

I am currently learning more about Clean Code.

Nice to meet you.
Hi, I'm Jessica Lam
Tags: introductions
Published: 2017-03-30 03:51:01

---
title: Hi, I'm Jessica Lam
published: true
description: My introduction post
cover_image: 
tags: introductions
---

I have been coding for 12 years professional and 20 total.

You can find me on Twitter as [@kangaroo5383](https://twitter.com/kangaroo5383)

I live in San Francisco.

I work for LoungeBuddy

I mostly program in these languages: Swift, Nodejs, objc.

I am currently learning more about rPi, audrino, and EEG hardware!!!!!!

Nice to meet you.
Hi, I'm Matt Silverman
Tags: introductions
Published: 2017-03-29 23:13:54

---
title: Hi, I'm Matt Silverman
published: true
description: My introduction post
cover_image: 
tags: introductions
---

I have been coding for 2 years.

You can find me on GitHub as [TheWebEngineer](https://github.com/TheWebEngineer)

I am a web developer

I mostly program in these languages: HTML5 + CSS3 (obviously), javascript, React.js, and I am learning more every day!

I am currently learning more about Node.js.

Nice to meet you.
Manifesto for Technology Leadership
Tags: manifesto, agile, leadership, technology
Published: 2017-03-29 21:38:31

---
title: Manifesto for Technology Leadership
published: true
description: A manifesto for leaders in technology, a commitment from leadership to their people for an effective working environment.
cover_image: https://thepracticaldev.s3.amazonaws.com/i/9cealu1dbmcbvtjcp3f1.png
tags: manifesto, agile, leadership, technology
---

One of the things I care about a lot is leadership in technology - how can we as leaders, and how can our leaders, nurture an environment which gets the best out of our people.

It's easy to complain when we don't like something. It's much harder to explain what we want instead.

The [agile manifesto](http://agilemanifesto.org/) does an excellent job at setting out the principles we should aim for when building software - without dictating any particular style. Importantly, it sees everything as a compromise (‘_Individuals and interactions_ over _processes and tools_') and doesn't treat either as always right or always wrong.

> While there is value in the items on the right, we value the items on the left more

Although this has given rise to numerous methodologies, each with their own distinct interpretations, it ensures teams and organisations have the flexibility to approach agile in a way which suits their unique circumstances - and to adapt as those circumstances change.

#### I propose we do the same for technology leadership.

And so I shamelessly rip off the agile manifesto style to get us started. And selfishly use the things I care about most. But I think this should be a collaboration - not just from leaders, but also the people we lead - so we create a manifesto which _means_ something to us all.

And I think this is important. Even if we're already doing these things, others aren't.

### Manifesto for Technology Leadership - alpha!

**Support and direction** over solutions and constraints
**Responsibility and accountability** over processes and rules
**Encouragement and honesty** over criticism and discipline
**Goals and objectives** over to-do lists and priorities
**Appreciation and respect** over praise and reward

### And so...

Whatever your job role - be it developer, tech lead, UX designer, product owner, CTO or CEO - **I'd like your contributions, your feedback, and hopefully your willingness to sign it** to show your commitment to your teams.
My Top 3 Ruby on Rails Best Practices
Tags: ruby, rails, tips
Published: 2017-03-29 21:10:11

---
title: My Top 3 Ruby on Rails Best Practices
published: true
description: Advise on best practices for a Rails app
cover_image: 
tags: ruby, rails, tips
---

Here is what will give you the biggest bang for your effort.

1. Learn the **presenter** and **service object** patterns. This allows you to break down complex logic into small, self contained and easily tested classes. This makes writing/changing/reading code easy. Remember to namespace things and create clear separation between different objects. Learn more here: [7 Patterns to Refactor Fat ActiveRecord Models](http://blog.codeclimate.com/blog/2012/10/17/7-ways-to-decompose-fat-activerecord-models/)

2. Roughly follow Sandi Metz rules: [Sandi Metz' Rules For Developers](https://robots.thoughtbot.com/sandi-metz-rules-for-developers). No need to follow them exactly. But use them as a guideline. Small models/short methods. Methods should do 1 thing only. You can use something like Rubocop to force yourself/the whole team to follow these rules.

3. Don't be too clever. What I mean by this is: **Keep it simple and follow patterns**. Don't add complexity prematurely. You may think you need that fancy event handler/rabbitmq/etc Ruby gem - but it can probably wait. I like to follow the rule of “do I have 3 problems I can solve with this?” before I add in something non-standard (I think I stole this idea from Sandi Metz' book: [POODR](http://www.poodr.com/)).


I hope this helps!
Hi, I'm Markos Lerin
Tags: introductions
Published: 2017-03-29 18:54:54

---
title: Hi, I'm Markos Lerin
published: true
description: My introduction post
cover_image: 
tags: introductions
---

You can find me on GitHub as [MarkosAndres](https://github.com/MarkosAndres)

Nice to meet you.
JS Dialect Rant
Tags: javascript, babel, whatdidyousay
Published: 2017-03-29 18:49:08

---
title: JS Dialect Rant
published: true
description: I speak JS, you speak JS, but can we have a conversation?
cover_image: http://blog-assets.risingstack.com/2016/Jan/babel_logo_in_react_js_best_practices_2016-1453212218011.png
tags: js,javascript,babel,whatdidyousay
---

I spent a lot of time at my last job writing JavaScript. We had a set version of node, we had our dependencies more-or-less steady, and we put our heads down and coded. I left feeling like I knew JavaScript! Wheee!

Then I got started with [React](https://facebook.github.io/react/) at my next job. Cool sh*t, no doubt. But ES5 components led to ES6 class-based components. When I tried to consume that ES6 code I would get invalid keyword errors on things like `class` and `import`. Huh? _transpile_ it with [Babel](https://babeljs.io/)! Oh, okay...

Then I got into [mobx](https://mobx.js.org/) (<- totes dig it!), with all it's decorators and what not (oh Java, I do miss you a little). But when I tried to run that code, I'd get errors about `@` being totally uncool. Babel to the rescue!

`stage-0`, `stage-1`, `transform-decorators-legacy`, ...

_Woah_. WTF language am I writing in now? Some quick duckduckgoes imply that I'm using proposed JavaScript syntax that hasn't even been approved yet. When I look at the code running in the browser, it's all translated into, what I think is, ES5 (which is also es2015?). Okay, enough trivia, there's work to do! It's _transpiling_ successfully? Good, head down...

Anyhoo, I ðŸ’• the functional programming experience JavaScript continues to offer, and I love that the code is so portable in this browser/electron world. But seriously, you need a guru to fully understand:

1. the state of the JS language
2. the dialect you're writing in
3. the translations that babel is performing (and how to configure it)
4. interpreting the translation when debugging at runtime

Wowzers. I write JS, you may write JS, but I bet yours and mine look a helluvalot different. And I bet my code can't be pasted into your codebase without syntax errors. And to me, that's just kinda like ... _woah_.
About Maven version ranges
Tags: apache, maven
Published: 2017-03-29 18:13:18

---
title: About Maven version ranges
published: true
description: Understand how maven version ranges are working
cover_image: 
tags: apache, maven
---

Hey folks

this week I stumbled across problems with maven dependency version ranges.

So here we are - a short article about maven dependency version ranges and possible advantages/disadvantages based on my experience.

# What are version ranges?
Maven allows you to define a range of version numbers (In a specific format) to resolve automatically the latest version of a defined dependency by the next build execution.

# What version ranges am I able to specify?

| Range        | Meaning
| ------------- |:-------------:|
| 1.0      | x >= 1.0 * The default Maven meaning for 1.0 is everything (,) but with 1.0 recommended. Obviously this doesn't work for enforcing versions here, so it has been redefined as a minimum version. |
| (,1.0]      | x <= 1.0      |
| (,1.0)      | x < 1.0      |
| [1.0]      | x == 1.0      |
| [1.0,)      | x >= 1.0      |
| (1.0,)      | x > 1.0      |
| (1.0,2.0)      | 1.0 < x < 2.0      |
| [1.0,2.0]      | 1.0 <= x <= 2.0      |
| (,1.0],[1.2,)      | x <= 1.0 or x >= 1.2. Multiple sets are comma-separated      |
| (,1.1),(1.1,)      | x != 1.1      |

For example:

```
<dependency>
    <groupId>com.example</groupId>
    <artifactId>healthcheck</artifactId>
    <version>[0.0.5,0.3.0)</version>
</dependency>
```

# What's the current version?

You're able to get the actual version by running `mvn dependency:list |grep healthcheck` 

The result will provide the actual version number. It could look like this: `[INFO] com.example:healthcheck:jar:0.0.7:compile`

# Why should I use it?
It's magic. An update to newer dependencies within the defined ranges without hitting the keyboard. So less work to keep an eye for any updates and "magic" gain of possible new features/fixes of the dependency.

# Why not?
You never can't be sure that newer versions are compatible to your code and are unbroken. So it could be possible that you're build/compilation will magically be broke caused of newer dependencies.

# Conclusion
Well in my opinion the usage of version ranges is a matter of taste and also depends of the used technology. For example in the JavaScript ðŸŒŽ version ranges are more recommended and popular. 

For Maven especially I like to avoid version ranges to keep my dependency list clean and short to have a better overview about used versions, certain sub-dependencies and avoid possible site effect of magic updates. 

# Hints
You can resolve newer dependency versions by using `mvn versions:display-dependency-updates`

Replace version ranges automatically by run `mvn versions:resolve-ranges` or based on specific groupId's `mvn versions:resolve-ranges -Dincludes=com.example:*` (',' separation possible)

Be careful resolving SNAPSHOT dependencies by version ranges. They could be under construction and manipulate your expected behavior.

#### RELATED:
[Official apache maven docs](http://maven.apache.org/enforcer/enforcer-rules/versionRanges.html)
Hi, I'm Leandro Marcucci
Tags: introductions
Published: 2017-03-29 17:25:11

---
title: Hi, I'm Leandro Marcucci
published: true
description: My introduction post
cover_image: 
tags: introductions
---

I have been coding for 10 years.

You can find me on GitHub as [leanucci](https://github.com/leanucci)

I live in Buenos Aires.

I work as a freelancer

I mostly program in ruby

I am currently learning more about elm.

Nice to meet you.
Hi, I'm Gerasimos (Makis) Maropoulos
Tags: introductions
Published: 2017-03-21 12:56:17

---
title: Hi, I'm Gerasimos (Makis) Maropoulos
published: true
description: My introduction post
cover_image: 
tags: introductions
---

Study Informatics Engineering on Technological Educational Institute of Central Macedonia, Greece.

Self-taught developer with 11+ years of experience who loves programming languages, talking to people, coffee and cooking, not exactly in that order.

I have contributed to a various of open-source projects. Currently I'm an independent FOSS developer at Iris web framework, a new project I started the last year (top trending at github).

--- Iris

--- Build a better web, together

I posses great passion in technologies that help to improve better living. I have a deep interest in working in the field of technical evangelism.

Background starting from;

HTML, CSS, Javascript, PHP, nginx & apache, (My)SQL, C, C++, Actionscript (worked with Flash Builder), Java EE & Spring framework, C# WPF, ASP.NET, Typescript, NodeJS & ReactJS Full-stack developer, GoLang back-end developer.

I'm "top 7" writer at dev.to, medium.com and dzone.com, search for me as "@kataras" if you want to read my articles, good luck with that:)

Previously working as Lead Go Software Engineer at netdata, Inc. (my-netdata.io)

-- https://github.com/netdata

Previously worked as Lead Go Software Engineer at Landoop.

--- Landoop

--- Lenses for Apache Kafka CLI

--- Coyote
Hi, I'm tejasGit0904
Tags: introductions
Published: 2017-03-29 15:33:48

---
title: Hi, I'm tejasGit0904
published: true
description: My introduction post
cover_image: 
tags: introductions
---

I have been coding for [5] years.

You can find me on GitHub as [tejasGit0904](https://github.com/tejasGit0904)

I live in [montreal].

I mostly program in these languages: [angular js, Java spring].

I am currently learning more about [data mining as well as angular 2].

Nice to meet you.
Hi, I'm Mikhail
Tags: introductions
Published: 2017-03-29 12:41:07

---
title: Hi, I'm Mikhail
published: true
description: My introduction post
cover_image: 
tags: introductions
---

I have been coding for about one year.

You can find me on GitHub as [mixalezhnev] (https://github.com/mixalezhnev)

I live in Russia, Saratov.

I work for myself and want to help everyone on the Earth

I mostly program in these languages: JavaScript, CSS, HTML.

I am currently learning more about React, UI.

Nice to meet you.
Hi, I'm Chris Cane
Tags: introductions
Published: 2017-03-29 11:32:16

---
title: Hi, I'm Chris Cane
published: true
description: My introduction post
cover_image: 
tags: introductions
---

I have been coding for [a number of] years.

You can find me on Twitter as [@canec1](https://twitter.com/canec1)

I live in [a small town].

I work for [an academic institution].

I mostly program in these languages: [C#].

I am currently learning more about [Swift].

Nice to meet you.
Hi, I'm Søren Lund
Tags: introductions
Published: 2017-03-29 08:07:55

---
title: Hi, I'm Søren Lund
published: true
description: My introduction post
cover_image: https://thepracticaldev.s3.amazonaws.com/i/qj7babcynvhwhvy7t9px.jpg
tags: introductions
---

I have been coding for 35 years; the first 14 year only for fun, but for the past 21 years it's also been for profit ;-)

You can find me on Twitter as [@slu](https://twitter.com/slu)

I live in Denmark, where I work as a freelance developer/consultant.

I mostly program in these languages: Java, Perl, JavaScript, Bash and Emacs Lisp.

I am currently learning more about functional programming and Perl 6.

Nice to meet you.
Hi, I'm Dmitry Fink
Tags: introductions
Published: 2017-03-29 05:14:03

---
title: Hi, I'm Dmitry Fink
published: true
description: My introduction post
cover_image: 
tags: introductions
---

I have been coding for as long as I remember.

You can find me on GitHub as [finik](https://github.com/finik)

I live in San Jose.

I work for Bugsee

Nice to meet you.
First App with Spring Boot
Tags: springboot
Published: 2017-03-29 04:29:03

---
title: First App with Spring Boot
published: true
description: getting to "Hello World" with Spring Boot
cover_image: 
tags: Spring Boot
---

I recently started learning about Spring Boot. I've found it to be quite different then the two frameworks i've worked with so far: 

- Ruby on Rails
- Sinatra

It's far less expressive I've found. It also seems to be difficult finding any tutorials if you want to use just a text editor and command line. (I use Sublime)

First I learned a bit of Java. I found this guy on Youtube who is really thorough. He does start out really basic so what I did is skip some stuff here and there and play the videos from 1.5x to 2x speed :) 

[Learn Java Programming](https://www.youtube.com/watch?v=Hl-zzrqQoSE&index=1&list=PLFE2CE09D83EE3E28)

After I learned a bit about Java, the best Spring Boot tutorial found was on the Spring Boot website. 

- [Spring Boot "hello world" with HTML](https://spring.io/guides/gs/serving-web-content/)
- [Spring Boot "hello world" with just Java](https://spring.io/guides/gs/gradle/)


Whether you use Gradle or Maven, I found I could only compile and run the build if I set up a wrapper. A quick google search should show you the command line prompt for both options. I believe the "Spring Boot with just Java" link mentions this for Gradle specifically.
Hi, I'm Allen Wipf
Tags: introductions
Published: 2017-03-29 04:07:23

---
title: Hi, I'm Allen Wipf
published: true
description: My introduction post
cover_image: 
tags: introductions
---

I have been coding for a few months and am a studen at Omaha Code School.

You can find me on GitHub as [allenwipf](https://github.com/allenwipf)

I live in Omaha.

I mostly program in these languages: Ruby, Javascript, Java, HTML.

I am currently learning more about Ruby on Rails, Spring Boot.

Nice to meet you.
Toggle between special Fn keys and standard Fn keys [MAC]
Tags: alfredworkflow, mac, productivity, devtools
Published: 2017-03-29 04:05:21

---
title: Toggle between special Fn keys and standard Fn keys [MAC]
published: true
description: Do you toggle "Use all F1, F2, etc keys as standard function keys" frequnetly? Now you can do it from alfred 
cover_image: https://thepracticaldev.s3.amazonaws.com/i/oilxrpq4ylnlwllwcsgm.jpg
tags: alfred-workflow, mac, productivity, dev-tools
---

MacBook keyboards hidden(combined) the function keys under Mac hardware keys like brightness control and volume control, so if you want use function keys we should hold special `fn` key before pressing any of fn keys.

Being a developer I prefer to use fn keys without pressing `fn` however when I'm not developing I prefer standard hardware keys like screen brightness and volume.

Mac has a [setting](https://support.apple.com/en-us/HT204436) which allows us to change this behaviour but its tedious to toggle between these two regularly, so I have created a [Alfred script](http://www.packal.org/workflow/toggle-fn-keys-standard-keys) to ease this.

With this Alfred workflow you can toggle between both the keys right from wherever you are, give it a try.

Alfred Workflow - http://www.packal.org/workflow/toggle-fn-keys-standard-keys

**Tip :**

Assign alfred keyword which starts ! or # for easy access to all your frequently used scripts at one shot, refer screenshot


![My Alfred Screenshot](https://thepracticaldev.s3.amazonaws.com/i/wnhdbftuiu72or29uelk.png "My Alfred screenshot")
Hey! I'm Sishaar Rao!
Tags: introductions
Published: 2017-03-29 00:25:03

---
title: Hey! I'm Sishaar Rao!
published: true
description: My First Post
cover_image: https://i.ytimg.com/vi/zecueq-mo4M/maxresdefault.jpg
tags: introductions
---

I have been coding for 4 years.

You can find me on Twitter as [@Sishaar](https://twitter.com/Sishaar)

I live in Ashburn, Virginia.

I mostly program in these languages: Python, Java, Shell, HTML/Javascript.

I am currently learning more about Swift.

Reach out to me by email: sishaar@gmail.com