teleren/devto huggingface dataset:
Why "Consider refactoring this" comments are silly
Tags: codecomments, codestyle
Published: 2022-02-21 16:13:09

---
title: Why "Consider refactoring this" comments are silly
published: true
date: 2022-01-06 00:00:00 UTC
tags: codecomments,codestyle
canonical_url: https://jhall.io/archive/2022/01/06/why-consider-refactoring-this-comments-are-silly/
---

Yesterday I listed [three causes of TODO comments](https://jhall.io/archive/2022/01/05/todo-add-an-intriguing-title/). I want to call one of these types of comments out as particularly silly for teams practicing modern, agile software develpoment:

> Ideas for future improvement

These comments take many forms, in my experience. Here are a few examples from real code:

- TODO: Consider something more robust
- TODO: Consider using dynamic imports for lazy-loading
- TODO: Add more test cases
- TODO: Consider adding a GetAll() method

So why do I think these are silly?

Because none of these TODO comments stands alone. Nobody (unless they’re utterly bored) is going to run into one of these and think “Gee, today would be a great day to add that `GetAll()` method!”

If any of these TODO comments are actually resolved, it will be in service of another purpose (i.e. “I really need some way to get all elements from this object, for this new feature I’m creating”). And in such a case, the TODO comment is entirely extraneous.

Not only that, but it should go without saying that _all code is always subject to refactoring_ when the need arises. That’s part of evolutionary design. Adding a comment to that effect is just noise.

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
What Is the Role of Product Engineers in a Business?
Tags: webdev, programming, beginners, tutorial
Published: 2022-01-05 23:36:13

“Product engineering” is a term that typically spans over a wide range of actions that are performed to organize, manage, and run the process of product development as efficiently as possible. Simply put, this process oversees the entire procedure of planning and concept embodiment of the end product. The principles of product engineering are applied in a variety of fields, not limited to business models or software development. 
Efficient product engineering requires a high level of expertise, as well as a diversified approach that spans both management and engineering aspects of the process. Given the high expectations, no wonder why these days there is a high demand for experienced product engineers. Nevertheless, for some companies, hiring and keeping an in-house specialist is a real challenge; so, instead, they outsource. Third-party product engineering services already have experience and proof of successful ventures.
What Is the Role of Product Engineers in a Business?
In a software development company, product engineers define the direction for the entire product creation process while also actively participating in this process. As a rule, they are responsible for tackling tasks from a variety of areas, including those related to management and strategy. However, the core purpose of their work remains unchanged: product engineers are responsible for creating a successful product model and ensuring that it will be implemented in the proper technical way.
Due to a broad range of responsibilities, product engineers participate in the product development process at all stages. To be more specific, specialists in this role typically contribute to product development in the following ways:
Concept and planning. Product engineers help identify and outline the concept of the future product. Using the information gathered from the market research, these specialists define whether the initial vision of the future product aligns with the current market situation and, when necessary, add the needed adjustments to the concept. Product engineers also might conduct independent research if necessary. Their goal is to identify the potential ROI, functionality, and technical means needed to implement the concept. Finally, product engineers organize all the data into thorough product specifications and project plans to set the direction for the product development process.
Interested in learning more? Find the full version of the article at [https://develux.com/blog/what-is-product-engineering](https://develux.com/blog/what-is-product-engineering).
Flutter is it good for SEO ?
Tags: webdev, flutter, discuss, seo
Published: 2022-01-05 23:18:58

Hello,

We want to develop the newest version of our platform ([leboncoin](https://lecoinoccasion.fr)) in flutter to get one code for all platform (Android, iOS, windows, linux and WEB). We dont want to lose our SEO ranking in google. Is it good idea to migrate the website in a flutter version ? currently, it's a standar web website (html + css + JS,...)

Regards
Best open source todolist app and much more - Super productivity
Tags: productivity, management, pomodoro, todolist
Published: 2022-01-05 23:09:13

**What is Super Productivity?**
Super Productivity - I like this app so much. It works on linux, windows, macos, android and ios and helps me getting better organised. I just write all my todos down there and they get synced from my pc to my phone and other devices. I can also look them up in the web, just as a browser tab while I am searching. It also supports note takeing, has a pomodoro timer and time tracking. It also has a habit tracker build-in, how nice is that. And the best part - it is FOSS, so I get all features for free, unlimited projects and I can read and modifiy the source code, hosted on github. It is avaible in the Microsoft store, so it gets updates automaticly but you can also download it from the website.

**What I have tried before**
I tried todoist, zenkit, any.do and much more before, but non of this apps get me. Thats why I got the neovim org mode plugin. But I had so much text then there in the .org file and it wasn't really organised, when you have 25 todo tasks a day. I have a backlog in super productivity and it is also synchronised with github issues and my ical calendar. It also supports gitlab and jira sync.

**Best parts of the software**
I think the best things of the software are:

- Nice design, you can switch the wallpaper to your own and have a clean look
- Good gestures for mobile
- Great pomodoro features
- Awesome habit tracker with click count and timer
- Good sync
- Free
- Open source
- And much more

**Note**
I will still use this software in the future and I plan to write an article on dev.to after using it one month, so you can see if I still love this wonderful software. I will also use it for school stuff.

Have a great day.
Need your opinion for leboncoin
Tags: discuss, javascript, programming
Published: 2022-01-05 23:09:11

Hello,
We have devloped the [leboncoin](https://lecoinoccasion.fr) as a new classifieds french plateform and we need your suggestions to optimize it.


![Screenshot of the homepage of leboncoin](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bugzzs4ig3rk9qrpzcf3.png)

The plateform is written in PHP.

All suggestions are welcome.

regards
Replacing terms using ^ in the Linux Terminal
Tags: datascience, tutorial, linux
Published: 2022-01-05 23:05:11

I use the terminal quite a lot in my day-to-day activities. This includes, but is not limited to: copying files, installing packages, running updates, searching for folders, etc. Sometimes, the commands are simple `ls -la` or `grep` to show files and search for text respectively. 

But sometimes, these commands are longer, MUCH longer, and this is past the point of realizing that I should have written this in a script file to run that way. AND, God forbid that I happen to make a mishap  in typing some unnecessarily convoluted command and hit enter OR that I need to use a similar command again, then I have to go through the trouble of either typing it from scratch or hunting through terminal history to find, modify and re-execute the command. 

Until I discovered the `^` operator....

Let's start with an example, let's say I wanted to use `conda` (a package manager commonly used for data-science development), to create a new environment, in this case I'm using the following code from [NVIDIA's RAPIDS install instructions](https://rapids.ai/start.html#get-rapids) for ease of demonstration.
```bash
conda create -n rapids-21.12 -c rapidsai -c nvidia -c conda-forge \
    rapids=21.12 python=3.8 cudatoolkit=11.5 dask-sql
```

However, let's say that I realised that I wanted to actually create the environment using a different version of python (again, for demonstration purposes, although there are packages that work with 3.7 but not 3.8).

In order to replace the `3.8` from the above command, here's the code I can use for in-place substitution:
```bash
^3.8^3.7
```

The above code will replace the first occurence of `3.8` from my previous command with `3.7` and proceed to re-execute the command. 

I realise the above is REALLY application-specific, so let's break this down:
If I type:
```bash
echo star wars
```
the *output* is
```
star wars
```
If I type the following after the above
```bash
^wars^trek
```
The output becomes
```bash
star trek
```
Let me show that in-terminal so you get an idea of exactly what we're doing
![Basic Replacement](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g50bb2ndaeivih6op8ka.png)



The `^` operator is a shorthand way of using the `gs` command for global substitution. In other terms, `^wars^trek` is equivalent to 
```bash
!!:gs/wars/trek
```

Now let's say I wanted to replace **all** instances of a term from the most-recently run command, so if I ran:
```bash
echo luke luke
```
followed by
```bash
^luke^leia^:&
```
the result is the equivalent of running:
```bash
echo leia leia
```

Again, to see the continuity of how these commands work, we need to see them in-shell:

![Full replace](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dot9byqy4l555s8ij59g.png)

And now back to the original example (ignore the `CondaError` as this was necessary to cancel the original command)

![conda command](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j77bpb38tu1a0ftex0te.png)
6 Julia Frameworks to Create Desktop GUI’s and Web Apps
Tags: programming, julialang, visualization, coding
Published: 2022-01-06 00:55:14

---
title: 6 Julia Frameworks to Create Desktop GUI’s  and Web Apps
published: true
date: 2022-01-05 22:42:18 UTC
tags: programming,julialang,visualization,coding
canonical_url: https://towardsdatascience.com/6-julia-frameworks-to-create-desktop-guis-and-web-apps-9ae1a941f115
---

[![](https://cdn-images-1.medium.com/max/2600/0*8rEjoHvLXEFDK4kk)](https://towardsdatascience.com/6-julia-frameworks-to-create-desktop-guis-and-web-apps-9ae1a941f115?source=rss-2c8aac9051d3------2)

You could build beautiful apps purely in Julia.

[Continue reading on Towards Data Science »](https://towardsdatascience.com/6-julia-frameworks-to-create-desktop-guis-and-web-apps-9ae1a941f115?source=rss-2c8aac9051d3------2)
Drupal 7: Hide Label on Node Display
Tags: webdev, php
Published: 2022-01-05 22:31:00

I ran into a problem on an old Drupal 7 site where labels for a custom field were displaying, even when there was no content associated with that field, creating a page that was simply a series of headers in a row. That’s not very user-friendly.

If I wanted to always hide the label for a field, that’s easy enough in the default Drupal display settings for the content type. But what about this scenario where we want to show the label when there is content and hide the label when there isn’t content?

In theory, the logic for this is simple. In the node template for that content type – in the node–content-type.tpl.php in the templates folder of your theme – we want to add some simple logic that says to not show the field at all if the value of the field is empty.

If you don’t already have a node–content-type.tpl.php, copy your default node.tpl.php file, rename it to node–content-type.tpl.php, and then the changes you’ll want to add are before the main content variable is rendered for the page.

A couple wrinkles did make it a bit more complicated, though.

First, you cannot check if the value of the field is set. It is always set. That’s entirely reasonable, but not obvious, so I still mention it.

Second and a lot less reasonable, I couldn’t even use a test for if the field is empty. This is where I spent the bulk of my time being confused. I would write the value of the field to a log or message to test and it should show nothing. I could inspect the code and there was nothing – not even a space or a hidden HTML tag. But if I tried to test for empty() or the string to equal ”, it still said no, it’s not empty. Eventually I checked the length of that string and discovered it was 2, not 0.

I do not know if that is universal in Drupal 7 or if there was something weird with this one site. It’s possible you’ll be able to get away with a simple empty() test instead of the strlen() test.

So this was my final code addition to the node template file:

`//hide some labels if the corresponding value is empty

$field_value = $content['field_field_name']['#object']->field_field_name['und'][0]['value'];

if ((strlen($field_value) <= 2)) {
  unset($content['field_field_name']);
}`

You could also do this in one line instead, depending on where you fall in the debate between easy readability vs minimal code. I left it as two different lines to be easier for somebody looking at it to understand what was happening.

`
//hide field label if the corresponding value is empty

if ((strlen($content['field_field_name']['#object']->field_field_name['und'][0]['value']) <= 2)) {
  unset($content['field_field_name']);
}
`
Forecasting Sales for the Next Two Years
Tags: atlashackathon, mongodb, java, javafx
Published: 2022-01-05 22:15:48

### Overview of My Submission
We developed a great forecasting application. When you enter the monthly sales data of your products in the past two years, our application reports how much your product will be sold for each month of the next two years with 4 different forecasting methods. These forecasting methods are "Exponential Smoothing","Double Exponential Smoothing","Regression Analysis" and "Deseasonalized Regression Analysis". MSE is calculated for each method and the method with the lowest error rate is determined. But you can get the reports of all other forecasting methods.

* [GitHub Repository](https://github.com/adarSonmez/forecasting-car-sales)

### Submission Category: 
Choose Your Own Adventure

### Link to Code
{% github https://github.com/adarSonmez/forecasting-car-sales %}

### Additional Resources / Info

* [JavaFX](https://openjfx.io/): We used the JavaFX library in the interface of our application and benefited from FXML technology.
* [MongoDB](https://www.mongodb.com/): We preferred to use MongoDB in our program because of its flexibility, speed, power and compatibility with Java.

#### Screenshots

![Main Page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qnxjv42s6qwp6swlxopq.png)
The main screen of the application is shown above. You can easily access other menus from this page.

![Add Page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/11ht0158dbzjvndvusft.png)
You can add a new dataset from menu above.

![View/Update Page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1l9gp5om0l6ovv0r5v9m.png)
In this menu you can view and update a record of existing dataset.

![Database Modeling](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jyck0mdmji8yv50qw3f1.png)
MongoDB database modeling of datasets is shown above. Why we prefer this model is explained in detail in the README.md file on GitHub.

![Proporties of Methods](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yhv9l0z17wtp6rypicps.png)
In the menu above, you can examine the general properties of all the forecast methods made on the dataset you selected. Note that the method with the smallest MSE value is recommended.

Detailed sales forecasts for each month of the selected dataset are shown in the next four screenshots.

![Exponential Smoothing](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1yvcq1x3d8litcl8f81z.png)

![Double Exponential Smoothing](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/engydr0appndovvjommi.png)

![Regression Analysis](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iftsogw11p7261kladh8.png)

![Deseasonalized Regression Analysis](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4gd9uuvtwahdha7xiv3l.png)

_We developed this project with my school friend [Yusuf Mert Ülgen](https://github.com/yusufmertulgen2000)._

_We encourage you to read the README.md file, where we introduce our project in more detail._
_Thank you for giving a time. Hope you like our project :)_
React-Redux flow
Tags: beginners
Published: 2022-01-05 21:57:44

The react-redux flow, how it flows from getting information from your forms to your store state.

- On your form, an event handler is triggered. 
2. Once that event has been triggered, it is going to dispatch an action to the redux store.

Dispatching an action is the only way to trigger a state change. [dispatch(action)](https://redux.js.org/api/store#dispatchaction)

- The store then, is going to run the reducer function 

Reducer function passes in state and action. Then it uses the switch statement to change between cases depending on the dispatch type. 

Switch statements render one component at a time when you have multiple components to render.

- Switching between cases, the state will update accordingly. 
5. And finally the UI will re-render with the new updated data
Formify | Hassle-free HTML Form Endpoints
Tags: atlashackathon, react, mongodb, node
Published: 2022-01-05 21:29:00

## Overview of My Submission 👀
The fastest and the easiest way to create forms and collect submissions on the internet. Formify completely automates your HTML form so you don't need to worry about any backend code, formify will handle everything for you. 

### Features 🤩
It comes with the power of Email notifications, Discord webhooks URL and Return URL support, it let's you handle your different forms used over different sites and handle each of their submissions with a clean UI.

### Built with
1. [MongoDb Atlas](https://www.mongodb.com/atlas) - The multi-cloud application data platform.
2. [ExpressJS](expressjs.com) - Fast, unopinionated, minimalist web framework for Node.js
3. [ReactJS](https://reactjs.org/) - A JavaScript library for building user interfaces
4. [NodeJS](nodejs.org) - Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine.

### Submission Category: 

- Choose Your Own Adventure

### Link to Code
{% github https://github.com/tarunfy/formify %}

### Additional Resources / Info

- Here is a working live demo : [formify](https://formifyy.vercel.app/)

#### Video Tutorial
{% youtube https://www.youtube.com/watch?v=jJf_40jEBJQ %}

### Look Ups
![Landing Page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/si9may7wb7lf03by376h.PNG)

![Signin](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wtg5jo8wkezrorj7kkkx.PNG)

![Signup](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lq9uiobw1rljuajz2xj0.PNG)

![Dashboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8x1jg7hkgp24fuo9o261.PNG)

![Form Details](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wjg2o3f1z9uq7zix4evn.PNG)

![Form Submissions](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/75mddv8a4ildww9q4p5x.PNG)

![Reset-Password](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4cyxzj8ug822dm6ac0p5.PNG)

![Forgot-Password](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9olos33ac6ut5it3v0io.PNG)

![Discord Wekbook](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/27nf6bn7vaatki8e9imp.PNG)

![Email](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v7il4rbkt8387g0292nm.PNG)

Hope you like it, make sure to drop your feedback in the comment section down below, it will help me improving this product more & more and also boost my motivation.
Customer Portal - handle upgrades and downgrades differently?
Tags: react, node, stripe, payments
Published: 2022-01-05 21:28:34

I'm using the Stripe Customer Portal to sell subscriptions and I would like to achieve the following functionality:

```

1. For subscription UPGRADES allow the upgrade to happen immediately and invoice to generate right away
2. For subscription DOWNGRADES have them scheduled to occur at the end of current billing cycle.
```

Is this possible with the Stripe Customer Portal??
Meaningful Coding Projects over just Coding Projects
Published: 2022-06-05 01:13:28

---
title: Meaningful Coding Projects over just Coding Projects
published: true
date: 2022-01-05 21:22:41 UTC
tags: 
canonical_url: 
---

What I think coding projects should be like.

Being an all-in-one freelancer software developer isn’t a wonderful career at all, I can relate.

I spent most of my time ‘working’ on projects, not just coding. As a solo team, I have to reach clients, quote, research, plan, design, test, code, sell, deploy and collect feedback on most projects.

Figure this out: A local client ask me to build a full pawn shop management system from scratch months ago, and my answer was: ‘Sure’, let’s do it!

Confession: “I feel regret after a half week”.

Now it’s finished, and I’m proud of it, but that’s not the point.

After finishing the project, I started thinking about several small-sized projects I made just to have something to show when somebody asked for a portfolio. That thought, was as good as a worm to a fresh apple.

I got frozen in the small projects building area, and built a giant list on ‘things to build someday’. A few days ago, I just realized that isn’t the best I can do in life. And then decided to go to my GitHub profile and clean it up.

The projects I’m talking about, were surprisingly useless. You know, countless To-do apps in many programming languages/frameworks, simple API things, hello worlds, many projects I made in courses or reading books, even shitty code made to apply to a coding boot camp program called Microverse, and numerous, I mean, lots of blank projects, templates and prototypes for myself.

I was completely amazed and realized that many of them should be erased from the internet urgently.

Don’t get me wrong, I really learned from those projects, not much, sincerely, but learned something each one; and here’s the crucial thing: wouldn’t be better if I’d preferred to work on real-life useful projects?

I’m disappointed by how I wasted my time working on those things. Thanks to that, my GitHub account had 110+ repos and now, after a deep cleaning, there are just 3.

Those are BTGen, a template generator, the first NPM package I published; Frontsite, a Ruby on Rails engine that generate a bunch of pages every one use almost every time that build and app, the first ruby gem I release.; and the kenliten repo, which is just to show a customized view page in my profile.

Yesterday, I took some time to get this done, and today I want to take a time to think about, and explain in plain English, why did I commit this.

I decided to stop creating useless pieces of software that nobody will use in life, and start creating really useful that community will love and people can use in a daily basis.

And here I am. Next thing to do is find an idea, some missing feature or software people need.

Any idea?