teleren/devto huggingface dataset:
Is testability a reason to change your design?
Tags: discuss, testing, oop, unittesting
Published: 2017-11-13 19:28:06

---
title: Is testability a reason to change your design?
published: true
description: 
tags: discuss, testing, oop, unittesting
---

The following discussion is something I experience on a regular basis:

> Person A: Why do you extract an interface for this? Can't you just make a normal class for this?
> Person B: Of course I could *just* make a class. But it will be hard to test, because I cannot replace the implementation easily.
> Persion A: So you're changing your design just for testability? Why would one do it? It still would be possible to test it, if you implement it as a simple file. Maybe it's simpler with the abstraction, but you are writing more code.
> Person B: Isn't testability a good enough reason to make that design choice?
> Person A: I don't know? I think I would not do it. It's just testability, you know?

Almost every time I'm "Person B". For me, testability of a feature/application is a big win. And if I can improve testability by adding a level of abstraction, that's a good thing.

Of course there are times when testability isn't that important. For "toy projects" or just small pieces of code it might not be relevant. But in most cases I'm working on complex projects with a big amount of legacy code. While working on those projects, in my opinion, testability is pretty valuable.

I would love to hear your opinion on that topic. Would you change your design just to achieve/improve testability?
Programmer vs Software Engineer
Tags: softwareengineering, ossconcepts, computerscience, reference
Published: 2018-03-02 02:43:31

---
title: "Programmer vs Software Engineer"
published: true
tags: software engineering,oss-concepts,computer science,reference
canonical_url: https://theopensourceu.org/programmer-vs-software-engineer/
---

 ![Programmer vs Software Engineer](https://theopensourceu.org/content/images/2017/11/codeproject2.png)

I came across [this thread](https://www.codeproject.com/Lounge.aspx?msg=5452512#xx5452512xx) via the [CodeProject](https://www.codeproject.com/) Daily News. The original forum post reads:

> I continually have to check the details of syntax and stuff when programming. Things like print format specifiers, the syntax of things I haven't used for a year or so, and use a calculator to work out bit masks and check my bitwise logic. I can never get it right in my head.
> 
> I don't remember details. I don't pride myself on that. I spend my time and energy on the big picture. Designing and understanding complex mechanisms. The architecture. The guts of the machine.
> 
> So I think of myself as a software engineer, not a programmer.
> 
> How about you lot?
> 
> -- [Munchies\_Matt](https://www.codeproject.com/script/Membership/View.aspx?mid=8013439)

This is a topic I see pop up once in a while... In some instances, even going as far as saying "software engineering isn't real engineering". (Though this isn't a case of that.)

Anyway, for posterity, I'd like to put forth my definition.

A software engineer is an individual that carefully considers and crafts the composition of the software... perhaps even the whole system, whereas a programmer, by contrast, is focused on individual feature(s), routines, functions or classes.

In my observation of real-world scenarios, (various commercial and open source projects) a programmer (_by my definition_) will achieve a given goal efficiently (both time and lines of code) but without regard to component composition or the relationship of the components among the whole system.
Keeping the Documentation Green
Tags: ruby, showdev, github, testing
Published: 2017-11-13 17:43:59

---
title: Keeping the Documentation Green
published: true
description: 
tags: #ruby #showdev #github #testing
---

Everyone loves a good example in the documentation.  Often, in the software world, the example is _code_.

Fair enough.

But does that example code actually work?  If it did work at some point in the past, does it _still_ work?

The only way to know for sure is to run it!

Over at my GitHub project, RubyTest, I'm building a tester 'tour' of part of the project.  Each 'stop' in the tour consists of a small test (code) and its output (a log).

Each time I do a build of the tour, the build procedure executes each test and captures its refreshed log.  These are both plugged into a text file that becomes the markdown page for a tour stop.

So I always know that the test code still works!

Check it out:
<ul>
	<li><a href="https://github.com/BurdetteLamar/RubyTest/blob/master/examples/github_api/TesterTour.md#tester-tour">Tester Tour</a></li>
	<li><a href="https://github.com/BurdetteLamar/RubyTest">RubyTest project</a></li>
</ul>
Scheduled Featured Images First Unit Tests Committed
Tags: development, plugins, wordpress, codecoverage
Published: 2018-02-05 19:42:50

---
title: "Scheduled Featured Images First Unit Tests Committed"
published: true
tags: Development,Plugins,WordPress,code coverage
canonical_url: "https://www.ndigitals.com/articles/scheduled-featured-images-first-unit-tests-committed/"
cover_image: "https://www.ndigitals.com/wp-content/uploads/2017/11/william-iven-19843.jpg"
---

I’m happy to report that some of the first unit tests for the Scheduled Featured Images plugin have been committed to the [current development working fork](https://github.com/timnolte/scheduled-featured-images/tree/1.0.0-dev). There is still much work to be done, and a lot of time is being spent on plugin code organization and making sure it is developed in the most modern way, including the use of [Composer](https://getcomposer.org/) for namespace autoloading, as well as making sure a goal of 100% unit test [code coverage](https://codecov.io/gh/ndigitals/scheduled-featured-images) can be obtained.

[https://github.com/timnolte/scheduled-featured-images/tree/1.0.0-dev](https://github.com/timnolte/scheduled-featured-images/tree/1.0.0-dev)

Most of the development was put on hold during the month of October to devote time to contributing to #[Hacktoberfest](https://hacktoberfest.digitalocean.com/)&nbsp;. I contributed to both the [Yoast WordPress SEO](https://github.com/Yoast/wordpress-seo/) & [Seriously Simple Podcasting](https://github.com/TheCraigHewitt/Seriously-Simple-Podcasting) plugins. It was a blast to spend a bunch of time using my past experience with writing my own podcasting plugin to contribute to one of the popular WordPress plugins out there for the general public. I also enjoy taking part in helping in a small way with the WordPress SEO plugin since it is one I pretty much use on any WordPress site I setup or manage. Depending on how well received the Scheduled Featured Images plugin is, and what features are asked for or bugs found, I will probably throw some items out there for Hacktoberfest as well.

The hope right now is that a beta of the Scheduled Featured Images plugin will be ready for testing by the end of November with the hopes that the plugin will be ready for submission to the WordPress Plugin Team by the end of December. Would be an awesome Christmas gift to see my plugin hit the WordPress plugin repo over the holidays. We’ll see what the schedule allows for.

I will try to post weekly updates on progress here on out for anyone interested in following the project status. Till next update! Cheers!

The post [Scheduled Featured Images First Unit Tests Committed](https://www.ndigitals.com/articles/scheduled-featured-images-first-unit-tests-committed/) appeared first on [Nolte Digital Solutions](https://www.ndigitals.com).
Are they all checked?
Tags: javascript, devtips
Published: 2017-11-13 17:13:58

---
title: Are they all checked?
published: true
description: Simplest way to check whether all checkbox input fields checked or not
tags: javascript, devtips
---

Simplest way to check whether all checkbox input fields checked or not; by converting a NodeList to an Array using ES6 `...` spread operator so we can attach `every()` method to it;


Checkout the *Are they all checked?* [Demo on jsfiddle](https://jsfiddle.net/elmahdim/bp8gu9j8/1/)

```javascript
[...document.querySelectorAll('input')].every(checkbox => checkbox.checked)
```
Ruby in The Big Easy
Tags: conferences, ruby
Published: 2017-11-13 16:21:24

---
title: Ruby in The Big Easy
published: true
description: Sharing my goals for RubyConf 2017 in New Orleans
tags: conferences, ruby
---

![RubyConf](https://thepracticaldev.s3.amazonaws.com/i/6bw85vrtzxmenhi3m9ov.jpg)

This week I will be 🛫 flying down to New Orleans, the Big Easy, for my first [RubyConf](http://rubyconf.org/). I am fortunate to have been selected as a RubyConf *Scholar* this year, meaning that the conference has graciously chosen to cover the cost of my attendance and connected me with a *Guide*, a more seasoned participant who can help shape my experience (I even got two guides: *👋 Hi Stella & Caleb!*). I would not have been able to attend RubyConf without this generosity, and even if I would have been able to, my experience would certainly not be as rich and meaningful without the additional support and programming, so I am immensely grateful.  

This will be my first technical conference in almost 15 years. Back in 1999 I co-founded an information security conference in San Diego called [Toorcon](https://toorcon.net/), which is still going strong, but a few years later my life took a different direction and I've only recently returned to coding. If you're interested more in my background you can read my blog post on [Why Would A Rabbi Learn To Code?](http://thecodingrabbi.com/2017/05/02/why_would_a_rabbi_learn_to_code/) on my blog.

As I get ready to leave for RubyConf tomorrow, I thought it important to share some of my goals for this conference to both hold myself accountable and to share with others who might also find themselves in a similar situation. My fellow Flatiron School alum and friend, Yechiel Kalmenson, [shared his reflections](https://dev.to/yechielk/of-conferences-and-scholars-6mn) just a few days ago as well and they are excellent. At this conference I hope to:

* Make at least 2 meaningful new connections each day ☑
* Attend 1 session a day that will be out of my current depth and expand my knowledge ☑
* Attend 3-4 sessions a day that will deepen my existing knowledge ☑
* Not be afraid to skip a session to make a new friend ☑
* Blog about my new learning at least 1 time ☑

If you are also attending RubyConf this year let me know and we can grab some beignets and coffee!
Biology and dichotomous key
Tags: biology, biodiversity, php, mysql
Published: 2017-11-13 15:30:43

---
title: Biology and dichotomous key
published: true
description: has biologies has fear of dichotomous key?
tags: biology, biodiversity, php, mysql
cover_image: https://thepracticaldev.s3.amazonaws.com/i/2riaz4teif7ebylf7stg.png
---

I'm old: I can't live with 20 year ago tools used in biology and botany.

When I was young they teach me ho to identify an unknown plant: open a guide a follow a dichotomous key.

Now I can do the same in a lot of different ways:

* Post on a Facebook group as https://www.facebook.com/groups/1514048998813013/ and you will fined the name in 5 minutes;
* Search on Wikipedia or Encyclopedia of life http://eol.org/;
* Send a Whatsapp message to your smarter friend.

But sometimes I have some old time questions:

* What is the key difference between this two plants ?
* This plant is more similar to Rosacese or Saxifragaceae ?

Botanic guides are fat books: Flora d'Italia is composed by three volumes. A lot of pound to take with you for a trip in the nature.

So I produced a project FiorieChiavi (FlowersAndKeys) github https://github.com/caiofior/fioriechiavi.it to present my favorite dichotomous key on:

* Web, http://www.florae.it/;
* Smartphone or tablet, https://play.google.com/store/apps/details?id=com.caiofior.florafull;
* Epub, https://www.amazon.it/dp/B0725NMXCQ.

The project uses php, mysql, cordova and pandoc; the hardest part is the data entry. Now it is completed at 80%: it will take another year to collect all the data.
Send Monolog critical logs directly to Slack!
Tags: slack, symfony, php, monolog
Published: 2017-11-13 15:02:37

---
title: Send Monolog critical logs directly to Slack!
published: true
description: Send Monolog critical logs directly to Slack
tags: slack, symfony, php, monolog
---

This post was originally posted in my blog [PHP Symfony Tips & Tricks](http://php-symfony.uk/monolog-send-critical-logs-directly-to-slack/)

By using Monolog in Symfony applications, we can log to files, send emails, log to console and many other channels. In this article, I will show the step by step on how to integrate `Monolog` with *Slack*. 
The good thing is integration is just a matter of some configuration in config without writing any line of code. So it could be easily integrated into any project.


Steps:
1) Create a slack channel.

![](https://thepracticaldev.s3.amazonaws.com/i/nkjzshrnox4kef06ayl0.png)
![](https://thepracticaldev.s3.amazonaws.com/i/h9pdxt59ib29a270yhf7.png)



2) Go to https://api.slack.com/web scroll down to **Authentication** and create authentication token.

3) In your symfony app, go to `config_prod.yml` and add the following config in `monolog` section.


```yaml
   slack:
     type: slack
     token: slack api token
     channel: channel name
     [bot_name]: defaults to Monolog
     [icon_emoji]: defaults to null
     [use_attachment]: bool, defaults to true
     [use_short_attachment]: bool, defaults to false
     [include_extra]: bool, defaults to false
     [level]: level name or int value, defaults to DEBUG
     [bubble]: bool, defaults to true
```


> ### Please note that `debug` will flood your channel with lots of logs, so use `critical`

> ### `channel` should start with # just like how it does appear on Slack. 

---

Full configuration example:

```yaml
monolog:
    handlers:
        main:
            type:         fingers_crossed
            action_level: error
            handler:      nested
        nested:
            type:  stream
            path:  "%kernel.logs_dir%/%kernel.environment%.log"
            level: debug
        console:
            type:  console
        slack:
            type:       slack
            token:       xxxx-xxxxxxxxxxx-xxxxxxxxx-xxxxxxxxxx-xxxxxx
            channel:     "#name-of-channel"
            bot_name:    ChooseName
            icon_emoji: :ghost:
            level:      critical
```

`icon_emoji` you can use any emoji from Slack. Checkout the full list on this page:

[EMOJI CHEAT SHEET](http://www.emoji-cheat-sheet.com)



Further reading about Monolog, how does it work .. checkout the following links:

* [Logging with Monolog in Symfony2](https://www.webfactory.de/blog/logging-with-monolog-in-symfony2)
* [Monog Library](https://github.com/Seldaek/monolog)
* [All fun stuff you can do with Monolog (handlers)](https://github.com/Seldaek/monolog/blob/master/doc/02-handlers-formatters-processors.md)
Android App Release
Tags: android, beginners, java, github
Published: 2017-11-13 14:48:22

---
title: Android App Release
published: true
description: 
tags: #Android #beginners #java #github
---

Hello all, just wanted to share that I have officially released an app for the Android platform. Cred Container is a utility-based application allowing users to save profiles so they no longer need to remember their credentials. My app uses fingerprint verification (on supported devices) to login, with a configurable PIN acting as a backup password. The app offers basic CRUD (create, read, update, delete) operations on user-created profiles, in-app settings to alter user experience, and the ability to share profile information via automatic SMS sending and the device's Contacts app. I also built a custom password generator that takes parameters set by the user to randomly create a password within their specifications.
If you have an Android device, and need a secure location to store credentials, please download my app! Any and all feedback is welcome, and I am currently seeking an iOS developer to help build the companion application - feel free to reach out if you know of someone/would like to work with me.
HUGE shout out to my friend, former teammate, and graphic artist Kevin McCartney for his help in designing all the graphics for the app.
Please check out my GitHub for more information about the app, source code, and contact information: https://github.com/developer-dmp/Cred-Container
The 7 Most Popular DEV Posts from the Past Week
Tags: top7
Published: 2017-11-13 12:48:43

---
title: The 7 Most Popular DEV Posts from the Past Week
published: true
description: A round up of the most-read and most-loved contributions from the community this past week.
tags: icymi
cover_image: https://thepracticaldev.s3.amazonaws.com/i/xsr1z6iqv0pd7p3s6ns3.png 
---

#1. Cleanup Tips

Jason has been helping devs clean up their code. Here's a collection of clean code samples that he's collected throughout the month.

{% link https://dev.to/gonedark/a-month-of-clean-code-tips-709 %}

#2. What & How

Interviews shouldn't be one-sided. In this post, Elena empowers the interviewee with questions that help them get a better understanding of the company they're a candidate for. 

{%link https://dev.to/ice_lenor/do-i-want-to-work-in-this-company-or-what-questions-to-ask-on-an-interview-7po %}

#3. Reliable, Fast & Engaging

Ben started writing a post about our implementation of the dev.to PWA, but then he had a really hard time describing what a progressive web app _actually is._ He gives his analysis of google's definition and get input from the community. 

{% link https://dev.to/ben/what-the-heck-is-a-progressive-web-app-seriously-923 %}

#4. Learning Rust at Jury Duty

Logan was stuck with no wifi & jury duty for two weeks so she chose to learn Rust during down times. In this post, she shares different note-taking techniques to be a more effective learner. 

{% link https://dev.to/loganmeetsworld/how-i-take-notes-ag1 %}

#5. Two Programmers, One Computer

A mock conversation between a pair programming practitioner, and a dev that's curious about it. 

{% link https://dev.to/j23schoen/lets-chat-about-pair-programming-aej %}

#6. Distributed Applications

Max doesn't claim to understand cryptocurrencies, but his experience with building a distributed application leads him to believe the future is ethereum. 

{% link https://dev.to/mveytsman/ive-seen-the-future-of-the-web-and-its-ethereum-apa %}

#7. 10 PRINT CHR$(205.5+RND(1)); : GOTO 10 

^ Run on the Commodore 64, in 1982. In this post, KP explores the magical power of a single line of code. 

{% link https://dev.to/burningion/a-universe-in-one-line-of-code-with-10-print-2d1 %}



_That's it for our weekly wrap up! Keep an eye on dev.to this week for daily content and discussions...and if you miss anything, we'll be sure to recap it next Monday!_
Programmers who only code at work
Tags: discuss
Published: 2017-11-13 13:15:07

---
title: Programmers who only code at work
published: true
description: 
tags: discuss
---
What's your opinion on programmers who are not passionate about programming, have no side projects and only program at their jobs. Not senior devs either, just programmmers, who are not juniors anymore. Can they ever improve, write better code? Or do they stagnate.
Asking because my coworker said he doesn't enjoy programming at home.

Update, 2 years later. So, I appreciate all of your responses and since I started developing full time ( not a student anymore ), I can see how people don't have much time to polish their skills outside of their work. However, I want to become better, so I rather sleep less, and try to learn about framework specific things I do not understand in detail yet. Sometimes i even work on work projects in my free time, because i like how they were developed and i want to ingrain those practices into my mind, so when I'll have to make a project from scratch, I'll predict what pitfalls to avoid and how the data should be organised. I really want to show my manager and my mentor that I am capable of not just being a code monkey, but also coming up with inventive solutions to unique problems i'll face along the way.
Now, I understand that my eagerness to work in my free time will slowly fade, but, lately I don't even feel the desire to party because I'm tired/ have work tomorrow and to be honest, I don't even miss going out. Of course, I go out for the occassional coffee, date, hangout, but sometimes i'd rather just stay at home and code 😅
Fetching Laravel
Published: 2017-11-28 19:11:27

---
title: "Fetching Laravel"
published: true
tags: 
canonical_url: http://jerguslejko.com/post/fetching-laravel
---

 **What?** Last night, shamelessly enough, I spent about 3 hours figuring this out. I was working on a Laravel site that has a concept of “companies”. The `companies.index` view simply lists all companies in the database (_no pagination_). I wanted to add a search functionality that would update the HTML table as the user types in the query.

# Issue

When I was sending an AJAX request using the fancy `fetch()` API, Laravel would respond with `404` without any particular reason. I did not query an API route, neither did I use the `api` middleware group. I just wanted to use the same _session-based authentication_ that I already had in place.

# Solution

Turns out, the `fetch()` API does not attach cookies to the request by default. Laravel was receiving a request which could not be identified (no cookies = no session identifier), therefore was not able to recognise the logged in user. In order to send the cookies along with the request, you need to set `credentials: 'same-origin'` in the fetch’s configuration object. The call looks like this:

```
fetch(url, {
    credentials: 'same-origin',
})
```

Now, the request will contain the necessary cookies and the Laravel authentication system will be able to identify the user. 🎉
Explain like I'm five: Is Test Driven Development really that used in most of the programming world?
Tags: discuss, explainlikeimfive, tdd
Published: 2017-11-13 11:38:54

---
title: "Explain like I'm five: Is Test Driven Development really that used in most of the programming world?"
published: true
description: 
tags: #discuss #explainlikeimfive #tdd
---

When I'm navigating on the big wide web that is the internet I often see job postings that require experience in TDD. I've been programming for about two years and I've never really used PHPunit(shame) because each time I finish a functionality I test it with various inputs to correct bugs. Can someone explain (like I'm five) what's the importance of programming using TDD?

P.S.: I hope I've posted this in the right place cause this is my first time :p
Could syntax check for your code be taken as distinct step?
Tags: discuss, coding, testing, python
Published: 2017-11-13 10:49:41

---
title: Could syntax check for your code be taken as distinct step?
published: true
tags: discuss, coding, testing, python
---

Based on https://stackoverflow.com/questions/47262474/could-syntax-check-for-your-code-be-taken-as-distinct-step

Please follow up here or there.

Thanks
What makes you a professional?
Tags: discuss, career, webdev, beginners
Published: 2017-11-13 10:33:40

---
title: "What makes you a professional?"
published: true
description: Recently I was having a chat with a friend of mine. He is working as a dental technician and has limited knowledge of Internet technologies. He asked me a question that made me wonder.
tags: 
- discuss
- career
- webdev
- beginners
---

Recently I was having a chat with a friend of mine. He is working as a dental technician and has limited knowledge of Internet technologies. He asked me a question that made me wonder.

_Friend: What do you do for a living?
Me: I'm a professional web developer, and I build websites.
Friend: Can I learn to code?
Me: Everybody could, I guess.
Friend: And what makes you a professional?_

I didn't know what to tell him. After a few days, I still don't know the real answer.

How would you answer this question?