teleren/devto huggingface dataset:
Should programming languages be made for IDEs rather than humans?
Tags: discuss
Published: 2018-11-01 15:33:34

---
title: Should programming languages be made for IDEs rather than humans?
published: true
description: 
tags: #discuss
---

This is something I've been thinking about for a while. Why are we creating programming languages for humans, rather than for an IDE, allowing the later represent the program in human-readable format?

If you're doing math, text sucks.
```c = sqrt(pow(a, 2) + pow(b, 2))```
is just not as legible as 
![pythagoras](https://wikimedia.org/api/rest_v1/media/math/render/svg/5fd521cee81d583ce94bf6710984cc2a9eb7c3da)

It gets worse with non-primitives such as vectors in language that pass structs around by reference. If you want to avoid expensive memory allocations, you're stuck with:
```add(c, pow(temp1, a, 2), pow(temp2, b, 2))```

These are just the simplest formulas. Shader code I wrote back when I did graphics engine development was a nightmare to debug because it was so obtusely represented.

Then there's variable naming. Taking an example from math again: `P(A|B)` has a precise and well-understood meaning, plus it's concise and easy to recognizable. Unfortunately the majority of programming languages don't allow us to name a variable `P(A|B)`. Similarly, camelCase vs snake_case is a debate centered entirely on the inability of using spaces in variable names.

Another problem, [posted a while ago](https://dev.to/gregorys100/which-is-the-best-ide-for-a-smartphone-58cg): how can we code on a smartphone? Virtual keyboards are not great for code, and graph-based solutions might work, but I'm pretty sure not many people like drawing graphs on their desktop.

Tabs vs spaces is another debate based entirely on the assumption that code is text. Meanwhile, either approach is a severely outdated alignment tool.

In each of these cases, the key problem is that there is a tight coupling between formatting and semantics. I.e. we display the code as plain text, and that's what it *is*. 

Ligatures and custom operators offer some help but are ultimately tacked-on solutions that fail to address the core problem.

So what if we changed our files from being plain text to something richer and more structured? By removing the coupling of formatting and semantics this way, we can also use wildly different formatting (e.g. a graph editor) on different systems, but modify the same underlying semantics.

What do you think?
How to convince your company to adopt Clojure
Tags: clojure, humor, fun
Published: 2018-11-01 15:23:52

---
title: How to convince your company to adopt Clojure
tags: Clojure,Humor,Fun
description: The definitive video that will convert anybody to Clojure
canonical_url: https://danlebrero.com/2018/10/16/how-to-convince-your-company-to-use-clojure/
cover_image: https://danlebrero.com/images/blog/preaching-clojure.jpg
published: true
---

You have found Clojure and fall in love with it. 

As any good Clojurian, you eagerly to try convert your colleagues, by showing them the power of immutability, the REPL, macros, core.async, protocols, multi-methods, ...

But they seem to be blind.

You have also tried to appeal to their aesthetic sense, the beauty of simplicity or just their good heart.

But none of that works. 

Desperate, you have invoked Rich Hickey's name three times, and shout "Complected! Complected! Complected!" every time your teammate creates a new class.

But still no luck.

But don't give up, here is the definitive video that will convert any sceptic to Clojure:

{% youtube MSFvEK8asY8 %}

The video should be watched in repeat mode for 48 uninterrupted hours.

Apologies and happy Clojuring!
How do you organize your CSS?
Tags: css, discuss
Published: 2018-11-01 15:11:37

---
title: "How do you organize your CSS?"
published: true
description: "My CSS is a mess. I always start off with good intentions but once things ramp up my system falls apart."
tags: ["css","discuss"]
---

My CSS is a mess. I always start off with good intentions but once things ramp up my system falls apart.

I've primarily tried using [BEM](http://getbem.com/introduction/) in the past but have had difficulty sticking to this formula. It's too rigid. I'm looking for something simpler. Something that sets me up to create reusable widgets but also incorporates custom styling in a way that is easy to read and find what I'm looking for. I want equal parts structure and flexibility. But I know that's a tall and basically impossible order. 

Do you have a CSS system you love? How do you keep your styling organized in a way that you can look at your html and know exactly where to go to make changes? 

*edit: I write my CSS in SCSS. I'm looking for help in organizing the SCSS files and classes.
Three hacks and commands to use in your terminal.
Tags: terminal, commandline, hacks
Published: 2018-11-01 14:44:24

---
title: Three hacks and commands to use in your terminal.
published: true
description: Just some tips on the use of the terminal.
tags: terminal, command line, hacks
---

### The first one is:

du -sh */ | sort -rh | head -6

This command will show 6 heaviest folders.

du - disk usage

| - pipe. Which works like pipes in [Elixir](https://elixirschool.com/en/lessons/basics/pipe-operator/) and [Elm](https://elmprogramming.com/function.html#forward-function-application).

Basically, the output of the first function becomes an input for the next function and so on.

head - shows only a certain amount of output.

### The second one:

Turn this >

![A terminal with a long line before the dollar sign](https://thepracticaldev.s3.amazonaws.com/i/37kqeccxn8y1q36ku4p1.png)

into this >

![a terminal with just a dollar sign](https://thepracticaldev.s3.amazonaws.com/i/98gyh8ofeek36n4wke7h.png)

Just add this to your ~/.bashrc:

PS1='\$ '

After that you need to restart your bash:

source ~/.bashrc

Also, there are different ways to [restart your bash](https://stackoverflow.com/questions/2518127/how-do-i-reload-bashrc-without-logging-out-and-back-in).

There are more ways you can set this up check out this [overflow](https://askubuntu.com/questions/145618/how-can-i-shorten-my-command-line-bash-prompt) to find out more.

### The third one:

Creating folders with a pattern. Recently I had to create 8 folders for my codewars challenges:

mkdir kyu_{1..8}

I unfortunately don't remember where I find out about this command.

Oh, I just found it. It's [here](http://pietropassarelli.com/bash_script.html).
How to stash a specific file or multiple files?
Tags: git, help
Published: 2018-11-01 14:42:20

---
title: How to stash a specific file or multiple files?
published: true
description: Stashing a file
tags: git, help
cover_image: https://thepracticaldev.s3.amazonaws.com/i/1uyat349w7xe2owimu9z.jpg
---

How to stash a specific file or multiple files?
How to implement group feature in MERN app?
Tags: mongodb, react
Published: 2018-10-25 12:47:22

---
title: How to implement group feature in MERN app?
published: true
description: Is it to be configured in database, on the server or front-end?
tags: mongodb, react
---

I am an aspiring programmer and I set out to build a fullstack Team Reporting app to figure out how everything works together.

I have figured out how to set up the API with, play around with state with Redux to show data posted to my MongoDB through my React frontend. 
{% twitter 1054040585198276609 %}

However, now I need to figure out how to implement a group/team feature. I need a user to be able to create a team, invite other users to that team & then only show the tasks logged under the associated team.

For example like this: 
![week done structure](https://raw.githubusercontent.com/jepras/datamanager/master/src/img/weekdonestructure.png)


I am unaware on where to start. *Is this something I should configure in the database security settings? In the model that I use for the database? The way I fetch data? Something with the cookies?*

When I search on Google I do not find anything that helps me, hence why I am asking here. 

**Where to start? Can you point me in the right direction?**

Thanks and lots of love if you can help me :)
Apache Storm - Slow Topology Upload
Tags: bigdata, apache, storm, topology
Published: 2018-11-02 02:17:23

---
title: Apache Storm - Slow Topology Upload
published: true
tags: bigdata,apache,storm,topology
canonical_url: https://risdenk.github.io/2018/11/01/apache-storm-slow-topology-upload.html
---

 **Note:** This is an old post from notes. This may not be applicable anymore but sharing in case it helps someone.

### Overview

[Apache Storm](https://storm.apache.org/) after HDP 2.2 seems to have a hard time with large topology jars and takes a while to upload them. There have been a [few](https://mail-archives.apache.org/mod_mbox/storm-user/201603.mbox/%3CCAPC1M2i3OpKhC3n_+oTJke45Efuxq2PxMVurx71oEU-=Nqd9gQ@mail.gmail.com%3E) [reports](https://community.hortonworks.com/questions/24517/topology%C2%ADcode%C2%ADdistribution%C2%ADtakes%C2%ADtoo%C2%ADmuch%C2%ADtime.html) of Storm topology jars uploading slowly. I ran into this a few years ago. The fix is to increase the `nimbus.thrift.max_buffer_size` setting.

### Fix

Increase `nimbus.thrift.max_buffer_size` from the default of 1048576 to 20485760.

### References

- [https://mail-archives.apache.org/mod\_mbox/storm-user/201403.mbox/%3CFC98EE12-4AED-4D06-9917-C449B96EB08A@gmail.com%3E](https://mail-archives.apache.org/mod_mbox/storm-user/201403.mbox/%3CFC98EE12-4AED-4D06-9917-C449B96EB08A@gmail.com%3E)
- [http://stackoverflow.com/questions/27092653/storm-supervisor-connectivity-error-downloading-the-jar-from-nimbus](http://stackoverflow.com/questions/27092653/storm-supervisor-connectivity-error-downloading-the-jar-from-nimbus)
- [https://qnalist.com/questions/4768442/nimbus-fails-after-uploading-topology-reading-too-large-of-frame-size](https://qnalist.com/questions/4768442/nimbus-fails-after-uploading-topology-reading-too-large-of-frame-size)
Some pitfalls on Google Cloud Engine with NodeJS
Tags: npm, typescript, node, gce
Published: 2018-11-01 13:58:53

---
title: Some pitfalls on Google Cloud Engine with NodeJS
published: true
description: Some tips about deploying a NodeJS application on GCE Standard
tags: #npm #typescript #nodejs #gce
---
I have been playing around making some Typescript/NodeJS based API as a side project and this weekend I decided to deploy it on Google Cloud Engine Standard for NodeJS thinking it would be fast and easy. How wrong I was.

The main interests in using GCE Standard are that it is entirely managed so no maintenance to do and it also scales from 0 so no traffic, nothing to pay. The bad side of is that you have poor control on the machine running the application, commands like ls, cd or even npm are not even available.
When deploying the application, Google calls npm install for you in production mode (so not installing devDependencies) to get the correct dependencies for the architecture you will be running on. This is where things turned bad for me.

My application is quite standard, written in Typescript but with a dependency hosted on a private repository on Gitlab. Having used git+ssh to develop locally, I tried to deploy this way. It does not work. There is no way to provide the credentials needed by npm to access the code with ssh, even the environment variable GIT_SSH_COMMAND does not work (seems to be ignored). Heck, even npm install does not exist, the logs are talking about npm_install! I have been trying to look for another solution for 3 days and nothing worked, with git+ssh.

I then tried to go the git+https road with tokens embedded in the URL, well that was the road to go, not fan of adding credentials for read only access in package.json but could not find a better way.

Ok, now, deployment is successful! Calling a random method from my API, something is wrong... I am missing the dependency I managed to install after many days of trial and error. Great! The thing is that my dependency is written in Typescript too, I transpile it with tsc in the npm script preinstall which seems to be ignored. Bummed, I went the dirty way by commiting the dist folder and now it works.

To make things cleaner, I am thinking of making a tarball with the transpiled code using GitlabCI and make it available as a build artefact. Still trying to find another way.

The road was long and I could not find documentation about it (only things about having a private repository on npm so paying 7$/month/user for this feature). In the end, I still managed to do what I wanted and deploy my application on Google Cloud Engine Standard for NodeJS. Hope these notes will help someone.
Drupal is a pretty big deal 🎙
Tags: php, podcast, opensource, drupal
Published: 2018-11-01 13:51:13

---
title: Drupal is a pretty big deal 🎙
cover_image: https://thepracticaldev.s3.amazonaws.com/i/xkpc942or75sex0ybfr1.png
published: true
description: Angie Byron, a core contributor and staple of the Drupal community, joins The Changelog to tell us all about the massively popular "framlication".
tags: php, podcast, opensource, drupal
---

Did you know [Drupal](https://www.drupal.org) has racked up over **40,000 contributors** since it was first created in 2001?! Neither did we, until the _super awesome_ [Angie Byron](https://twitter.com/webchick) joined us on [The Changelog](https://changelog.com/podcast) last week to tell us all about it.

We also learned just how _awesome_ the Drupal community is (much like Dev.to!) and how they work to keep that the case. You don't want to miss this episode:

{% podcast https://dev.to/changelog/321-drupal-is-a-pretty-big-deal %}

Find the full show notes and transcript on [changelog.com](https://changelog.com/podcast/321).
Getting started with code mindfulness exercises
Tags: discuss, help, mindfulness, codemindfulness
Published: 2018-11-01 13:49:15

---
title: Getting started with code mindfulness exercises
published: true
description: I think I understand what a code kata is, but where do I get started?
tags: discuss, help, mindfulness, codemindfulness
---

EDIT: due to some really interesting comments below, I've decided to replace references to `katas` with `mindfulness exercises`, since `kata` can border on cultural appropriation, and, despite being widespread, is not the most descriptive term for the practice. :)

I feel like I've been hearing people talk about code mindfulness exercises a lot lately, and I _think_ I understand what they are. Here's what I gather: it's an exercise that you repeat every day without looking at your previous work. The flow goes something like this:

1. Code the same thing over and over again
2. ???
3. Profit

It seems like a form of code meditation. Am I off base here?

Do you intentionally practice code mindfulness? Have you done exercises in the past and then stopped? What did you get out of it? What's a good exercise to start with?

I feel like this is an interesting concept but I don't have a clear entrypoint, especially since no one on my team or in my circle of friends and mentors practices this form of code practice.
How to massively update records through a Web UI?
Tags: discuss, web, ux, ui
Published: 2018-11-01 13:35:35

---
title: How to massively update records through a Web UI?
published: true
description: Discuss about good solutions to massively update records through a Web UI.
tags: discuss, web, ux, ui
---

#Situation
Your client needs a website where they can manage (CRUD) their products (code, name, price, category, etc.). They know that there'll be times when they need to update the prices or other properties massively, so they want a solution that allows them to do so without having to update every single product independently with the typical update form. 

#My thoughts
I've seen this requirement ☝️ come up in many different software projects. The most common approach to solve it was to let the client upload an Excel sheet with the updated records, then the software iterated through each row and updated the corresponding record in the database. 

I also saw the excel approach fail because users messed with the format or maybe left a "not null" value empty, etc. I always thought there must be a better way.

I'm thinking maybe the Google sheets API could be used to provide a more robust solution 🤔, but I'm not familiar with it yet. 

#Discuss
Have you ever faced this issue? Can you think of a better solution? 🎤

*Edit: Just to clarify, I'm not actually dealing with this issue. I just thought it'd be something interesting to discuss here!*
What is Dependency Injection?
Tags: csharp, beginners, jargon, webdev
Published: 2018-11-01 13:31:06

---
title: What is Dependency Injection?
published: true
description: Let's clear up some more of the crazy jargon by talking about dependency injection.
tags: #csharp, #beginners, #jargon, #webdev
---

There's too much jargon in the web development world. It's honestly surprising that we even understand each other. (do we really though?) That's why I'm going to tell you about dependency injection and what it really is. Let's get straight to it.

The core of dependency injection, the reason we do it at all, is to make a static map of service objects. Service objects are usually only built once when your application starts. The key is that some services depend on each other and the way they are used might change based on any environment conditions or configurations. So how do you use it?

Dependency injection is basically passing parameters to a function. It really is that simple. The reason that we like to do this is so we can keep a separation of  responsibilities in the code. Are you surprised? It's not a framework and it doesn't have to be anything fancy. You can do dependency injection using constructors or a setter method.

You go into your service class and you want to make a new method. Normally you would leave the parameters empty and write all of your code and the objects you need to work with inside. When you are doing dependency injection, that means you pass in any objects you'll work with and use it instead of creating a local one.

What this does is it gives you the ability to use different objects in your method without having to rewrite any code. Once you start testing your code, dependency injection becomes incredible because you can pass in test objects without changing anything!

This is kind of what it looks like:

![dependency injection](https://flippedcoding.com/wp-content/uploads/2018/11/dependency-inj.jpg)

That purple box could be any object you want. The beautiful thing about this is you can process your before you use it. So if you need to clean it up or move some stuff around you can do that beforehand.

I hope that made some sense of dependency injection! It's not very complicated and it can and will help a lot with testing. Have you ever used Spring to handle your dependency injections? I'd like to hear if you liked it or not.

<hr>

Hey! You should follow me on Twitter because reasons: https://twitter.com/FlippedCoding
How to overcome the problem of spelling/grammar mistake in markdown?
Tags: discuss, english, markdown
Published: 2018-11-01 13:18:15

---
title: How to overcome the problem of spelling/grammar mistake in markdown?
published: true
tags: discuss, english, markdown
---

When I write articles in markdown I occasionally face the problem of spelling and grammar mistakes.

What is the best way to deal with this problem?

**NOTE:** I use vs-code text editor for writing articles.
The beginning! 
Published: 2018-11-01 12:57:02

---
title: The beginning! 
published: true
description: starting out
tags: 
---
Hi! I'm Nicko! I am just starting out with front-end and will be moving to backend as well. I feel OK with HTML and CSS, working on learning JavaScript and then off to C#. Feel free to offer any recommendations or just say HI! looking forward to hearing from you all!
The Learner's Conundrum
Tags: discuss, beginners, career, webdev
Published: 2018-11-01 12:20:15

---
title: The Learner's Conundrum
published: true
description: For for a job-seeking newbie to the field, navigating the landscape is difficult. When searching for jobs, a particular (maybe too much) focus is put on frameworks rather than core language competencies. Is this the right approach?
tags: discuss, beginners, career, webdev
---

As someone who has been self-learning programming with no CS background, the question of what language I want(ed) to learn was mentally draining. Coupled with the _infinite_ frameworks/libraries one has the option of learning - it can be a tough battle. One that I considered giving up on in the past.

Any aspiring dev will attest to the fact that the first thing after the initial learning is focusing on getting prepared for a job, so the instinct is to look at job sites to help you understand what needs to be learnt to be job ready. 

Most developers I have spoken to about what I should learn have always stated something along the lines of _'learn the basic concepts & language - the frameworks aren't as important'_. 

As a learner and someone who has been going through this cycle recently, I feel there is disparity between what I have been advised to learn, and what recruiters 'focus on'. I know there are jokes about job posts requiring `x` years of experience, where the language's/framework's age is `< x`. Yes it's funny as these guys should know right? The problem to a learner however, is that we are probably using the job ads as tools to help us choose what we should focus on.

If a learner is using job ads as a guideline, and in most ads they state they require experience of `<insert popular framework here />` - naturally, the learner is inclined to start focusing on that popular framework. Taking the focus off the basic concepts and language. 

To experienced devs it is easy to know what to say and do, but to learners it is a new galaxy. So my questions today are:

- Is there too much focus on frameworks/libraries by recruiters, or is there just the assumption that you are well-versed in the particular language and thus not relevant enough to mention it?

- If there is too much focus, where does this break down? Most devs would say become an expert on the language. Assuming these devs are the same people that recruit, why the disparity?

- Or is it just an issue of perception? If it is, then how can we improve things to  be more inclusive for newcomers?