Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
programming in the field?
i just finished my degree in computer science. we did project only using hardcode and a few visual studio .net.
so my question is, once you get a career job, is it really a bunch of hardcoding still? or is it mainly blueprints and copy-paste stuff? maybe drag and drop with .net? i don't know anyone personally who works the job, so I'm reaching out on here.
1 Answer
- EddieJLv 710 months agoFavorite Answer
What is your definition of hardcode? I define it as data that is in the program code rather than being read from a file.
if (age >= 18) status = "adult";
Here, 18, and "adult" are hardcoded. If the program needed to be used in another country where a different age is used, and, perhaps, a different term for adult, then the actual code would need to be modified. It's better to have a configuration file for things like that.
However, many programs are quick and dirty, so hardcoding is used.
Meanwhile, programmers do what needs to be done to get the program written. We might not be copying and pasting from other places, but if we've done something in the past, we're likely to reuse the same code to do the same thing.
And, using the first example, even if we're going to do some hardcoding, we might have a subroutine:
string classify (int age, int adultAge, string adultTerm, string childTerm) {
if (age >= adultAge) status = adultTerm;
else status = childTerm;
return status;
}
And then the hardcoding is in the call:
If (country == "USA") classify (ageEntered, 18, "adult", "child");
else if (country == "XZY") classify (ageEntered, 21, "major", "minor");