Originally posted on infoworld. Treating computing infrastructure as code is the smart and modern way to provision software in the cloud. Here’s what it is and why it’s better. As more and more organizations move to the cloud, the skill of knowing how to provision and configure a physical server is becoming less relevant to how...
Tag: code
11 Useful Python One-Liners You Must Know
Originally posted on makeuseof. Python One-Liners can help you perform complex tasks with just one line of Python code. Here are some of the most useful ones to know! Python is known for its short and clear syntax. Due to the simplicity of Python, it’s sometimes referred to as “executable pseudocode”. You can make Python...
Why every developer should be using TDD
Originally posted on dev. Introduction No skill is more important for programmers than the ability to write code that works. But all too often, developers don’t think about whether their code will work until it’s finished, and by then they’ve already created many bugs that are difficult or impossible to fix. That’s why every developer...
5 ways for Data Scientists to Code Efficiently in Python
Originally posted on analyticsvidhya. Introduction Writing a code is like a piece of art and in this article, I am going to share some tips and tricks for Data Scientists and Python enthusiasts who want to write better and cleaner codes. I personally also use these coding techniques in my life and they have improved...
What are low-code databases?
Originally posted on venturebeat. Low-code databases are tools designed with simple user interfaces that can be used successfully even by those without any background in programming. They’re in strong demand because of the boom in low-code development. More and more new products are opening up opportunities for non-programmers through well-designed and simplified interfaces. The term...
Learning to code? Why going fast might mean going wrong
Originally posted on techrepublic. Aspiring coders might be tempted to blast their way through tutorials so they can grab that all-important interview. But success may lie in playing the long game. It’s only natural of us to try to learn something new as quickly as possible if the end goal is a better job, or...
Structured concurrency in Python with AnyIO
Originally posted on mattwestcott. How to improve your spaghetti asyncio code By now you might be familiar with the term ‘structured concurrency’. It’s a way to write concurrent programs that’s easier than manually taking care of the lifespan of concurrent tasks. The best overview is Notes on structured concurrency by Nathaniel Smith (or his video if you prefer). This post...
Make Your Python Code Fluent
Originally posted on towardsdatascience. With Function and Operator Overloading Overloading in Python allows us to define functions and operators that behave in different ways depending on parameters or operands used. Operator Overloading As an example, we can use “+” operator to do arithmetic calculations on numerical values while the same “+” operator concatenates two strings when strings operands used. This is called operator overloading and it...
Dictionary union operators and new string methods in Python 3.9
Originally posted on towardsdatascience. New features that can simplify your data processing code — what are they and what do they improve? Python 3.9 has accumulated a lengthy list of improvements with some pretty significant changes such as a new type of parser. The new PEG parser takes a little more memory but is a little faster and...
How to Profile Your Code in Python
Originally posted on towardsdatascience. Finding bottlenecks and optimizing performance using cProfile If you’ve ever written a line of code (or even tens of thousands of lines), you’ve surely wondered “Why does my code take so long to run?” Answering that question isn’t always simple, but it can be easier if you search for answers the...
Jupyter is now a full-fledged IDE
Originally posted on towardsdatascience Literate programming is now a reality through nbdev and the new visual debugger for Jupyter. Notebooks have always been a tool for incremental development of software ideas. Data scientists use Jupyter to journal their work, explore and experiment with novel algorithms, quickly sketch new approaches and immediately observe the outcomes. However,...
Every VS Code extension a JavaScript web developer should have in 2020
Originally posted on dev Visual Studio Code is a powerful editor out of the box, but there are many many VS Code extensions to make it even more powerful! If you’re new to VS Code or coding in general, I recommend reading through everything here to see if there are new ways you can optimize your workflow....
Keeping your code clean by sweeping out “if” statements
Originally posted on dev One of the most common things I see around that I think makes code more difficult to read is the overuse of “if” statements. It’s one of the first programming tools we learn, and it is usually when we learn that the computer can do pretty much anything we like, “if”...
How to combine multiple CSV files with 8 lines of code
Why do you need this? Manually copy-pasting is fine if you don’t have too many files to work with. But imagine if you have 100+ files to concatenate — are you willing to do it manually? Doing this repetitively is tedious and error-prone. If all the files have the same table structure (same headers & number of columns),...
Callbacks & Promises in Javascript
Javascript is a single threaded asynchronous language. What does that mean? It means it cannot multi-task, but can pause execution of one task to do something else and switch back and forth between tasks so as to maximise performance. It makes sense because javascript is a browser language, and browsers need to make network calls...
Python Pro Tip: Start using Python defaultdict and Counter in place of dictionary
How you could use defaultdict and Counter to make your code short and readable Learning a language is easy. Whenever I start with a new language, I focus on a few things in below order, and it is a breeze to get started with writing code in any language. Operators and Data Types: +,-,int,float,str Conditional statements: if,else,case,switch...
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...
Going beyond just a programming language
In computer science, it seems that everybody is focusing on the programming language that the teacher or department chooses – be it Java, C#, Ruby or Python. Deciding upon a programming language to teach is only one step, however. The next question is – how do we gain confidence within ourselves to learn this language, in...
5 ways static code analysis can save you
If you’re not doing static code analysis (aka static analysis), now is the time to start. Delivering code faster has dubious value if the quality degrades as development cycles shrink. On the other hand, if you’re not doing static code analysis, you’re not alone. Despite the mature age of the tool category, not a lot...
How to Inspect a Collection of Objects in Javascript with console.table
Learn how to inspect an array or object of objects with console.table in the browser. When building software in JavaScript, I often need to inspect an array of objects or object of objects. One of my favorite methods for achieving this is to use console.table(). Rather than having to toggle open nested objects that are of...