Questions tagged [hardcode]

It is the development practice of writing data considered as configuration or input directly in source code.

Hardcoding is considered a bad practice, source code must be changed every time programmer want to change the hardcoded data. It is commonly used when writing programs that should accept user's input, to avoid complexity the programmer should prefer hardcode the input data in the source code instead handle real input.

153 questions
0
votes
1 answer

reactJS - How to get rid of hardcoded URL in home.js?

I have a reactJS application that downloads a report from a hardcoded URL specified in home.js. For testing purposes, I would like to make this a variable. How to do this? Here's the method in question: download() { // fake server request,…
Jack BeNimble
  • 35,733
  • 41
  • 130
  • 213
0
votes
3 answers

Is there a better way to hardcode shell script rather than a mix of cat and redirection?

I wanted to make a hardcoded script automatically run as root and I came across this: #!/bin/bash cat >/tmp/convert.sh <
user16869651
0
votes
1 answer

Symfony search form

I use symfony 1.4.12 with Zend Lucene. And I make custom search, I have field like category, country...I create module and I have MysearchSucess.php and there I write hardcode, like :