5 Misconceptions Web Developers Believe About Mobile App Development

Mobile apps have emerged as a competitive alternative to websites. Although websites are still irreplaceable parts of digital presence for business brands, mobile apps have been forcing them to change. The emergence of Progressive Web Apps (PWA) showcases this shift.

In spite of this overwhelming popularity of mobile apps, many web developers still hesitate to improve their skills and extend their focus on mobile app development. What misconceptions the web developers mostly harbor regarding app development? Well, this is what we are going to explain here.

Continue reading

Catching FileNotFoundError? Watch Out!

In Python, FileNotFoundError is an exception that is raised when a requested file does not exist. Many people assume that when their programs fail to open a file in read-only mode or delete a file, FileNotFoundError must be raised and they should only need to process that. For example, some people would write code similar to:

def process_file(path):
    import sys

    try:
        f = open(path, 'r')  # or os.remove(path)
    except FileNotFoundError as e:
        print(f"File {path} not found!", file=sys.stderr)
        return
    # process the file...

However, this code may actually trigger unexpected errors. The reason is that, the failure to open a file in read-only mode or delete a file is not necessarily caused by the non-existence of the file. Very often, it's for different reasons: insufficient permission, or the file is a directory. In this case, PermissionError or IsADirectoryError would be thrown instead of FileNotFoundError. So, in the example above, one would want to catch all of them:

Continue reading

What Is Mobile App Architecture? — Key Considerations to Build Great App Architecture

For any business, while building a mobile app it is the priority to create apps for reaching their target audience with ease and optimize the app for this specific audience. But among the millions of apps that populate the Play Store and iOS App Store, perhaps only a few thousand can claim to be perfect in terms of user experience and unique value proposition: Many of the vast majority of apps that just fill up app marketplaces without contributing any substantial value is made up of less reliable architecture. Hence we are here to explain what mobile app architecture does, different types of app architecture and the ways to build them.

Continue reading

Learning Casting in Java

Last updated on August 25, 2020

One of the most renowned programming languages at present is Java. Furthermore, Java application development continues to be a lucrative source of income for many people who are into the tech industry. The language is used to create web platforms and web apps, designed for flexibility, which enables developers to write code that runs on any machine, whatever the platform or architecture may be. Billions of computers and mobile phones throughout the world run Java.

What is Java Casting?

Casting, a process of creating a variable as a variable to another type. Software and app developers are aware of the rapid pace of industry requirements. Nonetheless, some instruments continue to remain significant even in times of regularly fluctuating trends. Undoubtedly, Java is the best choice nowadays for software programmers and developers for many reasons.
With Java casting, if a class shares an IS-A or an inheritance relationship with another interface or class, the variables could be cast to the type of each other. There are times that the cast is permitted and at times not allowed. This is because some of the cast won’t show any error at compilation time but would fail during runtime.

Continue reading

Makefile Template for a Shared Library in C (with Explanations)

tl;dr: Save the following file as Makefile and change the source files to the ones that you intend.

# Makefile template for a shared library in C
# https://www.topbug.net/blog/2019/10/28/makefile-template-for-a-shared-library-in-c-with-explanations/

CC = gcc  # C compiler
CFLAGS = -fPIC -Wall -Wextra -O2 -g  # C flags
LDFLAGS = -shared   # linking flags
RM = rm -f   # rm command
TARGET_LIB = libtarget.so  # target lib

SRCS = main.c src1.c src2.c  # source files
OBJS = $(SRCS:.c=.o)

.PHONY: all
all: ${TARGET_LIB}

$(TARGET_LIB): $(OBJS)
	$(CC) ${LDFLAGS} -o $@ $^

$(SRCS:.c=.d):%.d:%.c
	$(CC) $(CFLAGS) -MM $< >$@

include $(SRCS:.c=.d)

.PHONY: clean
clean:
	-${RM} ${TARGET_LIB} ${OBJS} $(SRCS:.c=.d)

The above code snippet is also available on GitHub gist.

Continue reading