What is hard coding in scripting

Yasin Shaik11
Tera Contributor

Hi All,

 

I want to know what is hard coding in scripting. Could you please give me different examples. And if our code is hard coded what is the problem.?  And how to avoid using hard coding.

 

Thanks in advance 🙂 

1 ACCEPTED SOLUTION

under 'value' field.

 

Please Mark Correct/helpful, if applicable, Thanks!! 
Regards
Sulabh Garg 

Please Mark Correct/helpful, if applicable, Thanks!!
Regards
Sulabh Garg

View solution in original post

6 REPLIES 6

Yousaf
Giga Sage

Hi Umar,

Please check these articles.

Hard-coded strings are bad, mmmkay

Hardcoded Sys ID's Could Be A Security Issue

Mark Correct or Helpful if it helps.


***Mark Correct or Helpful if it helps.***

Community Alums
Not applicable

Hello,

Consider the below example of adding two numbers.

var a = 2;

var b = 2

var c = a+b;

If you access a value from a variable or from other places then it's not hardcoded. but if use c = 2+2; then its hardcoded one

Hope you got this.