DEV Community

Cover image for Top 5 DEV Comments from the Past Week
Peter Kim Frank Subscriber for The DEV Team

Posted on

Top 5 DEV Comments from the Past Week

This is a weekly roundup of awesome DEV comments that you may have missed. You are welcome and encouraged to boost posts and comments yourself using the #bestofdev tag.

Answering What do you do when you don't feel productive?, @vuild provides a great list of todos for those moments when you feel like you just don't want to do anything:

"Not today" can be boredom, burnout, lack of appreciation, frustration, distraction, hatred (user/bosses/hardware/software/lang/tools/industry), motivation, laziness or just needed.

  • Start anyway. Just a tiny item.
  • Push through. Do it no matter what.
  • Cause pressure/stress. It has to be done.
  • Cancel the day, reward yourself no guilt & then ban the next 5 'not todays'.
  • Do physical activity. Release.
  • Do mental activity.
  • Fill up with inspiration (see things, look at things, study things).
  • Do something else (distract, detoxic, grow).
  • Change roles/projects/job/title/skills/industry.
  • Do it for someone you care about (whatever it is & whoever someone is).
  • Set goals. Small or large but achievable.
  • Publish stuff (build your brand/network/skills/whatever).
  • Play games. Call it 'research'.
  • Have a cause or purpose.
  • Engage with people you like.
  • Sleep. Eat.
  • Screen Staremode (can work).
  • Stimulation (lights/audio/sugar/caffiene/nicotine etc).
  • Break something (that causes urgency to your mind).
  • Check meds (if relevant).
  • Don't worry about it unless there are lots of days in a row or it becomes regular.

Any, none or all of the above depending on the person I guess.

@jadebeer adds on to the 10 Things Every Software Developer Should Know list with an oftentimes overlooked aspect of being effective on teams:

The one thing almost nobody ever focuses on is: people skills.

Learn how to work in teams, learn how to communicate. Learn what makes you tick and how to respectfully communicate that. Become acquainted with your strengths and weaknesses (yeah we all have some) and how this can contribute to your team's success and your growth.

We don't work in solitude - almost all ventures consist of teams. And if you do happen to be a one-person coding machine, you need to be better than ever dealing with people if you hope to understand your users and sell your product.

Invest in your soft skills, build your relationships. Make being a people's person part of your personal brand.

@lucagrandicelli plucks out a choice quote from @erikaheidi's wonderful article The Art of Programming:

"art built on top of logic" is probably one of the best descriptions i ever read.

In Docker For Frontend Developers, @derek follows up with a quick note about size and security:

Oh, also you can get more bang for your buck...

if you use

FROM node:8-alpine
Enter fullscreen mode Exit fullscreen mode
Enter fullscreen mode Exit fullscreen mode

Enter fullscreen mode Exit fullscreen mode

or

FROM gcr.io/distroless/nodejs
Enter fullscreen mode Exit fullscreen mode
Enter fullscreen mode Exit fullscreen mode

Enter fullscreen mode Exit fullscreen mode

Becasue... Size matters 😜, and so does security 🔒

Image Size
node:8 681MB
gcr.io/distroless/nodejs 76MB
node:8-alpine 69.7MB

@mortoray joins the conversation in Javascript Array.push is 945x faster than Array.concat 🤯🤔 to provide further analysis and context about the complexity of what's going on:

Nice investigation.

The concat loop is akin to O(n^2) whereas the push loop is O(n). By creating a new array you need to do the copy, as you showed. This happens for every iteration of the loop*. An array push however is amortized constant time (usually), thus you only copy each element once (well probably three times).

Part of the issue with increased copying is the increased memory access. Your array probably exceeds the bounds of the L0 cache on the CPU, possibly the L1 cache. This means that when concat copies, it needs to load new memory from a more distant cache, repeatedly. The push version never accesses the data already in the list, thus avoiding this extra memory loading.

(*Before somebody gets pedantic, it's more like a K*N loop, where K is the loop iterations. Hwever, since the size of the resulting array is linearly related to K, it means c * K = N, thus ~ N^2)

See you next week for more great comments ✌

Top comments (4)

Collapse
 
peter profile image
Peter Kim Frank

Congrats to @vuild , @jadebeer , @lucagrandicelli , @derek , and @mortoray for making the list this week!

Collapse
 
vuild profile image
Vuild • Edited

Thanks dev.to team & @sxldvd too. I wrote a speech but I am too shy to give it.

I've found a bunch of useful stuff & cool people so I am happy to try to give something back.

Collapse
 
sxldvd profile image
{Dev.id}

Thanks @vuild . That comment should be printed and display in every office 😆

Thread Thread
 
vuild profile image
Vuild • Edited

No

🤣

Actually, 150USD per copy. No probs. Crypto accepted.