Tag: coding

Home / coding
Building Code
Post

Building Code

How were programming languages built? Here’s a brief history. We, humans, have always been on the lookout for somebody to do our heavy and unwanted lifting. First it was simple machines, then steam powered beasts, and at the end a bunch of semiconductors and a quartz. But how do you get a simple stone to do...

Essential Books That Every Programmer Should Read
Post

Essential Books That Every Programmer Should Read

Never ask advice of someone with whom you wouldn’t want to trade places — Darren Hardy The idea to collect a list of books that knowledgeable, experienced and well-known programmers recommends to read comes to me from The long Journey to Ruby Mastery conference talk by Bozhidar Batsov. Here I share what I have found so far: the books recommendations...

Removing JavaScript’s “this” keyword makes it a better language. Here’s why.
Post

Removing JavaScript’s “this” keyword makes it a better language. Here’s why.

this is of course the source of much confusion in JavaScript. The reason being that this depends on how the function was invoked, not where the function was defined. JavaScript without this looks like a better functional programming language. this losing context Methods are functions that are stored in objects. In order for a function to know on which object to...

Dynamic class definition in Python
Post

Dynamic class definition in Python

Here’s a neat Python trick you might just find useful one day. Let’s look at how you can dynamically define classes, and create instances of them as required. This trick makes use of Python’s object oriented programming (OOP) capabilities, so we’ll review those first. Classes and objects Python is an object-oriented language, meaning it lets you...

What to do when you need a web app quickly
Post

What to do when you need a web app quickly

Recently, I needed a piece of software where you can input some numbers, validate and process them, and print some result. Since I needed to do scientific computing with it I decided to use Python with NumPy and SciPyand because I needed validation I decided that HMTL input validations would be the easiest to use. Then I had...

Similar yet different. So confusing
Post

Similar yet different. So confusing

There are concepts which are very similar, yet different and confuses many people. Referential transparency vs immutability Referential transparency is a concept in a programming language which guarantees that once the value is assigned to the variable it will not changethere is no way to assign a different value to it. For example, in ES6 you...

Scalable React Components architecture
Post

Scalable React Components architecture

Originally posted at carloscuesta’s blog It’s been a while since I’ve started working with React and React-Native in production. One of the greatest things about React is the flexibility the library gives to you. Meaning that you are free to decide how do you want to implement almost every detail of your project for example the architecture and structure. However this freedom on the long term, could...

Coding Concepts! Cyclomatic Complexity
Post

Coding Concepts! Cyclomatic Complexity

Cyclomatic what? Even spell check doesn’t recognise the word, but it’s a super useful software metric for understanding how your software works. Having read about it a few years ago, it apparent use seems to have deteriorated. I feel it’s a very valuable tool in a developer’s arsenal, and something that should be used in...

Modern Functions in Python 3
Post

Modern Functions in Python 3

Python has thrived over the past few decades as the language which lets you work quickly and effectively. Like many modern companies, we use Python quite extensively for a majority of our stack, but in many cases, continue to live on Python 2.7. The harsh reality is that Python 2.7 is going away, and honestly — it’s about...

Homemade observables
Post

Homemade observables

On this episode we will build our own implementation of an observable. I hope that by the end of this post we gain a better understanding of this pattern that is used in libraries like RxJS. About Observables What is it? Lets start with my definition of observable. An Observable is a function that follows a convention...

Python Tricks 101🐍
Post

Python Tricks 101🐍

Python tips which are relatively uncommon and are very useful. Talk is cheap show me the code Swapping values Create a single string from all the elements in list Find The Most Frequent Value In A List. Checking if two words are anagrams Reverse a String Reverse a list Transpose 2d array Chained Comparison Chained function call Copying List Dictionary Get Sort Dictionary by Value...

Hands on with Python 3.7: what’s new in the latest release
Post

Hands on with Python 3.7: what’s new in the latest release

Used for general purpose programming, data science, website backends, GUIs, and pretty much everything else; the first programming language for many, and claimed to be the fastest growing in the world, is of course Python. The newest version 3.7.0 has just recently been released. Naturally any release of Python, no matter how small, undergoes meticulous planning...

Understanding JavaScript Iteration with C#
Post

Understanding JavaScript Iteration with C#

As I was chatting, someone from Coding Blocks slack channel (#javascript) has asked a question regarding a code snippet var uniqueInOrder = function (iterable) { return [].filter.call(iterable, (function (a, i) { return iterable[i – 1] !== a })); } view rawuniqueInOrder.js hosted with ❤ by GitHub His question was “Kinda lost in the [].filter.call , etc part.” I will show you...

Coding Concepts – Reflection
Post

Coding Concepts – Reflection

Reflection – What you need to know. In computer science, reflection is the ability of a computer program to examine, introspect, and modify its own structure and behavior at runtime.[1] So what does that mean? Reflection is a term thrown around every now and again and but do you really know what it means? Why...

Cool New Features in Python 3.7
Post

Cool New Features in Python 3.7

Table of Contents The breakpoint() Built-In Data Classes Customization of Module Attributes Typing Enhancements Timing Precision Other Pretty Cool Features The Order of Dictionaries Is Guaranteed “async” and “await” Are Keywords “asyncio” Face Lift Context Variables Importing Data Files With “importlib.resources“ Developer Tricks Optimizations So, Should I Upgrade? Python 3.7 is officially released! This new Python...

Looping through objects in JavaScript
Post

Looping through objects in JavaScript

Once in a while, you may need to loop through Objects in JavaScript. The only way to do so before ES6 is with a for...in loop. The problem with a for...in loop is that it iterates through properties in the Prototype chain. When you loop through an object with the for...inloop, you need to check if the property belongs to...

Why you shouldn’t reassign values in JavaScript
Post

Why you shouldn’t reassign values in JavaScript

In JavaScript, you can reassign values to variables you declared with let or var. I used to reassign values a lot. But as I got better with JavaScript, I realized you shouldn’t reassign values if you can. This is because: You may change external state by accident when you reassign values You create more complex code when you...

How To Review Code You Don’t Understand
Post

How To Review Code You Don’t Understand

I recently read an article by Max Bittker called “How to Review Code You Don’t Understand”, and it got me to thinking about times when I’ve been tasked with doing just that. One of the troubles I have with code review is understanding the context around a change. Given a diff, I can work through it...

Async programming basics every JS developer should know in 2018
Post

Async programming basics every JS developer should know in 2018

This article is aimed at people starting out with asynchronous coding in javascript so we would keep things simple by avoiding big words, arrow functions, template literals etc. Callbacks are one of the most used concepts of modern functional javascript and if you’ve ever used jQuery, chances are you’ve already used callbacks without even knowing...