Five tips to make feedback your ally at work

Feedback is something people are often afraid of because it tends to only expose weak points that may make you feel intimidated and vulnerable. However, that’s a very old-fashioned point of view. Effective feedback is not only about providing a list of things that are wrong. Constructive and empathetic feedback brings new perspectives and a positive intent to highlight proven skills.  “What Good Feedback Really Looks Like” on the Harvard Business Review says: 

“Feedback — both positive and negative — is essential to helping managers enhance their best qualities and address their worst so they can excel at leading.”

Craig Chappelow and Cindy McCauley

We consider feedback to be a huge source of knowledge and an opportunity to improve. If you are having trouble giving or receiving feedback, here are 5 valuable recommendations we apply at Oktana

1. Consider feedback at every stage. 

Whether you are a senior manager or just beginning your career, requesting feedback should be always part of your planning. Why? Sometimes you are so in love with your projects that you tend to believe everything is going well. So you keep working with that perspective and when you finally realize something is wrong it’s usually too late or too expensive to fix it. You can be sure you are moving in the right direction by asking your teammates, boss, or partner for their perspectives on your progress. We do it all the time and trust us, the results are great. Plus, it creates a sense of ownership for the whole team. 

“Feedback is so important when we execute every single task. It measures the quality of your work. Besides, it helps me identify possible mistakes and improvements that will enhance our project.”

Zayli RodrÍguez, QA Analyst at Oktana Uruguay

2. Distinguish what is worth your attention 

Ok, let’s say you are following our previous recommendation and you are considering feedback as your projects progress. You are excited because your co-workers are giving you cool new inputs. Congratulations. That’s awesome! But what happens when you start noticing that some of the feedback you’re getting contradicts other feedback you’ve received? We know, it’s challenging. Everyone is bringing their own perspective to it and they aren’t always going to agree. You know yourself and your projects. That means you have the job of figuring out which feedback is the most relevant. Just make sure you’re not letting your bias guide which feedback you’re listening to.

3. Be truly positive

We love it when people are positive and enthusiastic, but if you lose your sense of reality it may not be easy to deliver value. When you are required to provide feedback for a project or a teammate, you have a huge chance in your hands to help them perform better. Don’t miss that opportunity by hiding your real thoughts because you’re afraid of a misunderstanding or you’re just trying to be polite. This is what constructive feedback is all about. Find the best way to convey your ideas in a way your partner truly feels that you actually want to improve things. Use your voice, regulate your tone, and use any resource you have so you help others focus on the solution, not the weakness. 

4. Actively listen to every client.

And by the client, we are not exclusively talking about your customers. We are also talking about internal co-workers. When you create a solution, you think about your final users, don’t you? So whatever you are doing, you make sure it makes sense for them. But you also collaborate with other teams within the company. Wouldn’t it be efficient to have a good idea of what they think of your project and your performance? Indeed, it is!  At Oktana, we use Slack, for staying always connected. We use channels to collaborate but when we need to get feedback, we know private conversations are the best place to do it. Activate every approach you have to get the feedback you need. Bruno Venturini, tells us how Slack helps him collaborate: 

“Slack allows us to communicate in an intuitive way with your team or co-workers. Besides, it’s also relevant for sharing ideas between developers and QAs to make our projects improve”

Bruno Venturini, Developer at Oktana Uruguay

5. Encourage others to give feedback

Create the conditions for an environment where feedback becomes one of the engines that drives excellence. Most visionary companies, either multinationals or startups, track feedback consistently. If you are part of one, get onboard and treasure that asset. If you feel your company doesn’t understand the value of constructive feedback, teach by example. Create simple spaces where people feel their opinion is taken into account. It doesn’t have to be sophisticated. Chats or phone calls also work. As soon as your co-workers notice you are performing better, they will want to copy your strategy and it will be easier for you to give/request feedback. 

So, these are our recommendations for any employee to make feedback their ally. We live it every day at Oktana, even more during the new environment this pandemic has brought (we have previously written an article about Communication and Remote Work that you may also want to read). Apply them in your daily routine and you will notice the difference in your performance. Also, If you want to see Salesforce’s approach, we encourage you to read the modules about the Culture of feedback and the importance of One-on-one Meetings. Have a good one!

Feedback

Get started with Salesforce Platform Developer I Certification

The Salesforce Certified Platform Developer I is probably one of the most important and complete certifications that Salesforce offers. Additionally, it is a prerequisite for many other certifications such as Dev II and it is the first step to becoming a System Architect. At Oktana we encourage our developers to achieve this certification in order to empower their Salesforce careers. It is an excellent asset to demonstrate to their peers and customers that they have the required skills to provide a successful project.

If you have already taken this certification, we recommend you to read our Salesforce Developer II Certification article.

For the purpose of this article, we have interviewed Bruno and Stefania, two new Oktana employees who completed this certification before starting to work with us. We’ll take a look at the certification description, prerequisites, and the exam itself.

Certification Audience Description:

Salesforce claims that this certification targets people who have “experience developing and deploying basic business logic and user interfaces using the programmatic capabilities of the Lightning Platform”.  Bruno and Stefania agree and extend the target audience of this report to “anyone willing to undertake a developer path in Salesforce”. 

Prerequisites: 

There are no official prerequisites for this certification. Salesforce claims that generally, people who undertake this certification have at least 2 years of experience as a developer and 6 months of experience on the Salesforce Lightning Platform. Our developers, on the other hand, believe that you can start preparing for this certification after only 4 weeks of experience with the Salesforce platform. 

About the exam:

The Salesforce Certified Platform Developer I exam has the following characteristics:  

Content: 60 multiple-choice questions + 5 non qualified 

Time: 110 minutes  

Pass mark: 65%  

Exams can either be taken online or onsite at a testing center.

No hard-copy or online materials may be referenced during the exam.  

Exam Outline:

The exam is structured around 6 main topics. These are: 

  1. Salesforce Fundamentals – Weighting 7%
  • Describe the tools and technologies that power development on the Salesforce platform.
  • Demonstrate expertise in working with Apex and Aura components.

 

  1. Data Modeling and Management – Weighting 13%
  • Give your data structure with objects, fields, and relationships.
  • Demonstrate expertise on how to import and export data in Salesforce.
  • Customize without writing code by using point-and-click logic

 

  1. Logic and Process Automation – Weighting 38%
  • Automate processes for every app, experience, and portal with declarative tools.
  • Use Apex to manipulate data 
  • Write Apex triggers to perform custom actions
  • Show expertise in search solutions

 

  1. User Interface – Weighting 25%
  • Use Visualforce to build custom user interfaces for mobile and web apps.
  • Build reusable, performant components that follow modern web standards using Salesforce Lightning Web Components

 

  1. Testing, debugging and deployment – Weighting 17%
  • Write robust code by executing Apex unit tests.
  • Describe the testing framework and requirements for deployment.  
  • Describe how to monitor and access various types of debug logs.  
  • Demonstrate expertise in capabilities and security implications 

 

Bruno and Stefania agreed that the most interesting thing about this certification was learning how to break with the “developer paradigm” of wanting to make all changes using lines of code. This certification teaches you how to customize your platform by using the tools provided by Salesforce. This allows you to work more efficiently and effectively!

Preparing for the exam:

 

It is highly recommended to complete the Salesforce Trailhead Trailmix “Prepare for Your Salesforce Platform Developer I Credential” before scheduling the exam. In there you will find almost everything you need to know to pass the exam and ensure you’re an expert in the area. Additionally, we encourage you to complete this Study for the Platform Developer I Exam Trail to review your knowledge and learn more about the exam itself. You can also choose to take a Trailhead Virtual Bootcamp for Platform Developer I certification. The 30-day course will teach you everything you need to know and includes a $200 USD voucher to sit for the exam. The price for the course starts at $450 USD and you can register by clicking here. Bruno recommends finishing all Trails related to this certification before starting to practice on Focus on Force, which provides study guides and practice exams.

At Oktana, after new employees complete their one-month onboarding process they are ready to sit for this exam. We provide all the resources mentioned above as well as exam mockups and additional tips to ensure success. 

Both of the developers we interviewed for this article think that this is a GREAT certification to have and would 100% recommend it to everyone working with Salesforce. What are you waiting for?

We are now hiring! Check out our open positions.

Footer Blog

 

How to prepare for Tableau Desktop Specialist Certification

Finding better ways to clean and organize your data is the key to making a good decision. Have you heard about Tableau? It’s a platform with a simple but very powerful mission: help people see and understand data. In this article, you will learn a bit more about this awesome platform, hear the perspective of one of our amazing developers, and understand more about the process to obtain the Tableau Desktop Specialist I certification.

What is Tableau? 

Tableau is a visual platform that transforms the way we use data to solve problems. It empowers people and organizations to make the most out of their data. 

Tableau was founded in 2003 as a result of a computer science project at Stanford that aimed to improve the flow of analysis and make data more accessible to people through visualization.

In 2019, Tableau was acquired by Salesforce, but its mission remains the same: to help people see and understand their data. Today, organizations everywhere—from non-profits to global enterprises, and across all industries and departments—are empowering their people with Tableau to drive change with data.

At its annual Tableau Conference (2020), Tableau Software shared plans to bring together Tableau and Salesforce’s Einstein Analytics, an artificial intelligence platform. By combining the best of Tableau and Einstein Analytics, customers now will have access to the broadest and deepest analytics platform on the market. Additionally, Einstein Analytics will be renamed to Tableau CRM, and will continue to provide the best analytics and AI experience in the Salesforce CRM workflow.

Tableau Desktop Specialist I: Fundamentals

At Oktana, we constantly motivate and provide our employees with all the necessary tools to train and obtain different certifications that will help them with their day-to-day tasks. In this case, we spoke with Juan, a Software Developer at Oktana. He was recently certified for Tableau Desktop I. Juan told us about its importance and how to prepare to pass the exam.

How is the exam?

  • Duration: 1 hour 
  • Questions: 30 (you pass the exam with a score of 70%)
  • To begin the exam, you sign up and connect to a call via Zoom with a Tableau specialist. This expert guides you through the exam. Minutes before starting, you need to show your ID and the surroundings of the place where you will be taking the exam.
  • All the questions are multiple-choice. You have to log in to Tableau and do the visualizations to find out which is the correct option.

The easiest and most difficult parts of the certification

Juan commented that Tableau is a very powerful tool. In a short time, you can create graphics that generate a strong impact. He recommends taking this certification because it doesn’t require much time to prepare for it. Also, it’s very easy to understand, and since it is focused on the world of data analysis, it doesn’t require programming.

The topics that he found a bit challenging to comprehend were dimensions, measures, and differentiating between continuous and discrete fields. Also, understanding how to connect data between two different spreadsheets before starting. Additionally, the calculated fields, which are perhaps the most mathematical and may require a bit of programming (but it is very simple).

Recommended Courses:

Juan took the courses recommended by the Oktana Training Team:

  1. Tableau 2020 A-Z: Learn data visualization through Tableau 2020 and create opportunities for you or key decision-makers. Discover data patterns such as customer purchase behavior, sales trends, or production bottlenecks. During this course, you will learn all of the features in Tableau that allow you to explore, experiment with, fix, prepare, and present data easily, quickly, and beautifully.
  2. Tableau 20 Advanced Training: Understand how to use Groups and Sets to increase your work efficiency 10x. Also, discover how to perform Analytics, Data Mining, create Animations, and much more.
  3. Tableau Specialist Certification Prep: This course has just one goal, prepare you to pass the Tableau Specialist exam. The course includes:
  • A downloadable study guide with notes and links
  • Information about taking the Specialist exam at home with a remote proctor
  • Videos covering the Specialist topic areas 
  • Three self-scoring full-length practice exams with a solution guide

Tips to achieve this certification

  • Don’t just watch the videos given to you on the exam prep, use them as an example and practice. In this way, you will have greater control over the platform. 
  • Practice with all the mockups you can before taking this certification (you will feel much more confident).
  • Although during the exam you have access to Google. You cannot use sites where you have to register and there is communication with an external person. Juan doesn’t recommend using Google at all because it slows down the tool and this can affect your final results.
  • Finally, If you don’t know the answer to a question, save it for last. It will save you time and let you focus on what you know best.

Should you take this Certification?

Definitely, yes! Companies like Amazon, Experian, and Unilever trust Tableau (business intelligence (BI) and analytics software) to explore, visualize, and securely share data in the form of workbooks and dashboards. 

As you can see, this tool is very user-friendly with drag-and-drop functionality. Tableau Desktop Specialist allows you to quickly clean, analyze, and visualize your team’s data.

for this reason, in less than 15 days you can learn how to navigate Tableau’s interface to connect and present data using easy-to-understand visualizations. By the end, you’ll have the skills to confidently explore Tableau and build impactful data dashboards. So dive in!

If you are interesting on reading more about certifications, click here.

5 ways to master remote work and improve communication

Remote work is here to stay. Period. The new normal is here and it demands a brand new perspective on communication. In this pandemic, one of the cornerstones that we must consider is social distance. That’s the reason why well working remotely is a skill we currently need to stay profitable and grow our businesses. This might be confusing for many, but it’s actually quite simple (and fun). There are companies that have been working with teams abroad and are working remotely with ease.

In other words, take some time to learn from the experts. Integrating teams in different countries to create IT solutions for our customers is something we at Oktana are very used to. Nara, from our Human Resources department in Paraguay, tells us more about her experience:

“[I believe] things haven’t changed a lot since I have always reported and worked remotely with co-workers from other countries even before the pandemic showed up. [Morover,] I think remote work has improved my performance because I save time in the traffic and even money that I used for transportation and food. Now I feel I have more energy and resources.”

Nara G. – Human Resources at Oktana Paraguay

Let us help you work remotely more wisely to increase your efficiency, improve work culture, and grow revenues.

Distance has nothing to do with meters or feet

This is our first and most important recommendation. Why? Because it’s not about distance. It’s about having the right state of mind. If you want to master remote work and enhance your communication skills, you have to let go of that idea of physical distance. Talented remote workers know their partners are always just a click away:

“[The new normal] impacted the way we communicate with our teammates. Now we need to find new ways to facilitate communication. However, Slack is that space where we can stay always connected and work more fluently”. 

Nery – Web developer at Oktana Paraguay

That’s the key. We know where to find our teammates, and especially, how to reach out to them in the most effective way. Here is a tip that you may want to consider in your routine: identify your partners and get to know them. If you didn’t have a chance before, schedule a 10-minute chat to introduce yourself now. Don’t talk about work, get to know the human behind the “co-worker.”

Be direct and clear

No one owns a crystal ball to see into your mind, so try to express yourself clearly. We understand, having a work conversation through a screen may feel weird in the very beginning. That feeling will vanish as long as you decide to take the leap and connect with your co-workers. Also, you will notice in every conversation that you will develop more concise messages.

Our recommendation? Remember, less is more! When having 1:1 chats related to work and professional arrangements, try to pull everything together in a way that is as simple as possible and provides what your co-worker needs.

In remote work, communication is key

You are safe working at home but still need to reach your co-workers. Before the pandemic you could just walk over and have a conversation. Not anymore. Now you have to leverage technology to manage your communication and collaboration. Make sure your team agrees on which channels to use. With Slack, our teams use Channels and Groups to adjust their conversations according to their needs. For example, Channels are great spaces for teamwork and let members message each other around a common matter, like a real-time group chat. On the other hand, Groups were designed to share posts and let people interact with them, like social media.

Tip: Remote work is not only about efficiency. It has to do with culture and collaboration. When managing your conversations always make sure everyone knows where to go, is able to participate, and every voice is heard.

Stay 100% tuned in

Ok, this is important and we would like to highlight it because most of us tend to take it for granted: notifications are crucial. We get it.  Your phone was full of notifications even before the pandemic. However, if you want to track your projects, having the right notifications is the best way to do it.  Remember, your team is not physically together; so an important matter or message will come to you in a push notification or desktop alert.

We use Slack notifications in our office to make sure we keep track and guess what? We never miss any details! Here is our tip: Be aware of which notifications you have turned on. Make sure they’re the right ones. Then, get used to answering them as soon as possible. It might sound obvious but trust us: it only takes seconds for a pending message notification to be forgotten.

Have fun!

Yes, productivity and hard work bring great results. We believe fun is also a crucial element to consider when it comes to business success. No team member or leader will reach peak efficiency if they are not working in a comfortable and pleasant environment. How can you contribute to creating a better culture while working remotely? Through communication, of course. Don’t let screens make your conversations boring.

Most messaging solutions include many features to make collaboration as much fun as possible. Use them! With Slack, we use emojis, gifs, snippets, polls, and other resources to express ourselves in every message.

If you have read this far, you now have a better understanding of what efficient communication means in remote work scenarios. Remember, the sense of distance is in your mind and you can adapt: always use efficient and clear communication, stay 100% connected, and make it a better place to work. Follow these recommendations and you will be all set!

For more information about how we strive to improve communication for our customers, take a look at our latest success stories. Also, if you need a general overview of Salesforce’s perspective, visit this trail. Now go back to your daily assignments and enhance your communication level across your company. Your teammates will notice the difference.

Our team is doing their best while working remotely. We have worked with different organizations and their projects. We are Salesforce platform experts and offer custom development to help you build your platform and solve the right problems. If you want to know more about our work, go check out customers reviews.

Heroku Scalability Simplified

What is Scalability?

Scalability is a general software concept. It means that a system is built in a way that can be easily grown in regards to usage (example: more people accessing a site) or adding new features to the site. It is the ability the software has to continue to properly function as its context changes.

In Heroku, it refers to the system being able to cope with more users or more traffic.

Heroku Scalability

Heroku provides easy-to-use tools that enable developers to scale dynos (Heroku app containers) instantly to meet demand. After an app is deployed, it may require adjustments in response to things like increased traffic, new functionalities, or business scale. You can scale using the Heroku Dashboard or Heroku CLI.

Heroku Dashboard:

The Heroku dashboard is the web user interface for Heroku’s core features and functionality. It enables programmers to manage their apps, add-ons, deployment processes, metrics, and much more. It provides a simple slider interface for scaling dynos and you see the results immediately reflected in your dyno formation.

Heroku CLI:

Developers can also oversee their dyno formation using the Heroku command-line interface (CLI). This allows you to create and manage apps from the shell of various operating systems. Through a simple command, you can enlarge the number of web and worker dynos, or change the dyno type of any number of dynos at once.

Scalability Resources

Scalability resources fall into two broad categories: horizontal and vertical. Additionally, Heroku offers a third type called autoscaling. 

Scaling horizontally: adding more dynos

Adding more dynos of a given dyno process type scales your application horizontally. For example, adding more web dynos lets Heroku route incoming HTTP requests across more running instances of your web servers, which will typically improve performance for a higher traffic volume. 

Also, adding more worker dynos allows your app to process more jobs in parallel and handle a larger volume of jobs. There are some cases where scaling horizontally won’t help, such as bottlenecks on the backend services and long requests or jobs.

Scaling vertically: upgrading to larger dynos

Upgrading dynos to larger dyno types will provide your app with more memory and CPU resources. 

All the dynos are isolated. But, apps running on Free, Hobby, and Standard dynos may share an essential compute instance —they are multi-tenant—and consequently may encounter some degree of performance variance. Performance dynos and those that run in Heroku Private Spaces do not share an underlying compute instance with other dynos, so they experience low variability in performance.

Autoscaling

Heroku enables you to automatically increase the number of web dynos needed to meet the specified 95% response time threshold. Based on your app’s existing throughput, the autoscaling feature removes the need to anticipate traffic spikes. Autoscaling is included for free on Performance and Private dynos.

Heroku makes it super easy for developers to scale any number of device integrations individually. Developers can simply provision more dynos to handle increased traffic coming in from a specific device.

If Autoscaling doesn’t cover your needs or is not working as expected for your apps, Heroku recommends trying the Rails Auto Scale add-on or Adept Scale add-on.

Scalability Simplified, with Examples

Horizontal Scalability

If you have a store that serves clients and you expect 10 clients at the time, you will hire 2 employees to provide customer service. Suddenly, your store becomes popular and 100 clients arrive at the same time. Those 2 employees won’t be enough to meet their needs. You will need to scale horizontally, employing more people to serve more clients. 

The store works like your app, website, mobile application, system, etc. The site was prepared for 10 users connected at the time working with 2 web dynos. Suddenly, your site has 100 users loading the site at the same time. To scale horizontally in Heroku, you can add more web dynos. The incoming HTTP requests can be linked to more clients arriving at the store, waiting to be served. 

If your store is a restaurant, the people serving the clients would be the waitress. However, restaurants not only can satisfy customer needs only with waitresses; there are also employees working behind the counter in the kitchen. Even if you hire 100 waitresses, if you have only one person cooking, that person won’t be able to cook for 100 people. You will need more people working in the kitchen. 

Kitchen employees are the worker dynos in Heroku, they are in charge of doing background jobs. If you have more, they can cook in parallel. The same happens with worker dynos

Vertical Scalability

Horizontal scalability might not always be enough. Continuing with the restaurant example, if the restaurant premises are too small, even if you hire 100 waitresses and 10 people in the kitchen, you won’t be able to fit enough tables. You will need to increase your capacity. You will need to scale vertically

Another example that can be related to Heroku would be if your chef only knows how to prepare juices or if your waitress only speaks one language. Those cooks won’t be able to add more things to your menu and that waitress won’t allow you to serve clients that speak other languages. In this case, the issue won’t be solved by adding more waitresses or cooks, you will need to employ people that have the skills that you need. In this case, you will need to scale vertically.

Autoscaling

So, what would happen if the demand in your restaurant is variable? 

It wouldn’t be cost-effective to pay 100 waitresses full-time. However, you will need employees who can be hired with short notice when more people arrive at the restaurant. You will need full-time employees and people you call in emergencies. This is what Heroku offers with its autoscaling system. Developers can set up 10 dynos, and add additional dynos when the response time is slow. When the workload increases, Heroku automatically provides the extra dynos needed to cope with the demand. Once the demand decreases, it automatically disables it, allowing you to save money. 

Heroku offers a practical step-by-step guide showing you how to scale your dyno formation easily. If you want to learn more about Heroku, click here, you will find useful information and three ways it enhances cloud infrastructure. 

The Simpsons, Legacy Code, and Maintainability for Salesforce Code

As soon as we start to code, we are taught many best practices, tricks, design patterns, and a huge “etc.” But it’s not until our first gray hair that we start to understand why all those best practices exist and why it’s important to apply them. I wanna write about my experience with legacy code and what worked for me with some examples. 

First, let’s discuss what legacy code is, and compare different degrees of code quality with one of the most famous and beloved families ever.

Legacy Code and The Simpsons

When we hear about legacy code, the first thing we think is “old code”. So let’s start our analysis with the oldest member of the family.

 Abraham Simpson (aka “Grandpa”)

Legacy sounds like something “old” that’s with us without us wanting it, just like the Simpsons family and Grandpa. He has aging problems (his memory is gone, he lost a kidney, he’s a little crazy…). He lives in a nursing home and his family tries to avoid him. For sure Grandpa is legacy code and any developer would prefer to resign rather than work on it. Grandpa is probably an old COBOL project the company avoids changing and migrating to newer technologies. The reason? Because it’s going to be really expensive and the entire business depends on it.

Homer J. Simpson

He is middle-aged. For some people he is old, for others, he is not (it depends how close in age the reader is). But he is dumb, he makes a lot of mistakes all the time. He drives under the influence, he is lazy and he has no idea what he’s doing at work and a BIG etc. He had some chapters where he tried to improve himself, but he wasn’t able to do it. If he were code, you wouldn’t be pleased to have to change it. I imagine Homer as a 15-year old Java application that is causing a lot of problems, but we are still trying to maintain it because we love it (because everyone loves Homer).

Bart Simpson

He is really young, 10 years old. He should be a nice kid who helps the elderly cross the street safely, but, he is always instead causing trouble for everyone. Marge needs to keep an eye on him every single second. If Bart is code, he is a React/Node.js/MongoDB application done by a startup with low budget and limited time to develop an MVP to secure an angel investor. He lacks testing, documentation, and has a lot of tech debt.

Lisa Simpson

Nice, smart, behaves well, never gets into trouble…in a few words, the daughter anyone would love. She tries to improve herself every single second. If Lisa were code, she would have a very good architecture, awesome code quality, comprehensive test suite, cool documentation, and good CI/CD. But there aren’t that many Lisas in the real world.

Marge Simpson

Finally, Marge, the mom of the family. She is some years younger than Homer. She tries to be good, support her family, and be a good citizen…but she has been in trouble, too. I would say she is the average project we work on. It has parts with good quality, parts with poor quality. Sometimes we make mistakes because of the coding quality and some tech debt that we have created knowing that we are going to pay a tax on it later.

So, what is legacy code?

In “Working Effectively with Legacy Code” (ISBN-9787111466253) Michael C. Feathers defines it as “code without a unit test.” I agree that code without “unit test” is legacy code, but I don’t consider that only having unit tests translates to your code being a modern “Lisa” program. I prefer to consider legacy code anything in which making any change is hard, costly, and risky because the maintainability is not high enough for different reasons that include: 

  1. Not having a comprehensive test suite
  2. Poor documentation
  3. Low code quality 

I am pretty sure that while you are reading this, more than one of you is writing legacy code because legacy does not mean “old.”

Maintainability 

According to IEEE, maintainability is:

“The ease with which a software system or component can be modified to correct faults, improve performance or other attributes, or adapt to a changing environment.” 

So let’s discuss some topics that can make our code more maintainable.

Automated Testing

This is a must. We cannot change anything with any degree of trust without having a good automated test suite to support us. 

Salesforce has a really good API to help developers with “unit testing” (the tests we mostly write in Salesforce are integration as we are interacting with a database instead of mocking it). Also, Salesforce requires us to have 75% of code coverage over all of the org to be able to promote to production, which is great…but is it enough?

For example, imagine you have this code:

 

 

This test passes, 100% code coverage. But another developer calls a new AccountCreator().insertNewAccount('') and the user sees an exception. Chances are the developer who created this class was doing test-driven development (TDD) but didn’t take time to think about the business restrictions (account name cannot be null or empty). There is no test checking that the code is doing this validation.

So having high code coverage is not enough, we have to make sure that we have covered all possible scenarios (happy paths, failures paths, border cases…all of them).

Documentation

We write code that lives for years and once in a while a person has to make a change. This person won’t be the same person as the one who coded it – even if they share the same ID number, phone number, or Instagram username, the programmer from the future probably has forgotten some aspect of the code. So we need some degree of documentation in our classes. 

I wanna discuss the two main types of in-code documentation. First, let me show one example:

 

Let’s try to fix this with some tools:

*doc documentation (ApexDoc in the case of Apex)

A bunch of tools exists that allows us to put some special comments before classes and method declarations which can be parsed to generate documentation automatically. And the good part, you have the documentation in the same place as the code. In ApexDoc, the comment has to start with the /** instead of the regular /* Apex comment block and we have some tags to indicate what we are writing. Here’s an example: 

  • @description: A high-level human-readable and understandable description of what the method is doing. I prefer to put an easily understandable and quick to read first line about what the method is doing. A really important detail that the developer needs to know about the method like if a web service is being used, I put that in the next line (but not going very deeply into implementation details).
  • @param: For each parameter, the method takes, we have to indicate the type, preconditions, and a description of what it is intended for.
  • @returns: The returning type and description (if the method is not void).
  • @throws: The exception it could throw and when it would do it.

The last topic about this is where the ApexDoc should be present. There are two approaches to this:

  1. Public classes and methods
  2. Every class and method

The main advantage of putting documentation in public classes and methods is that after we shared our code with the world, changing the contract we defined is not so simple (without breaking other people’s code) so we can be quite sure that the ApexDoc does not become obsolete (yes, we need to maintain the ApexDoc, too). 

I prefer to put it everywhere and be sure the comments get updated when there are changes in the methods because private methods are code, too. They deserve respect and we will need to read them anywhere. We need to be kind to the next developer changing this code (especially because the next one could be ourselves of the future and I don’t want to aggravate them).

So now we have all our methods documented and we can skip reading that long and hard method that the piece of code I am working on calls (we go into details if and only if we need it).

Comments on implementation code

When I started to study computer science, a professor told me that comments are very important. 

Well, I completely disagree with that idea in real life. 

Code has to be self-descriptive and if we need to put a comment in it, we must be sure there is nothing else we can do to make the code more understandable without the comment. A comment line in the code is a new code line that needs to be maintained and it took development time to put it there. It also cannot be tested, so the chances are the comment ends up saying something that the code is not doing. Read the code carefully and tell me if you could find any discrepancies. 

We will tackle how to reduce comment quantity shortly, but first check really good code comments here on Stack Overflow: Best Comments in Source Code You Have Ever Encountered

I really loved this one: 

//When I wrote this, only God and I understood what I was doing 

//Now, God only knows

Code Quality

This is the last topic I wanna cover today and I will only scratch the surface. In particular, I want to discuss how we can write our code to communicate with other developers in a way that is easier, faster, and clearer. Code should be self-explanatory and we should hide the implementation details until it is not possible to anymore. Ideally, our public method should be written as a declaration of the developer’s intentions and we leave the implementation details (the imperative part) to private methods (but we should not chain many private methods calls as it forces the developer to go forward and backward and is not optimal).

Let’s start with the method I showed you in the last section:

 

 

In this method, we find three different parts:

  1. Collect data from parameters 
  2. Do business logic
  3. Save and return the result (technically a method should do only one thing and do it well…this does two, but it is part of the trade-off we have to make in real life)

So let’s start with the first part:

 

 

  1. We see the comment is wrong and useless so we delete it.
  2. SOQL query is already declarative (the query has Salesforce best practices issues, but I do not want to focus on this right now), so we can’t hide any implementation details.
  3. We have some variable declarations:
    • accountScoresToReturn: This variable is self-explanatory: we are going to return this list.
    • accountNames: Ok, they are account names but which account names??
    • accountNameToId: Another good name, we know what we are going to store in it.
  4. We have an iteration: This is a candidate to split into another method. Unfortunately, we can’t do it without impacting the overall performance or quality (we can’t return two values in Apex, so we need two methods with two iterations or a function that returns a string and has side-effects of populating the map). But reading this block we start to figure out what accountNames is for. We concatenate the accountNames with “,” between them, but we find out that the variable accountName is not expressive enough so we are going to look in the code to figure out what it is.

Second block:

 

 

This block mainly does two things:

  1. It calls a webservice and parses the result
  2. It gets the higher score accounts

And there are plenty of implementation details.

First, we tackle the invocation of the service. It requires the account name string and returns the parsed JSON object. So, let’s split this other method: 

 

 

And our main method changes to: 

 

 

Let’s tackle the second part of the business logic. Before we do this, do not forget to run the complete test suite we have. The business logic iterates over the parsedJson object and selects those that score higher than 5. So we are going to split it into another method which takes parsedJson and returns the List of selected accounts: 

 

 

And our main method changes to:  

 

 

Finally, we have the part of the code that returns data. Most of the time this part just returns a value or insert for the database.

Conclusion

One of the most important attributes of the work we do is the maintainability of the code we write. We must ensure we are using all the tools we have to enable this. There are hundreds more topics and tools to cover regarding how to create maintainable code, but everything starts with the three points I covered here: 

  1. Automated testing
  2. Documentation
  3. Code quality

Don’t forget you are going to spend more time reading the code than actually writing it. So you should take the time necessary to make it easier to read.

Coming back to our friends, we have Maggie:

Maggie is just a baby, she is learning the world. Everything she learns can lead her to become Lisa or Homer, just as the project you are working on right now. So, I hope these recommendations help your project to become Lisa and not Homer (even though we still love him).

If you’ve made it this far, thanks for reading! Also, if want to read more about code, check our latest articles here.

How do we leverage the Salesforce ConnectApi to build Tok?

To understand the use of the Salesforce ConnectApi, first we need to talk about programming languages. Whether we are experts developers, tech geeks, or an average human being who owns a computer, most of us are, at some level, aware of programs. But, what exactly are they? Well, to keep it simple we will say they are a system of vocabulary and commands that allow humans to communicate with computers. For those who are not familiar with this environment, remember that computers think in binary. They speak in 1s and 0s, so programming languages help us translate our instructions into a language that computers will understand. 

Apex: Salesforce’s programming language.

At some point, you may hear about Java, JavaScript, Python. If you are more experienced, you may also know Ruby, C#, C++ or Swift. All of them are programming languages. Now, what is the scenario when it comes to Salesforce? Well, there is a specific and powerful programming language just for us named Apex. Salesforce created this language to allow developers to run and customize on-demand apps within Salesforce. Salesforce describes it as: 

“Apex is a strongly typed, object-oriented programming language that allows developers to execute flow and transaction control statements on the Lightning Platform server, in conjunction with calls to the API”.

So, how is Apex directly related to us? Well, we build our solutions inside Salesforce, therefore we use Apex as a programming language. Every time we create a product to enhance your experience in the Salesforce environment, we use Apex. That’s what we did for Tok, our app that boosts Chatter capabilities to the next level to ensure real-time communication to our customers. 

What is Chatter REST API?

Let us go a little bit deeper. Shortly after the release of Chatter, the Salesforce enterprise collaboration tool, Salesforce launched Chatter REST API with plenty of messaging features and better integration between third-parties apps and Salesforce through HTTP requests. This way, it would be easier for a group of users to be notified about events. Salesforce designed Chatter API to enhance data delivery and treatment, especially across mobile apps. This API is powerful enough to display a feed on an external system, such as an intranet site after users are authenticated. Salesforce also recommends other uses: 

“Use Chatter REST API to display Chatter feeds, users, groups, and followers, especially in mobile applications. Chatter REST API also provides programmatic access to files, recommendations, topics, notifications, Data.com purchasing, and more. Chatter REST API is similar to APIs offered by other companies with feeds, such as Facebook and Twitter, but it also exposes Salesforce features beyond Chatter.”

With the Summer ‘20 release, the company launched a new version under the name of Connect REST API (Connect REST API Developer Guide – version 49.0). If you explore the Salesforce’s Guide, you will also notice that there is a preview of the next release (winter ‘21 version 50.0). 

ConnectApi: How does Tok leverage Chatter REST API methods and classes?

As you can see, Salesforce built Chatter REST API to establish bridges between Chatter and other independent platforms. But what happens with applications or other solutions that were built on the Salesforce platform like Tok? How does Tok take advantage of all the methods and classes Chatter REST API provides? Well, even though Chatter REST API is a powerful tool, we don’t use it directly. Instead, we use ConnectApi. 

Since Tok uses APEX, Salesforce’s programming language, ConnectApi (also, Connect in APEX) is the best way to access Chatter REST API data and capabilities. It allows our developers to work with feeds, users, groups, messages, and other classes or methods. Salesforce summarizes the power of ConectApi: 

“[Use ConectApi to] create Apex pages that display feeds, post feed items with mentions and topics, and update user and group photos. Create triggers that update Chatter feeds. Many Connect REST API resource actions are exposed as static methods on Apex classes in the ConnectApi namespace. These methods use other ConnectApi classes to input and return information. We refer to the ConnectApi namespace as Connect in Apex.”

Now that you understand how ConnectApi helps us to build Tok, all you need to do is relax. So, take a seat in front of your computer, grab a cup of coffee and experience the way ConnectApi empowers your communications through Tok. If you like this information but you also feel you need to dive deeper, we recommend this article: How Our New App, Tok, Can Improve Business Communication.

Our developers are constantly working to take full advantage of any new version. Haven’t tried Tok yet? Install it here.

Tok 30 day trial

How to identify problems in your code with the Salesforce CLI Scanner

Ok, let see what the Salesforce CLI Scanner is and what it can do for us. The tool is a plugin that uses multiple code analysis engines in various languages (including Apex). It currently inspects your code using the PMD rule engine and ESLint, however, they have plans to add support for more rule engines in the future. 

This means that the tool will help you identify potential problems, from inconsistent naming to security vulnerabilities and alert you to these problems with easy to understand results. You can run the scanner on-command in the CLI, or integrate it into your CI/CD framework to enforce rules and expect high-quality code. And you can run it against every code change.

It’s like having a code review in real-time. Following some rules the Salesforce CLI Scanner can identify issues and show them to the developers as feedback to fix the code, saving a lot of time and money.

This tool can be used by ISVs and Salesforce developers to prepare for security review processes. It can improve code quality by identifying a variety of performance and security issues in the development stage. 

Another possible use is to integrate this tool with a CI/CD process to regularly monitor your code’s health.

Remember that the Salesforce CLI Scanner plugin works on all operating systems that Salesforce CLI supports. It has a one-step installation that is quite easy and fast, and if you are uncertain about the command-line commands, it has a built-in help (–help).

They have recently added new functionality that allows you to scan Salesforce Lightning Web Components using ESlint, and it’s amazing to have that.

These are some of the key features of Scanner v2.3, released in October 2020.

Static analysis

Static analysis, also called static code analysis, is a computer program method for debugging. It is done by examining the code without executing the program. The process provides an understanding of the code structure and can help ensure that the code adheres to best practices and doesn’t fall into common antipatterns and coding issues that will have a negative impact on the performance or quality of the code. Based on rules, the engine reports the suggestions for upgrading your code.

Of course, currently there are a lot of static analysis tools, but most of them work only with one or just a few sets of languages, and the most common in Salesforce packages is the use of a variety of components created in different languages. A single static analyzer is insufficient to take into account all the rules, patterns, best practices, etc. Working with multiple static analyzer tools can quickly become a headache.

To solve this, we recommend the Salesforce CLI Scanner plug-in. This plug-in shows the most relevant information to help Salesforce developers improve to the code while providing a unified experience. 

It has a single and easy installation process with an intuitive set of commands to interact with multiple rule engines. You can define a unified set of rules that are checked by their respective rule engines and also get a report that includes all issues identified by all the engines.

What is PMD?

PMD is a very powerful open-source static analyzer that supports many languages. Additionally, it has a large community of developers building rules for Apex. By default, Salesforce CLI Scanner supports code written in Apex, VisualForce, Java, JavaScript, and TypeScript but you can easily extend it to support any language.

Here at Oktana, we have a set of custom rules to improve our code quality and help everyone to have better-structured code.

What is ESlint?

ESlint is an open-source JavaScript linting utility for identifying and reporting on patterns, with the goal of making code more consistent and avoiding bugs. 

Because it’s very flexible in how it parses JavaScript, it can handle many use-cases related to Lightning Web Components. Additionally, with the built-in Eslint-typescript plugin, the Salesforce CLI Scanner can also analyze TypeScript out-of-the-box.

What does the Salesforce CLI Scanner do for me?

By combining two static scanners in one tool, the Salesforce CLI Scanner allows you to detect a wide variety of problems in your code.

Example Apex issues include:

  • Performance issues (e.g. running SOQL or SOSL queries inside loops).
  • Security issues (e.g. basic sharing violations, simplified CRUD/FLS checks, CSRF, and XSS vulnerabilities)
  • Not clear code (variable names, comments in classes and methods, avoid long, and complicated methods)
  • Error-prone code (e.g. empty try/catch/finally blocks)

Example issues with Lightning Web Components include:

  • Unreachable code
  • Unused variables
  • Invalid regular expressions
  • Stylistic preferences such as enforcing semi-colon at the end of a statement and expecting function names in camelcase

Catching these issues early has several advantages:

  • You can fix code issues immediately and rerun Salesforce CLI Scanner right away to confirm that the issues have been resolved, saving time.
  • Ensure the new developers are following the best practices, best patterns, and avoiding common issues.
  • You can shorten the security review processes. These processes are faster and easier when most issues are identified and fixed before the review even begins.

Different report formats

Salesforce CLI Scanner has an array of useful reporting formats for different uses:

  • Simple table-style reporting to get feedback on code you are actively writing
  • CSV reporting for spreadsheet-based filtering and analytics
  • JSON and XML reporting to feed into other tools for further processing
  • HTML reporting for readable, searchable results
  • JUnit-style test failures to use with a CI/CD setup

Conclusion

Salesforce CLI Scanner is a tool that is here to stay. It has a lot of  Salesforce engineers actively implementing new features to further improve it. 

An upcoming feature is the ability to detect and warn of external code dependencies that may have security vulnerabilities. They are also in the process of adding new rules to identify more security issues.

You can get started with Salesforce CLI Scanner within minutes by following this link to improve your code quality and save time.

What are you waiting for? Go ahead and give this amazing tool a try, and leave your comments about how your experience was!

Learn more from our team here, or check out our services.

Heroku: Simplify and improve your cloud infrastructure

Data plays an enormous role in the success of any organization. Collecting and quantifying pertinent information builds a stronger roadmap for growth. Because of this, companies are collecting and storing data to forecast future trends and develop action plans. That’s a lot of data to manage and most companies don’t have the right technology in place. This is where the cloud sweeps in to save the day. Cloud platforms enable companies to store large volumes of data to repurpose for business transactions. As a result, cloud infrastructure demand is growing for businesses of all sizes, as they have come to realize the massive benefits and potential of utilizing cloud components. Heroku is a first-class platform that helps developers scale more effectively.

What is Heroku?

 

Heroku is a platform as a service (PaaS) cloud that supports several programming languages and is part of the Salesforce Platform. Because it supports the most relevant programming languages used in the industry, it has become a popular tool for enhancing cloud infrastructure. Developers, teams, and businesses of all sizes use Heroku to deploy, manage, and scale apps. Using bi-directional synchronization, Heroku unifies the data in your Heroku data with your Salesforce CRM data. Additionally, Salesforce Trailhead was built and launched on Heroku. 

3 ways Heroku enhances cloud infrastructure:

 

  • Several Programming Languages: Initially, Heroku only supported Ruby on Rails. However, over the years it expanded to include other languages such as, Java, Node.js, Scala, Clojure, Python, PHP, and Go. The benefit here is the ability it provides users to create applications that are robust and versatile.

 

  • Rapid Delivery:  Developers are able to deploy their code to Heroku with a one-line command in the terminal. Having all the power of Amazon Web Services (AWS) in the background, but without having to take care of setting up its infrastructure. Heroku has it all covered for you!. Access to all of these resources and capabilities massively cuts down project time and allows developers to focus on creativity and higher-level work.

 

  • Scalable Functionality: Heroku allows developers to construct while not having to sacrifice impressive UI and effective application functionality. Heroku is able to accommodate spikes and dips in traffic without having to purchase more hardware. The system is able to cope with higher loads of users or more traffic reaching the system. 

 

As you can see, Heroku has many features that simplify and improve cloud infrastructure at a very granular level. By utilizing the Heroku platform, developers are able to build applications that are efficient, visually pleasing, and all at a fraction of the time and cost it would take to develop on other platforms. 

Oktana’s Experience 

 

Here at Oktana, we are avid users of the platform and always seek out the best technologies to leverage for our customers. We’ve used Heroku to develop a number of outstanding applications across several different industries. Among them, you can find a Leading Investment Firm, a Fintech Company, and MedZed

We’ve seen firsthand the kind of power Heroku brings to drastically improve application development. That’s why we’re extremely proud to announce that we’ve recently received a Specialization Badge for outstanding Heroku development from Salesforce! We’re super excited to be recognized for our expertise and it motivates us to develop even more applications with the platform. We think it’s a great tool and highly recommend it to developers who really want to extend cloud infrastructure to the next level.