I have recently been learning and using modern design using the c# language and learning c# and coded workflows in general. This has led me to doing Microsofts foundational c# course.
In the course they state when naming variables not to include the datatype i.e. str_firstName or strFirstName.
I was just wondering what the current best practices are as looking at the documentation I couldn’t find any info on prefixing.
I think It’s unnecessary to add type prefix basically. However, in UiPath (especially workflow), as type definition is separated from designer panel, it may be allowed to add prefix for improving readability, in some organization.
If its string datatype and username strUsername (these are called camelcase formatting ) and if it’s int datatype and may be used for Numbers then it is intNumber
So it’s variables datatypes first (str,int,bool etc) and then the actual name (username, password,email etc)
For datatable I would use dtTable or dtSourcetable based on the excel data.
For arguments put in_username(for in argument) ,out_username(for out argument) , in_out_username(for in/out arguments)
Meaningful names should be assigned to workflow files, activities, arguments, and variables in order to accurately describe their usage throughout the project.
Projects should have meaningful descriptions, as they are also displayed in the Orchestrator user interface and might help in multi-user environments.
To improve readability, variable and argument names should also align to a naming convention:
Snake case: First1_Name2, first_name2,
Upper or lower Camel case: FirstName, lastName,
Pascal case: First1Name2, First1Name,
Kebab case: First-Name, First-Name1.
Argument names should have a prefix stating the argument type, such as in_DefaultTimeout, in_FileName, out_TextResult, io_RetryNumber.
Activity names should concisely reflect the action taken, such as Click the Save Button. Keep the part of the title that describes the action (Click, Type Into, Element Exists, etc.).
Except for Main, all workflow names should contain the verb describing what the workflow does, such as GetTransactionData, ProcessTransaction, TakeScreenshot.