Trends in Python: What’s Hot in the Hottest Language Today

Python is arguably the programming language nowadays, and in this article we'll explore why that might be the case, what the current trends within the Python community are, and what packages and tools you might want to get acquainted with if you don't want to be left behind. If you were pondering what programming language you should be investing time and effort in, you can stop searching now. It’s Python. Alright, that was an oversimplification. Admittedly, you aren't going to jump into a Java project that's been in development for years just to port all that code into Python just because it's “hot”. Programming languages are a means to an end, and you have to carefully consider the cost/benefit of adopting a given technology. That said, when things are massively moving in a certain direction, that has to mean something. And for some time already, things have been moving towards Python. Hail the King Practically every undergraduate IT class today is taught ..

Pair Programming: Benefits, Tips & Advice for Making it Work

Pair Programming — a pair that's greater than the sum of its parts. You may have heard about pair programming and wondered whether it was worth trying in your workplace. On the surface it sounds simple, but two developers sitting together are not all that it takes to achieve productive pairing. Logistical and personal hurdles such as scheduling, tool choices, and distractions can stop you from getting the most out of pairing. But the potential advantages can make it worth the trouble of recognizing and surmounting these challenges. Why Pair? How could it be more productive to take two programmers who were previously working on separate projects and have them work together on a single project? Won't everything take twice as long? To an outsider the idea of pairing may sound counterproductive at first, but the advantages become apparent when you start to think about why we code and what we're trying to accomplish. Programming is not about churning out the most lines of ..

Using MySQL with Node.js and the mysql JavaScript Client

NoSQL databases are rather popular among Node developers, with MongoDB (the "M" in the MEAN stack) leading the pack. When starting a new Node project, however, you shouldn't just accept Mongo as the default choice. Rather, the type of database you choose should depend on your project's requirements. If, for example, you need dynamic table creation, or real-time inserts, then a NoSQL solution is the way to go. If your project deals with complex queries and transactions, on the other hand, an SQL database makes much more sense. In this tutorial, we'll have a look at getting started with the mysql module — a Node.js client for MySQL, written in JavaScript. I'll explain how to use the module to connect to a MySQL database and perform the usual CRUD operations, before looking at stored procedures and escaping user input. Quick Start: How to Use MySQL in Node If you've arrived here looking for a quick way to get up and running with MySQL in Node, we've got you..

React with TypeScript: Best Practices

React and TypeScript are two awesome technologies used by a lot of developers these days. Knowing how to do things can get tricky, and sometimes it's hard to find the right answer. Not to worry. We've put together the best practices along with examples to clarify any doubts you may have. Let's dive in! How React and TypeScript Work Together Before we begin, let's revisit how React and TypeScript work together. React is a "JavaScript library for building user interfaces", while TypeScript is a "typed superset of JavaScript that compiles to plain JavaScript." By using them together, we essentially build our UIs using a typed version of JavaScript. The reason you might use them together would be to get the benefits of a statically typed language (TypeScript) for your UI. This means more safety and fewer bugs shipping to the front end. Does TypeScript Compile My React Code? A common question that’s always good to review is whether TypeScript compiles your React code..

How Do Developers See Themselves? A Quantified Look

This article was originally published by SlashData. Thank you for supporting the partners who make SitePoint possible. For the first time in our Q2 2019 Developer Economics survey, we tried to introduce developers in their own words by asking them about how they see themselves. We provided a set of 21 words and asked them to choose up to five to form a word sketch of their personality. We also gave them the opportunity to provide their own text description. Here’s what we got: Over half of the developers say they are logical Perhaps unsurprisingly, nearly six out of ten developers say they are logical. And as it turns out this is the most popular choice of description across all software development sectors, except in games development. Next in line, but some way behind, are the descriptors team player and introvert at 37% each. By comparison, just 10% label themselves as an extrovert. But can you guess which programmers consider themselves less introverted? Those involved in the A..

Learn End-to-end Testing with Puppeteer

Puppeteer is a Node library which provides a high-level API to control Chrome or Chromium over the DevTools Protocol. Puppeteer runs headless by default, but can be configured to run full (non-headless) Chrome or Chromium. In this tutorial, we’ll learn what testing is, the different types of testing, and then we’ll use Puppeteer to perform end-to-end testing on our application. By the end of this tutorial, you should be able to end-to-end test your apps easily with Puppeteer. Prerequisites For this tutorial, you need a basic knowledge of JavaScript, ES6+ and Node.js. You must also have installed the latest version of Node.js. We’ll be using yarn throughout this tutorial. If you don’t have yarn already installed, install it from here. You should also know the basics of Puppeteer. To understand the basics of Puppeteer, check out this simple tutorial. To make sure we’re on the same page, these are the versions used in this tutorial: Node 13.3.0 npm 6.13.2 yarn 1.21.1 puppeteer 2.0...

15 Top WordPress Themes to Use in 2020

This sponsored article was created by our content partner, BAW Media. Thank you for supporting the partners who make SitePoint possible. Overworked, overstressed, and flat out fed up with starting every website design from scratch? Here are some WordPress theme solutions you’ll appreciate. Maybe you need to switch to an easy-to-use theme — a WordPress theme that’s crazy-fast and gives you reliable performance may be your cup of tea. Tired of having to build your websites from scratch? It’s totally unnecessary unless for some reason you absolutely want to. Before you blame yourself for the situation you find yourself in, consider this: maybe it’s the tools you’re using. You may be trying to build a house without the use of power tools, scaffolding, or helpful aids. One of the following 15 top WordPress themes should prove to be the solution to your problem. In fact, more than one of them could probably serve quite nicely. Grab a cup of coffee and let’s get started. 1. BeTheme: Re..

Quick Tip: Get URL Parameters with JavaScript

URL parameters (also called query string parameters or URL variables) are used to send small amounts of data from page to page, or from client to server via a URL. They can contain all kinds of useful information, such as search queries, link referrals, product information, user preferences, and more. In this article, we’ll show you how to parse and manipulate URL parameters using JavaScript. Getting a URL Parameter In modern browsers, this has become a lot easier, thanks to the URLSearchParams interface. This defines a host of utility methods to work with the query string of a URL. Assuming that our URL is https://example.com/?product=shirt&color=blue&newuser&size=m, we can grab the query string using window.location.search: const queryString = window.location.search; console.log(queryString); // ?product=shirt&color=blue&newuser&size=m We can then parse the query string's parameters using URLSearchParams: const urlParams = new URLSearchParams(queryString); Then we call an..

How Four Programmers Got Their First Python Jobs

No one really knows how to do a job before they do it. Most people land a coveted position through a strange alchemy of related experience, networking, and hard work. The real experience is the job itself. That’s when you get the opportunity to apply what you know to real-world problems and see it pay off. The following four programmers earned their first Python jobs in different ways. Some had prior Python experience, some didn’t. Some knew what they were getting into, others found out later. Understanding how they landed their first Python job might help you land yours. Here’s how they did it. Nathan Grieve First Python job: Data Scientist How Nathan Got the Job While completing my Physics degree, I applied for a data science job with a small tech startup that primarily used Python (and SQL). The thing is, I didn’t have experience with Python at the time. When the interview came around, I answered the programming questions by using pseudocode to demonstrate I understood the concep..

4 Reasons to Use Image Processing to Optimize Website Media

This sponsored article was created by our content partner, BAW Media. Thank you for supporting the partners who make SitePoint possible. Image optimization is a big deal when it comes to website performance. You might be wondering if you’re covering all the bases by simply keeping file size in check. In fact, there’s a lot to consider if you truly want to optimize your site’s images. Fortunately, there are image processing tools and content delivery networks (CDNs) available that can handle all the complexities of image optimization. Ultimately, these services can save you time and resources, while also covering more than one aspect of optimization. In this article, we’ll take a look at the impact image optimization can have on site performance. We’ll also go over some standard approaches to the problem, and explore some more advanced image processing options. Let’s get started! Why Skimping on Image Optimization Can Be a Performance Killer If you decide not to optimize your images..