Feb
3
2022
From time to time I need to compare one programming language against another, or see the popularity between multiple frameworks. When comparing between programming topics, I use Google Trends and Stack Overflow Insights to see overall trends.
In a related post, I covered the 2021 Developer Trends across multiple sources and surveys.
no comments | tags: frameworks, javascript, Tools, trends | posted in Programming, Team
Dec
29
2021
It’s that time of year… when Stack Overflow puts out the results of their latest developer survey. Other companies have similar surveys, like JetBrains. Instead of surveying users and developers, GitHub analyzed repositories and commits. If interested to compare notes, check out the top 2021 developer languages, tools, and trends here…
no comments | tags: developer survey, devops, github, gitlab, software, trends, year in review | posted in Programming
Mar
10
2020
There isn’t a standard log format that spans all applications. There is a Common Log Format used by web servers, and there are logging frameworks that helps in the mechanics of producing logs. Unfortunately when it comes to composing the actual message that will be written out to log files the developer is left to his own devices.
Here are some best practices that I’ve found useful when adding logs to an application I’ve working on.
- Each log event should be written to a single line.
- Each log event should start with an event timestamp, preferably in UTC.
- Include the log level in the log line.
- Add a short description about the event that is being logged.
- Included all pertinent data about the event in name=”value” pairs.
- Quote all data values.
- Use and log a transaction id as requests move through your applications.
- Be consistent about field names used across applications.
- Add a prefix to the field name to add context, for example for input or output data.
- Mask out passwords, credit cards, and any other Personal Customer Information (PCI) data.
- The log file name should include the application identifier and hostname.
- Log files should be rotated out based on time and/or size.
no comments | tags: log4j, logs, logstash, splunk | posted in Programming, Rant, Team
Feb
4
2020
During the summer, our team usually hires an intern. We find that the interns we hire are more than capable with the technical requirements but usually need some help on process. In order to help new team members adapt our process we’ve developed a number of useful checklists of some best practices. Here are some useful checklist to go through when working on new features.
Ticket Checklist
- Add clear and concise title and description
- Add reproducible steps
- Use realistic sample data
- Add specific acceptance criteria
- Add related tickets
Code Checklist
- Create your own feature branch
- Check code into your branch often
- Merge from master often
- Run test suites on your own branch
- Add and update test cases
- And and update wiki documentation
- Add comments to ticket
New Project Checklist
- Source
- Git Repository
- Dependency Management
- readme.md
- Wiki documentation
- Design Diagram
- API Documentation
- Common Configuration
- AWS Permissions
- Technical Specifications
- Sample log output
- Sample Splunk queries
- Splunk friendly logs
- Splunk Dashboards
- Splunk Alerts
- Test Cases
- Release Management
- Bamboo Plan
- Ansible Playbook
- Package
no comments | tags: docker, git, intern, maven, software development, Tools, unit testing, wiki | posted in Java, JavaScript, Programming, Startup, Team
Jan
8
2020
Homebew is convenient package manager for the OS X. Once you install Homebrew on your Mac, you can then easily intall and uninstall tools, libraries, and applications through the brew command. The brew command accepts an install and unistall option, as well as list option that prints all currently installed applications.
You can install an application through a brew formula. There is a plathora of homebrew formulae.
The following homebrew formulae are the ones that I’ve found most useful as a software developer.
Best Homebrew Formulae
- brew install mysql
- brew install awscli
- brew install sqlite
- brew install groovy
- Installs Groovy scripting language
- brew install jq
- Installs jq command to process JSON content
- brew install jo
- Installs jo command to generate JSON content
- brew install bats
- Installs test framework for Bash scripts
- brew install wget
- Installs wget command to fetch HTTP content
- brew install markdown
- Installs text-to-HTML converter
- brew install hugo
- Installs hugo static site generator
no comments | tags: awscli, brew, groovy, hugo, mysql | posted in Mac, Programming, Tools
Jan
6
2020
Every Java application has some sort of bean or Plain Old Java Object (POJO) to hold and manage state. Because of good Object Oriented Programming (OOP) principles we encapsulate field access with getter and setter methods. Most modern IDEs allow you to quickly create getters and getters. You can often find a Generate option under the Code menu from your favorite IDE. But generating getters and setters produces a lot of unnecessary boilerplate code.
With Project Lombok, you can reduce all that boilerplate getter and setter code with a few annotations.
The following bit of code will produce a Java class with the necessary getters and setters to access all the defined fields.
package com.juixe.core.pojo;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
@ToString @EqualsAndHashCode
@Getter @Setter
public class Person {
private Long id;
private String firstName;
private String lastName;
}
Given the Person class above, you can start coding the following.
Person p = new Person();
p.setFirstName("Boingo");
p.setLastName("API");
p.setId(1000l);
The getter and setter methods are added to the bytecode for the Person class by Project Lombok through the annotations. If you remove one of the annotations, like the @Setter annotation, then the setters methods will be deleted.
We just saw how a few annotation can generate getters, setters, equals, hashCode, and toString methods for simple Java classes. If you want all these methods generated for you, automatically, you can just use the @Data annotation like the following.
package com.juixe.core.pojo;
import lombok.Data;
@Data
public class Person {
private Long id;
private String firstName;
private String lastName;
}
There is also a @Value annotation that is similar to @Data except that it is intended for immutable objects, so it doesn’t generate any setter methods.
no comments | tags: bytecode, code generation, lombok, oop, pojo | posted in Java, Programming, TechKnow