I agree, you should stick it out, assuming the following:
1) Your scholarship is likely, at most, for 4 years/ 8 semesters/ 12 trimesters
2) To graduate in a major you need, say 48 credits in that major. To graduate you need 160 credits. To graduate, you need (for example) 12 credits of writing, 8 credits of math, 8 credits of science, 12 credits of foreign language, etc. that aren't in your major, and some "elective" credits from neither a specific category or your major.
A W on your transcript isn't too bad, but people might ask about it. A B in a computer science course on your transcript is probably good. People might not ask. Also, you can use this experience in an interview situation. "When I was a freshman still figuring things out I took this class. It was hard for these reasons, and I realized I wasn't interested. But I worked hard, studied, persevered, and now I know some basic programing." Employers like to hear these stories.
If you drop it, and therefore drop from a 16 credit semester, to a 12 credit semester, some later semester you are going to have to take an "extra" class to make up for it, and might hurt yourself then. Or, you have to take an extra semester in the summer or after your 4 years, and pay for it.
If this class meets a "gen ed" requirement, it is even more important you keep it. In that case, you are going to have to take some other "science" class to meet the requirement. In this class you know you can get a B. In that later class the professor might be less forgiving and the class might be just as challenging or boring.