Easy JavaScript Part 10: Class in JavaScript?

See the original posting on DZone Python

ECMAScript 6 introduced the class keyword to create classes in JavaScript. Now, you can just use the class attribute to create a class in JavaScript. Before ECMA 6, whenever you called a function using a new operator, the function returned a new object. Therefore, the function was acting as a class and known as a constructor. This way of calling a function to return an object is also known as the Constructor Invocation Pattern.

But in ECMAScript 6, a class can be created using the class keyword. Consider the code below:

Easier Error Handling Using Async/Await

See the original posting on DZone Python

At work, someone asked if there were any better ways to handle errors when using the async/await syntax in JavaScript. They didn’t like their beautiful, short, and readable lines of code suddenly wrapped with try/catches. I’ve also been frustrated with a variety of the enthusiasm online the past couple years around async/await only to be shown code examples that completely ignore error handling.

Below is an easier way to handle errors using async/await by returning what’s known in Functional Programming as an Either. Mine isn’t as formal as the FP community’s "left right." It’s just simple a JavaScript object that follows the Node callback naming convention somewhat.

Painful Varnish Mistakes

See the original posting on DZone Python

This post was initially titled "Top 6 Varnish mistakes," to echo Espen’s blog. Even though his material is three years old, the content is still relevant. Plus, there’s a healthy colleague competition going on here, and I can’t just mimic Espen if I hope to beat him, so I had to do something different. Instead, I’m going to compete on brutality: this post isn’t about explaining the most common mistakes, but rather the ones that can really kill your service, one way or another. I know it sounds a bit scary, and it is, but that’s for your own good, really. So buckle up, and let’s see what I have in my Little Shop of Errors.

thread_pool_add_delay

If your installation started with Varnish 4.0+ AND you followed Espen’s advice to not trust everything you read on the interwebz, you are probably safe. On the other hand, if your installation was migrated from Varnish 3.0, have a very careful look at your Varnish command line and search for thread_pool_add_delay. More lazily, if

Using Kotlin With Ktor to Create Web Apps

See the original posting on DZone Python

This article is featured in the new DZone Guide to Web Development. Get your free copy for more insightful articles, industry statistics, and more!

When Google made Kotlin an official language for Android a few months ago at Google I/O, the language quickly gained a lot of popularity in the Android world. On the server side though, Kotlin is not as broadly adopted, and some people still seem to be cautious when backend services are involved. Other developers are convinced that Kotlin is mature enough and can safely be used for any server application in which Java could play a role otherwise.

Five Reasons Why You Should Use a Git-Based CMS (Part 3 of 5)

See the original posting on DZone Python

Most CMS technologies are what we would call a "coupled CMS." The content authoring and content delivery environments are usually part of the same stack. The act of "going live" with new content or a feature is essentially based on the act of marking a true/false in a database field. There are a lot of problems with coupled CMS platforms around security, performance, scalability, and flexibility (you can learn more here.)

For these reasons and many others, Crafter CMS is built as a decoupled CMS. With a decoupled CMS you author content in one system and publish to another separate system. For platforms like Crafter CMS that are decoupled, when correctly implemented, the architecture provides great solutions for the issues mentioned above. That said, nothing is without its challenges. Decoupled systems, by their nature, are typically very scalable and can have many instances all over the world. Security, scalability, and distribution are no longer issues that only concern the Internet’s biggest players like Google and Amazon. Security and distribution impact customer experience, safety and help reduce operating costs. Every brand-conscious and customer-forward organization in the world is focused on these tactical issues.

Building Your First Crystal Web App, Part 1

See the original posting on DZone Python

In this article, we will cover building your first web application in Crystal. The application will utilize JSON Web Tokens (JWTs) to authenticate our users around the restricted resources of our app. The completed sample application can be found in this GitHub repo. I’d encourage you to check out the repo to follow, alongside this tutorial.

I wrote a technical article back in June titled "The Highs & Lows of Crystal." It was an introduction to the Crystal Language and an overview of my perspective on it, trying it out for the first time. I enjoyed trying out Crystal very much and the good news is that Crystal is still on the up, and more than ever people are trying it out, and finding that they really rather like it (just as I do!).

How to Grow 3D Game Development Skills With Blender 3D

See the original posting on DZone Python

Animation has changed and grown drastically over the years. While it has evolved in terms of drawing, technology does have a large part to play in it. Old characters were required to be hand-drawn frame by frame, a larger version of the flipbook if you must. These days there are computers and animation software to help you not only create the characters but also animate them.

With the different programs, you can now create 2D and even 3D characters with a few clicks. So, if you don’t have any background in drawing or sketching, that’s okay too. Simply create your characters with different polygons and shape them as you see fit.

Best Practices for Building Universal Web Applications with Sencha Ext JS and RAD Server [Webinar]

See the original posting on DZone Python

Historically, web developers have approached app development from the desktop first, and mobile was a secondary goal. Now with the extraordinary growth of mobile users across the globe, that approach is being reversed.

Developers are building mobile first, and then making progressive enhancements so the app is available on desktop. No matter the design approach, as developers we should always think universal!

Five Best Practices to Ensure Stellar Website Introduction

See the original posting on DZone Python

This article is featured in the new DZone Guide to Web Development. Get your free copy for more insightful articles, industry statistics, and more!

People have been creating websites for the longest time. Some may say “HTML is HTML.” Well, not exactly: websites are now rendered on many different types of devices, browsers, form factors, etc. New technologies enable HTML5 to offer content and services according to the user’s context (location, time, etc.). At the same time, development cycles accelerate and Sprints are shrinking as organizations adopt Agile practices. This article will offer best practices to improve team efficiency and deliver high-quality products while maintaining velocity and a competitive edge.

Different Ways of Creating a List of Objects in C#

See the original posting on DZone Python

It has always been fun to play with C#. In this post, we will see that how we can create a list of objects with a different approach. So the scenario is, for one of my MVC applications I need to bind the 5 empty rows (a list of 5 objects) to the kendo grid for a bulk insert of the records. So whenever I open that page, kendo grid renders 5 empty rows in editable mode.

In this post, for a better illustration, I have used the example of "Book." Let’s say I want to add multiple books to one library management software. First, let’s create one basic POCO class – Book – with some properties, which looks like the following:

A View to Vue.js

See the original posting on DZone Python

This article is featured in the new DZone Guide to Web Development. Get your free copy for more insightful articles, industry statistics, and more!

If you’re like me, you’ve likely been bombarded over the past few years by Angular and React content. Every other blog entry, conference session, or keynote seemed to be focused on either of the two. With that context in mind, I can still remember the first time I saw a “Vue.js” talk listed on a conference schedule. While I certainly do not pretend to know everything, at least when it comes to buzzwords and the such, I was pretty sure I had heard of most of the popular front-end frameworks out there and this was one I had decidedly not heard of.

Using TypeScript With Redux

See the original posting on DZone Python

This article is featured in the new DZone Guide to Web Development. Get your free copy for more insightful articles, industry statistics, and more!

Redux is a library that provides a way to manage application state in one place. Not every application needs help with this, but for many applications, it can simplify access to this global state without causing incidental complexity by restricting the ways it can be updated and accessed.

Testing Your Frontend Code: Part III (E2E Testing)

See the original posting on DZone Python

A while ago, a friend of mine, who is just beginning to explore the wonderful world of frontend development, asked me how to start testing her application. Over the phone. I told her that, obviously, I can’t do it over the phone as there is so much to learn about this subject. I promised to send her links to guide her along the way.

And so I sat down on my computer and googled the subject. I found lots of links, which I sent her, but was dissatisfied with the depth of what they were discussing. I could not find a comprehensive guide — from the point of view of a frontend newbie — to testing frontend applications. I could not find a guide that discusses both the theory and the practice and is oriented towards testing frontend applications.

4 AJAX Patterns for Vue.js Apps

See the original posting on DZone Python

If you ask two Vue.js developers "what’s the best way to use AJAX in an app?" you’ll get three different opinions.

Vue doesn’t provide an official way of implementing AJAX, and there are a number of different design patterns that may be used effectively. Each comes with its own pros and cons and should be judged based on the requirements. You may even use several simultaneously!

eCommerce 101

See the original posting on DZone Python

What is e-commerce? E-commerce involves commercial transactions conducted electronically through the internet, to make it simpler, let’s call it online shopping. As developers, we need to know how e-commerce works. To put it in a simple context, it’s like our good old friend, client-server architecture. It is a customer-store relationship.

Customers can browse the store’s online catalog using the web or a mobile app, compare prices, product variants, and sales then add products as they like to their cart and check out. In this checkout process, the customer fills out a form that tells the store which address to use for shipping and which address to bill to then make their payment using an accepted payment method. Sounds simple, doesn’t it?

1 2 3 4 5 92