Sign Up Now!

Sign up and get personalized intelligence briefing delivered daily.


Sign Up

Articles related to "programming"


Guide for the daily JavaScripter

  • This document is a summary of good programming practices in js in general.
  • The trend today is to focus on functional programming, both to develop a frontend or a backend.
  • These are some functional programming principles that are useful to know.
  • Use camelCase when naming objects, functions, and instances.
  • Use PascalCase only when naming constructors or classes.
  • Use JSDOC tag to describe a function.
  • Different ways of handle errors.
  • How to handle functions in a modern way.
  • Use named arrow function expressions instead of function declarations.
  • Use single quotes '' for strings, don't mix with "".
  • Use destructuring when accessing and using multiple properties of an object.
  • Use array destructuring.
  • Use dot notation when accessing properties.
  • Some points of how to handle and declare variables in javascript.
  • MINOR: version when you add functionality in a backwards-compatible manner.

save | comments | report | share on


Introducing Java 14 Records

  • There are a couple of nice features coming with the JDK 14 release, for now, we would just have a look at Records.
  • We shouldn't expect "cool" features with every release and should understand that the features added to Java are not to make it "shinny" or "cool" but rather to boost developer productivity and reduce bugs.
  • While the Response class could easily be generated with our IDE, it could be an issue while reading.
  • We shouldn't have to read through over 40 lines just to find out this class was built to simply hold data.
  • A Record would automatically generate a constructor whose signature matches the state description, private final fields and getter methods for each state component.
  • Records are one of the many nice features coming to Java and the six-month release cadence helps us access these features faster.

save | comments | report | share on


Introducing Java 14 Records

  • There are a couple of nice features coming with the JDK 14 release, for now, we would just have a look at Records.
  • We shouldn't expect "cool" features with every release and should understand that the features added to Java are not to make it "shinny" or "cool" but rather to boost developer productivity and reduce bugs.
  • While the Response class could easily be generated with our IDE, it could be an issue while reading.
  • We shouldn't have to read through over 40 lines just to find out this class was built to simply hold data.
  • A Record would automatically generate a constructor whose signature matches the state description, private final fields and getter methods for each state component.
  • Records are one of the many nice features coming to Java and the six-month release cadence helps us access these features faster.

save | comments | report | share on


Build a Simple Arcade Game With Vanilla JavaScript - DOM ManipulationšŸš€

  • As a general rule, the first thing we need to do with a problem like this is to think about the approach we need to follow and the recipe.
  • That means we need to figure out each step and the detail we need to complete those requirements.
  • Now, we are going to create an event listener on our duck image.
  • When a user clicks on the duck image it will fire a function.
  • Now, weā€™re going to create a function that will increase the counter, our score, by one.
  • Now, weā€™re going to create a function to move the duck.
  • Also, we use the getRandomNum function to set the pixel numbers for top and left properties to affect the vertical and horizontal position of the duck.
  • I hope you followed this simple guide and have gained an understanding of DOM manipulation.

save | comments | report | share on


Machine Learning, Kolmogorov Complexity, and Squishy Bunnies (2019)

  • And, although the lookup table may become unfathomably huge, and the pre-computation time insanely large for complicated functions, in theory this very same trick is applicable to any function we are interested in - not just very simple functions like sin - functions even as complicated as a physics simulations.
  • Given these two additions, another question to ask is this: Is there a generic kind of program like the ones we've presented so far which lies in the sweet spot at the bottom left of the graph - not using too much memory - not using too much computation - providing the best of both worlds?
  • It tells us that if we try to approximate a fairly simple physics simulation with a Neural Network, we have a good chance of hitting the sweet spot between computation and memorization!

save | comments | report | share on


The Evil of Pair-Programming

  • Assuming that the interactive, synchronous and intense learning model embodied by pair-programming is always the 'correct' one, has no valid scientific basis.
  • Just because someone knows their subject inside-out and can write beautiful and effective code, does not mean they can successfully impart their skills and knowledge onto others, least of all in an interactive and continuous manner.
  • But instead of waiting for the code review stage, we can implement a continuous asynchronous review process, where a developer posts their design, code or even thoughts on a special-purpose wiki (or a GitHub gist) in their own time and other team members can respond when and how they see fit.
  • Ensure pair-programming happens in short, time-boxed sessions.
  • Ensure pair-programming sessions are focused and scoped in specific areas,e.g. how to implement a design pattern, or the fundamentals of a new framework, etc.

save | comments | report | share on


Build a Simple Arcade Game With Vanilla JavaScript - DOM ManipulationšŸš€

  • As a general rule, the first thing we need to do with a problem like this is to think about the approach we need to follow and the recipe.
  • That means we need to figure out each step and the detail we need to complete those requirements.
  • Now, we are going to create an event listener on our duck image.
  • When a user clicks on the duck image it will fire a function.
  • Now, weā€™re going to create a function that will increase the counter, our score, by one.
  • Now, weā€™re going to create a function to move the duck.
  • Also, we use the getRandomNum function to set the pixel numbers for top and left properties to affect the vertical and horizontal position of the duck.
  • I hope you followed this simple guide and have gained an understanding of DOM manipulation.

save | comments | report | share on


Notes on Linear Transformations

  • This post explores well-known methods to scale, rotate or shear objects, and to combine multiple transformations at once.
  • You can think of these points as offset vectors from the origin or n by 1 matrices.
  • By modifying these matrices with mathematical operations, you can effectively change attributes from the object.
  • There are certain matrix configurations that produce known results, by modifying values on this known matrices, you can scale, rotate or shear an object.
  • Scaling is used to make an object bigger or smaller, mathematically this means multiplying each coordinate by a constant.
  • In the example below, the rectangle is reflected horizontally by using a scaling factor of -1 in the x axis.
  • In the example below, you can see a rotation matrix in action (Ļ• defined in radians.) You can move the slider to see the values update.
  • Shear transforms pushes or ā€œtiltsā€ objects vertically or horizontally.

save | comments | report | share on


One Difference Between Smart and Professional Programmer

  • Programmers are pretty smart people.
  • Smart people sometimes like to show off their smarts by demonstrating their mental juggling abilities.
  • if you can reliably remember you can write similar code.
  • Write readable and understandable code.
  • Keep Learning!

save | comments | report | share on


The 7 Most Popular DEV Posts from the Past Week

  • Pierre scraped 70 "Best Programming Book" listicles and whittled down the recommendations into one manageable list.
  • Davide shares an endearing story of using Scratch to build a math game with their kids.
  • Iqra gives us a visual overview of the DOM and how we can change the content displayed on a web page.
  • John shares six platforms to learn programming, the fun way!
  • Each platform has a different approach but they all encourage you to study via play.
  • Wojciech a pattern for writing tests that help avoid unnecessary repetition.
  • Jared helps us realize we don't need to be a math whiz to understand Big O.
  • In this tutorial, youā€™ll learn the fundamentals of Big O logarithmic time complexity with examples in JavaScript.
  • 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!

save | comments | report | share on