Postingan

Menampilkan postingan dengan label programming

Google Dart Hello World Example - A Java Like Programming Language to Create Web, Android, and iOS Applications

Gambar
Google Datt is a general-purpose programming language from Google and used to build web applications, mobile applications, and the Internet of Things (IOT).  It's most popular application is in Flutter framework, which is Google's mobile app SDK for crafting high-quality native interfaces on iOS and Android in record time. If you haven't tried it yet then it's a good time to try it and see how much it offers to a programmer and whether it is suitable language to replace JavaScript or not. As a Java Programmer, my first impression of Google dart is great. It looks quite familiar with Java my favorite programming language and this motivates me to write this hello-world example in Google Dart and execute it, run it and see how it works. Similar to Java, Google dart also has Class and Object, it has a final keyword, String Class, Object class, extends keyword and many more I going to learn but it really looks structure because it has google dart compiler which shows a war...

20 Java and Programming Quotes to Motivate Yourself

Gambar
I always have a strong interest in knowing great peoples of my field like software development and programming. Knowing about them, following them, and reading about them not only gives you immense knowledge but also the motivation ,you need to excel in whatever you are doing. It's the motivation, not knowledge that will propel your career. Knowledge is almost useless without motivation because just knowing is not enough, you need to apply that knowledge, and without motivation, you just can't do that. There are times when programmers also feeling tired and bored. These are the times when you spent hours constantly looking at the computer screen, clicking here and there, surfing the net without doing anything. That's the total waste of time and it's the result of poor motivation. If you are motivated then you will constantly work towardsimproving your code, writing more unit tests, creating better documentation and spending some time retrospecting, how could you have do...

How to Remove all Unused imports in a Java file - Eclipse Shortcut

Gambar
How to remove all unused imports in Eclipse Eclipse IDE gives warning "The import XXX is never used" whenever it detects unused import in a Java source file and shows a yellow underline. Though unused import in Java file does not create any harm , it's unnecessary increase length and size of Java source file and if you have too many unused imports in your Java source file, those yellow underline and Eclipse warning affect readability and working. In my last post on Eclipse, we have seen some Java debugging tips on Eclipse and in this post, we will see Eclipse shortcut to remove all unused imports in Eclipse. There are many options to tackle this problem e.g. you can collapse import section of code in Eclipse or you can altogether remove all unused imports from Java file, and we'll see them in this short tutorial. If you are completely new to Eclipse IDE, then I suggest you to first go through a comprehensive course likeThe Eclipse Guided Tour - Part 1 and 2 from Pl...

Does Standard Column Width of 80 On Coding Make Sense in 2019?

Gambar
One of the oldest coding practice is to keep line width 80, and many of us follow it blindly but have you ever thought why we have this practice in first place? I believe it was to make your code more readable in the age of small monitors so that whole content can fit in the screen, or it might have originated from the age of punch card, which was used to be 80 column wide. This sounds reasonable when we think about those old days but do you think this rule makes sense in 2019? We are now living in the age where most of the developers have got large monitors, which can show up-to 180 characters, doesn't this is wastage of precious monitor space? It also makes your code unnecessary long, then it actually is. I first come to know about line wrapping at 80, while reading Oracle Code Conventions for the Java Programming Language, which was last revised at April 20, 1999, which under indentation says 4.1 Line Length Avoid lines longer than 80 characters, since they're not handled we...

Linux Command to Find how Long a process is Running in UNIX

Gambar
Hello guys, today, I am going to share one of the useful tips to find out how long a particular process is running in Linux. This is very useful while you are troubleshooting an issue and want to know whether your process or service is restarted fine on a daily or weekly basis. So you checked your process is running in Linux operating system and it's running fine, by using ps command. But now you want to know, from how long process is running , what is the start date of that process etc. Unfortunately, PS command in Linux or any UNIX based operating system doesn't provide that information. But as said, UNIX or Linux has commands for almost everything and if there is no command, you can also check some important files in the /etc directory to find out some useful info. It’s been a long time, I have posted any UNIX or Linux command tutorial, after sharing some UNIX productivity tips. Hence, I am going to share this nice little tip, which you can use to check how long a particular...

Strategy Design Pattern in Java using Enum - Tutorial Example

Gambar
Hello guys, how are you doing? I hope you all are fine and doing good in your life and career. Today, I am going to talk about the Strategy pattern, one of the useful design and coding pattern which will help you to write flexible code. The code which can withstand the test of time in Production. I'll also teach you how you can use Enum to implement the Strategy design pattern and Open Closed design principle better in Java. I have said this before that Java Enum is very versatile and can do lot more than you normally expect from it. We have seen a lot of examples of Enum in my earlier posts like writing thread-safe Singleton using Enum and 10 ways to use Enum in Java. In this article, we will learn a new way to use Enum, for implementing the Strategy design pattern. Strategy pattern is one of the famous pattern, which takes advantage of polymorphism, to remove switch cases and strive for the open-closed design principle. Formally it encapsulates related algorithm, known as strateg...

How to share your Programming Articles on Javarevisited for more Exposure

Gambar
Hello, Friends, I have been writing Java articles for a long time and one thing I have learned from that experience is that learning makes you a better Programmer and Software developer. It's also one of the important tips I have shared on how to become a better programmer article long back. It seems many people like that and contacted me about that but their main difficulty was that after writing one or two articles they get frustrated because no one was reading it. Well, I can understand but it takes a lot of time and effort to build a following. I am fortunate and really grateful that Java community has given me so much love and that's why I have decided to do my bit to promote and encourage every new Java programmer/writer/blogger to the best I can. Do you want to write a blog post on Java and Programming but worried about who will read your articles? Well, not anymore.  I have created a medium publication for Javarevisited, where not only myself but all of you can write. M...

Top 5 Free Git Courses for Programmers to Learn Online - Best of Lot

Gambar
One of my goals in 2018 is to learn and master Git and I have been searching for some good tutorials and courses to start with. The Internet is full of git tutorials and a simple Google search will leave you thousands of tutorials but the big question mark is where do you start? It's easy to pick a tutorial or a blog post if you have some background about what is Git, what it does? and how to use it but if you don't have much background then you need a course which can tell you all the information from the ground up. I personally like learning from a book or an online course before moving to blog posts as they were often well structured. When you search for Git courses in popular online course websites like Udemy, Pluralsight or Coursera, you will find some good courses like Git Complete: The Definitive Guide on Udemy and Git Fundamentals from Pluralsight which will teach you everything about Git step by step. These are excellent resources to start with Git. But, some program...

Amazon Prime Day 2019 - Best Tech Deals - What Programmers and Tech People Can Buy?

Gambar
Many of my friends and colleagues used to wait until November to buy books, gadgets, and other computer items to get the huge discount offered on Black Friday and Cyber Monday deals, but you don't need to wait that long. Amazon is bringing Black Friday to the summer with their annual Prime Day offers. The Amazon Prime day is nothing but a one-day (precisely one and half-day and this time full two-day) shopping extravaganza, where you will get huge discounts on thousands of Amazon products including books, games, gadgets, and other computer and electronics items. So, if you are looking to buy a new laptop, a new smartphone or some fitness gadgets and watch than this is an awesome opportunity. You will get many such gadgets at a much cheaper price on Amazon prime day. The only caveat is that in order to get the full discount, you'll need to be an Amazon Prime member , which cost around  $12.99 per month or $119 per year, which is not costly as you will save much more because of e...

Top 6 Books to Learn and Master Programming and Coding - Must Read, Best of Lot

Gambar
Coding is an integral part of Programming, and we all somehow learned to code by following examples here and there. Yes, I am talking about both self-taught programmer and Computer Science Graduates. You can learn Coding easily if you are dedicated, but what is more difficult is to write good code. You can easily find programmers in Java, C++, Ruby or Python, but finding programmers, who are also a good coder is very difficult. Some universities have a good curriculum and practical classes to teach coding better than others, but most of these great coders are self-taught Programmers, who learned by reading books, joining online courses and doing things on their own. The point is self-learning is VERY important in the field of Programming and Coding, you just cannot rely on your college and university to make you an expert programmer, you have to make that extra effort to distinguish yourself from the group and what could be better than by learning coding and wisdom of programming from ...

Why Every Programmer or Blogger Should Teach Online and Create Courses

Gambar
I often receive queries like should programmers create an alternative source of income, or should programmers create their own blog or website? Both are fundamental questions, and there was a time when I advise programmers to create their own blog, not just to learn and improve their understanding of the technology they know, but also to earn money while doing things you love, but time has changed. Now I advise Programmers and Software Developers to create and sell online courses onTeachable, Thinkific,Udemy, or any other platforms. The reasons are still the same, you learn and earn, but the method has been changed. A blog is always an excellent way to establish yourself online, but it requires a lot more effort and time to earn something meaningful. On the other hand, an online course will create an alternative course of income very quickly. I know many people who are making a decent income by creating and selling an online course like my dear friend Eugen Paraschiv, whose Spring Cour...

Clean Code by Uncle Bob - Book Review - Must read for Software Engineers

Gambar
Even though the Clean Code book was released many years ago and there are lots of good reviews already available, I couldn't resist to write my own experience of this great book. I came across this book many years ago, but since then, I have read it multiple times, and I have recommended it to my readers, students, and fellow developers. It is one of those books which make you feel that why didn't you come across it earlier, I felt the same when I first learned about this book. The Clean Code is all about writing good quality code, and how do you judge the quality of code? Well, you won't appreciate good until you have seen bad code and that's what this book does. It first presents a code, which is ugly, hard to read, hard to understand, hard to maintain and then Uncle Bob goes step by step to refactor that code and converting them into the masterpiece you would be proud of writing. You will get a taste of how to convert a bad code to good code when you first read his ...

How to implement Binary Search in Java without Recursion - Iterative algorithm

Gambar
This week’s task is to implement a binary search in Java, you need to write both iterative and recursive binary search algorithm. In computer science, a binary search or half-interval search is a divide and conquer algorithm which locates the position of an item in a sorted array. Binary search works by comparing an input value to the middle element of the array. The comparison determines whether the element equals the input, less than the input or greater. When the element being compared to equals the input the search stops and typically returns the position of the element. If the element is not equal to the input then a comparison is made to determine whether the input is less than or greater than the element. Depending on which it is the algorithm then starts over but only searching the top or a bottom subset of the array's elements. If the input is not located within the array the algorithm will usually output a unique value indicating this. Binary search algorithms typically ...

How to implement Command Design Pattern in Java with Example

Gambar
Hello guys, it's been a long since I have shared a Java design pattern tutorial. I did share some courses to learn design patterns but haven't really talked about a particular design pattern in depth. So, today, we'll learn one of the important design pattern, which is often overlooked by Java developers. Yes, I am talking about the Command Pattern which can help you write flexible, loosely coupled code for implementing actions and events in your application. In simple words, the command design pattern is used to separate a request for an action from the object which actually performs the action. This decoupling between Invoker and Receiver object provides a uniform way to perform different types of actions. This decoupling is achieved using a Command object, which is usually an interface with methods like execute(). The Requestor or Invoker only knows about Command object and doesn't care about the actual object which processes the request, which can be different. Thi...