Simple Programming Languages Encourage Bad Programs

Reading the JavaScriptSucks page got me thinking about this; there seems to be an attitude that making a programming language accessible is bad, because it allows non-programmers to write programs, the general result being BadCode.

I've been through University (B.Sc. ComputerScience, University of Southampton), and had all the formal training, and now I work as a code monkey, but long before I ever had any formal instruction, I was playing around writing BASIC on my ZX Spectrum. Would I have ever become a programmer had I not had a simple introduction? Would anyone?

The general point is that we shouldn't be all elitist, but should remember that we probably all wrote bad code once, and we probably all wrote annoying code once:

	10 PRINT "Rob is a Doofus"
	20 GOTO 10
-- LeonGierat?

 > NEW
 > 10 PRINT "You are a pig
 > 20 RUN
 > RUN
 Syntax error at line 10.
I asked Mum why my program didn't work. She said the computer didn't want to run my program because it was rude, but even when I was 6 years old I knew there must be another reason...

SchemeLanguage is a really simple language that many people think doesn't suck.

Disagree strongly. I've worked in CeePlusPlus, DelphiLanguage and JavaLanguage. C++ is the least simple of the 3. When I had to work on other people's code, the Java code was the neatest, followed by Delphi. C++ suffered the most from dirty hacks, big methods etc... I don't work in C++ anymore.

I don't know Delphi, but although Java is neat, for someone to be able to write anything in it, they need to understand a bit about the language first. Most ScriptingLanguages allow a developer to write very sloppy code (terminate line in ';' or not, your choice. Declare variables or not, your choice, etc). This makes it very accessible to a programming newbie, as they don't need to worry about bothersome things such as structure and consistency. Throw in a feature rich environment (i.e., a browser, filesystem or something) and all of a sudden you've given a beginner the power to do wonderful or horrible things.

I think maybe Simple was the wrong adjective. Maybe 'Accessible' would be better. -- LeonGierat?

I would think this applies to all ProgrammingLanguages. All languages will have a subset that one might regard as "simple" or "accessible".

Rules to define good/bad/ugly are very hard to write, because to some extent we are talking about the QualityWithoutaName.

We can LearnTheHardWay?. For example, find out exactly why is GotoConsideredHarmful by writing some SpaghettiCode. This requires one to LearnWhileDoing?.

We can also learn from the mistakes and experience of others, but perhaps there is a larger risk of picking up CargoCultProgramming habits? How much respect would you have for someone who said, "I never use GoTo because I've been told it's bad."?

These things make me think that it's more to do with the way you learn. -- MatthewAstley

Re: "Most ScriptingLanguages allow a developer to write very sloppy code (terminate line in ';' or not, your choice. Declare variables or not, your choice, etc)."

IMO, the SemiColon thing is a flaw of the language. It should either use semi's or not use semi's. BTW, didn't EiffelLanguage also make semicolons optional? Eiffel is hardly a "scripting language". Personally I hate semicolons, but don't want to start that battle here again.

Personally, I like scripting (or DynamicallyTyped) languages. However, I agree that some are potentially more "abusable" than others. But the flip side is that they are often easier to fix because there is less formality to shuffle around. Or perhaps easier to rewrite the bad sections.

I suspect this topic will degenerate into a HolyWar about StaticTyping versus DynamicTyping languages, but I could be wrong.

But perhaps there is a trade-off between languages that I myself like to use versus languages I would want to maintain other's code in, especially if they are a sloppy wondering idiot (codewise).

I don't think the problem is the simplicity of the languages, but rather, the uses they are put to. It's a special case of the GoldenHammer AntiPattern, where the hammer is a simple language. Often it's not even by the programmer's choice, but the company policy. See: TheParableOfTheGoldenHammerPolicy -- BillCaputo

It's not simple programming languages, but simplistic ones that encourage bad programming. If, to be simple, a language has to mask the complexity of the application domain, then it does encourage all sort of bad programs.

It's not really the GoTo that's the problem - more that I used to run that program in electronics stores to annoy the clerks. It seems these are the sort of things some people have a real objection to (again, see JavaScriptSucks, example: UnsolicitedPopupWindows?). Personally, I think accessible languages are a good learning tool. If they can do genuinely useful things, they allow a PowerUser to write useful throwaway programs quickly.

See Also: ToolsThatTeachPoorHabits

View edit of December 28, 2009 or FindPage with title or text search