Never miss a Switch Case with TypeScript

Switch statements are sometimes considered a code smell, but when they do make sense to use, you’d better make sure you don’t forget a single case. Luckily, TypeScript can help.

In this article, I won’t discuss the reasons why you should avoid switch statements in your applications (e.g., they may easily violate the DRY and Open/Closed principles, may introduce subtle bugs if you forget a break, etc) . It is pretty widely known that switch statements often leads to code that isn’t SOLID.
I also won’t explain the alternatives to writing switch statements (e.g., the strategy pattern, the command pattern, higher-order functions, etc).
Instead, I’ll assume that you know what you’re doing and that the switch statement is a good solution for your use case.
I’ll show you how to leverage TypeScript’s never type to ensure that you did cover all the possible cases, for instance when using a switch against an enumeration.

#typescript #web-development #javascript

What is GEEK

Buddha Community

Never miss a Switch Case with TypeScript

Never miss a Switch Case with TypeScript

Switch statements are sometimes considered a code smell, but when they do make sense to use, you’d better make sure you don’t forget a single case. Luckily, TypeScript can help.

In this article, I won’t discuss the reasons why you should avoid switch statements in your applications (e.g., they may easily violate the DRY and Open/Closed principles, may introduce subtle bugs if you forget a break, etc) . It is pretty widely known that switch statements often leads to code that isn’t SOLID.
I also won’t explain the alternatives to writing switch statements (e.g., the strategy pattern, the command pattern, higher-order functions, etc).
Instead, I’ll assume that you know what you’re doing and that the switch statement is a good solution for your use case.
I’ll show you how to leverage TypeScript’s never type to ensure that you did cover all the possible cases, for instance when using a switch against an enumeration.

#typescript #web-development #javascript

Cayla  Erdman

Cayla Erdman

1601549700

What’s New In Typescript 4.0?

Today I am going to talk about new features in Typescript 4.0.

TypeScript 4.0 comes with lots of new features to make JavaScript development easier.

Labeled Tuple Elements

You can label tuple elements.

You can write:

type Range = [start: number, end: number];

to restrict args to have a string and a number.

you can also write:

type Foo = [first: number, second?: string, ...rest: any[]];

to have rest entries in your tuple.

If your tuple has type Foo, then the tuple starts with a number and a string.

Then the rest of the entries can be anything.

Labels don’t require you to name your variables differently when destructuring.

For example, if you have:

function foo(x: [first: string, second: number]) {
  const [a, b] = x;
}

then you can name the destructured variables anything you want.

#software-development #typescript-with-react #typescript #typescript-4 #react native

Shardul Bhatt

Shardul Bhatt

1620797149

Python for Freight Forwarding: Proven Case Study for Logistics Company

Python is a popular web development language for enterprise and customer-centric applications. It is one of the top programming languages, according to TIOBE’s index. It has applications in web development, Machine Learning, Data Science, and other domains. The versatility of Python web development makes it the perfect language for applications in every project.

Amidst the hundreds of languages for web application development, Python stands out. It is powerful, scalable, and easy-to-learn. Python’s capabilities are useful in every sector — technology, FinTechHealthTechfreight forwarding industry, and more. The core functionality of Python takes care of all the programming tasks for every feature that needs to be added.

In this article, we will focus on the major aspects of Python that make it suitable for web applications of all kinds. We will then highlight the proficiency of Python using a proven case study that Python developers at BoTree have built. It is a freight forwarding software for international logistics service provider that uses Python in the main technology stack.

Checkout Top 10 real-world Python Use Cases and Applications

Let’s look at the case study and capabilities of Python in detail.

Why choose Python for Web Development

Python is now the first choice for web development, Unlike Ruby on Rails, it offers more flexibility in the process, Here are a few reasons why companies should choose Python for web development -

  • Readable: Python has an easily readable syntax. It is similar to the english language. Python developers admire the programming language as it is easy to read, write, and understand. You don’t have to write additional code to express concepts with ease. The emphasis on code readability, which enables you to maintain and update the code.
  • Multi-programming paradigms: Like all the other object-oriented and open-source programming languages, Python supports multi-programming paradigms. There’s a dynamic type system and automatic memory management. It simplifies the process of building large and complex enterprise scale applications.
  • Scalable: Python is highly scalable. Because of its in-built capabilities to minimize the errors during the development process, it is perfect for freight forwarding software solutions that require processing bills at a huge scale. It is also suitable for enterprise dashboards and other applications that need to handle massive server requests at once.
  • Versatile: Python is a heavily versatile programming language. It has diverse applications in various domains, including statistical analysis, numerical computations, data analytics and more. Companies can use it for web development or Machine Learning applications. Today, Python plays a crucial role in building data science models and intelligent algorithms.
  • Library
    One of the biggest reasons to choose Python is because of its library set. Python has libraries for almost everything — there’s TensorFlow, Selenium, Apache Spark, Requests, Theano, Py Torch and many more. The libraries enable adding functionalities and features, simplifying the process of building high-quality web applications.

Checkout Top Python Libraries for Data Science to use in 2020

As Python grows in popularity, its community also grows. There are more developers than any other programming language. They provide support for different development problems, support, and training for multiple projects.

Let’s look at a proven case study by BoTree Technologies that showcases Python’s capabilities in web development.

Python: Proven Case Study of a Logistics Company

At BoTree, we use Python development services for building dynamic web applications. Today we will discuss a case study on the freight forwarding services industry. We developed it using Python and other technologies. Let’s understand it better.

About the Case Study

We designed the freight forwarding software for a leading international logistics services provider. The system we created would collect the information from different freight forwarding websites using bill of lading or the container number. The information is then entered into the centralized system automatically for better management of the freight.

The main challenge was the manual processing of bills of lading. The information had to be gathered from a large number of websites. Each website had hundreds and thousands of bills. The manual process was lengthy and time-consuming. Because the freight forwarding companies were based out of different geographical locations, the client also faced language barriers while processing the B/L.

Our Technology Stack

The technology stack to add freight forwarding features was simple and powerful. We used Python, Postgresql, AWS SQS, EC2m, Puppeteer and Virtual Private Cloud. We offered web development, software testing, and continuous support and maintenance.

The technology stack we used was focused on simplifying the complications in the freight forwarding system. Because the solution had to be scalable, Python was the probably choice for building the web application.

Our Solution

We built a fully server-les architecture. It performs the mapping of the websites and analyzes the different fields for assessing the required details in freight forwarding.

The solution parses data from different websites and matches the fields with the required information. It also takes into account previously parsed data for making the decision.

The collected information is structurally arranged into a format. The entire data system is then pushed back to a centralized ERP system. All the data is accumulated at a single place, making it easier to process the B/L without any hassle.

The freight forwarding solution consisted of the following features built using Python -

Core Features

  • B/L Processing: The system could easily parse 15000 B/L in a single day.
  • Efficiency delivery: The process became efficient by 30% for processing the B/L.
  • Activity log maintenance: There’s a proper record of all the records that take place in the system.
  • Multiple languages: The freight forwarding software could easily parse B/L in different languages.

Conclusion

Python is a powerful programming language for enterprise-grade applications. Logistics companies heavily benefit from investing in freight forwarding solutions. Shipping systems are essential for managing the timely delivery of products and services. An internal system for B/L processing can enable you to reap the benefits of swift deliveries.

BoTree Technologies is a custom software development company that has Python experts who can build quality applications for enterprises. We have experience in the logistics, healthcare, fintech, education, and multiple other industries.

Connect with us today for a FREE CONSULTATION in the next 24 hours!

Originally published at https://www.botreetechnologies.com on May 11, 2021.

#python case study for logistics company #b/l processing system #freight forwarding case study #logistics case study #case study for logistics company #python web development

Ashish parmar

Ashish parmar

1614668427

Case Study on Mobile app Giffi - Prismetric

Giffi is a mobile application that provides multiple services to the customer like deliveries of food, grocery, liquor, pet food, flower, parcel, and any eCommerce purchasable items.

Client Requirement

User should be able to get the service like deliveries of food, grocery, liquor, pet food, flower, parcel and also eCommerce platform through the single mobile application.
Users should able to pay for the delivery, track, and get the delivery item successfully.
The merchant should able to register, choose the appropriate category for the service, list out the product/item and receive order/delivery requests.
The driver should able to register, choose the delivery category, get the delivery request automatically, and deliver the item/product from merchant location to customer location.
The application should support multiple languages.

Giffi User App features and functionalities

Users can see the various merchant & product details from each and individual categories like food, grocery, liquor, pet food, flower, parcel delivery, and eCommerce platform
Users can choose the delivery type, search & filter the product/item. Also view details of the product, order product, and pay through the mobile application
Manage shopping cart details, order details, and manage the returns of the orders
Able to request home delivery or take away the order
Chat with the merchant
Track the order status and driver on the map with ETA
Provide the rating and review to the driver and merchant
Manage profile information, delivery address, and settings

Giffi Merchant App features and functionalities

Register into the panel by choosing the category of the business from delivering food, grocery, liquor, pet food, flower, parcel or eCommerce platform
Merchant can manage the product listing and offer & discount details
Merchant can view and manage the e-wallet and transaction history
Merchant can chat with the users
Merchant can management the orders
Merchant can receive rating and review from the user
Manage merchant profile and other settings

Giffi Driver App features and functionalities

Register into the application by choosing the category from deliveries of food, grocery, liquor, pet food, flowers, parcel or eCommerce. Or through personal information and vehicle information
Drivers can manage the availability status - online and offline.
Drivers receive the delivery request from the customer automatically.
Manage the delivery request and delivery of the items/products from the merchant’s location to customer’s location
Driver can receive the rating and review from the customer
Driver can view and manage the e-wallet and transaction history
Driver can chat with the customer
Manage driver profile and other settings

The Solution we provided

Technical Specification & Implementation
Android: Android Studio with Java
iOS: XCode with Swift
Web panel: PHP with the Codeigniter Framework
Challenge
It was quite a challenging task to manage the complete application architecture as it involved multiple categories for the services and assigning them to an appropriate driver. From the perspective of the UI/UX design, it was tricky as well. It has been managed in such a way that it does not make it difficult to interact with the mobile application; the navigation is made easier for each user type.

Solution

We successfully developed & implemented the mobile application (Android & iOS) for the customer & driver and web panel for the merchant. Through mobile app, a customer can order product from service like deliveries of food, grocery, liquor, pet food, flower, parcel and also eCommerce platform through single mobile application.
Link for Play Store Giffi User App
Link for App Store Giffi User App
Link for Play Store Giffi Courier App
Link for App Store Giffi Courier App

Continue Reading: https://www.prismetric.com/work/giffi/

#case #mobile-app-case-study #app-case-study #mobile-app-development-company #app-development

Ashish parmar

Ashish parmar

1604480711

Case study on mobile app; DreamG

Dream-G application will allow user to chat, voice calls and video calls to random people through the mobile application. The User can create a profile and perform all these actions in addition to searching for a person using their name.

Client Requirement
The client came with the requirement of developing a unique mobile application for users to chat with others and make voice and video calls. Furthermore, the user should be able to subscribe to the plan by paying a certain amount.

App Features and Functionalities
The User can see the list of the people and able to view the profile of a particular person and able to chat, voice call, and video call.
The user can see the list of entertainers and can chat, Voice call and Video call them.
User can search for any person by entering the name.
Through the chat option, the user can see the past history of the chat with all the users. The user can also open any chat and again send messages.
The user can see the profile details and able to edit or modify the profile photo, name, and other details. The user can see the call log details.
The user can see the number of coins available with them and through these coins, the user will able to make voice and video calls.
The user can purchase the plan listed in the application according to the requirements, and will be able to chat with the people.
The User can refer the mobile application to other people and earn rewarding coins.

Challenges
To create a unique user experience for the Chat, Voice, and Video Calls.

Technical Specification & Implementation
Integration with the payment Gateway
Android: Android Studio with Java
Solution
We successfully developed and implemented the Dream-G mobile application through which the user will able to chat, voice call, and video call to other people. The user will also be able to purchase the subscription plan and refer the application to other people.

Read more: https://www.prismetric.com/work/dreamg-app/

#case #study #case-study-on-mobile-app #mobile-app-case-study