Tag: coding

Understand __slots__ in Python
Post

Understand __slots__ in Python

Originally posted on towardsdatascience. A simple way to improve your Python code When we create an object from a class, the attributes of the object will be stored in a dictionary called __dict__. We use this dictionary to get and set attributes. It allows us to dynamically create new attributes after the creation of the object....

How to Make Better Looking Charts in Python
Post

How to Make Better Looking Charts in Python

Originally posted on medium. With the matplotlib and seaborn libraries its easy to make charts in Python, but the default settings can result in an ugly looking chart. This might not be a problem if you only need the chart for your own purposes but if you’re going to share it you may wish to improve its appearance and...

The Maybe data type in JavaScript
Post

The Maybe data type in JavaScript

Originally posted on dev JavaScript is not the only language that can be used to do Web development. Some other languages built upon other programming paradigms like Elm or PureScript are available as well. They rely on functional programming and most of the time have similar concepts. And one of these concepts is the Maybe...

9 Things to Know to Master List Comprehensions in Python
Post

9 Things to Know to Master List Comprehensions in Python

Originally posted on medium This tutorial will help you learn the most common usages of list comprehensions in Python Many more people are starting to learn Python, as it has become one of the most popular programming languages for almost anything, like web development, scientific computing, and certainly artificial intelligence. No matter where you’re going...

Where programming languages are headed in 2020
Post

Where programming languages are headed in 2020

Originally posted on oreilly Experts discuss what’s in store for popular and growing programming languages. As we enter a new decade, we asked programming experts⁠—including several of our own O’Reilly authors and instructors⁠—for their thoughts on what’s in store for some established players and fast-growing languages. Python The biggest news this year in Python is...

gig: a gitignore generator
Post

gig: a gitignore generator

If you are using git in your project, you probably know what is .gitignore. Since I never seem to be able to memorized gitignore’s pattern format correctly, when I needed to write a gitignore file for a specific project, I’ll visit github/gitignore in my web browser, search for gitignore file, open the file, copy its content, then finally paste it into my...

What Does the “Yield” Keyword Do?
Post

What Does the “Yield” Keyword Do?

Iterables, functions, and generators in Python To learn about the yield keyword, there are a variety of other terms and concepts that you must be comfortable with first. Before we dive into all of that, let’s keep the end in mind and talk through why yield is beneficial. Using yield will improve the memory efficiency — and subsequently, the speed/performance — when...

Here’s How Not to Suck at JavaScript
Post

Here’s How Not to Suck at JavaScript

Let’s be honest. A lot of JavaScript code sucks. Change that! JavaScript is a force to be reckoned with. It is the single most widely-used programming language in the world. Its simplicity and the abundance of learning resources make it approachable for beginners. Large talent pools make JavaScript appealing to companies of all sizes. A...

Parallelising your Python Code
Post

Parallelising your Python Code

Swirl into a game-existencewhere you and your friend are miners. Yep, the yellow hat and shovel in hand. The task — Dig up a hole within a certain time to be able to extract some sparkly diamonds! So your friend suggests that you and they take turns digging… Let’s say it takes you 100 minutes to finish this task when done...

How to Write A Programming Language
Post

How to Write A Programming Language

Under the Hood Have you ever found yourself writing code and wondering exactly what is going on under the hood? How does programming really work? In an attempt to peel back at least one of the curtains, Jessica Betts and I created our own Esoteric Programming Language based on Lord of the Rings lore called My_Precious. There are many...