Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/28/08 18:40
Read: times


 
#159435 - Just a minute ...
Responding to: ???'s previous message
Erik Malund said:
if someone writes code like this
u r goin 4 * 2 8
instead of
you are going four times to eat

the language does not matter, the writer does.

Whatever is said about Pascal I have no doubt it can be obfuscated and I repeat my previous statement that if something is obfuscated, it is not because of the language, but the use thereof. The 'defense' of Pascal "you are forced to write clearly" stinks, I you have to be forced to do so, you should not write code in any language

Erik


I've been in the position of having to understand and review the work product of others for many years. No language, aside, perhaps from LISP, has given me the heartburn that 'C' has provided.

It's for learners that Pascal was written. The author is still alive ... Ask him, if you don't believe that. Beginners certainly should be writing code, though they certainly aren't prepared to do it commercially.

How many "stupid" errors have surfaced here in this forum because someone thought they'd written a program correctly because the compiler compiled it? 'C' is a good general-purpose tool because it doesn't get its "features" in your way. That means you're walking the tightrope without a net, though. If you make a mistake, well, that's your problem.

Pascal endeavors to "help" you, at least to the extent of getting you past the compiler errors. The very thing that makes some people love 'C' makes others, including me, hate it. With a language like 'C', that's written to keep the language out of the way, there's no safety net. It lets you write the most ridiculous rubbish conceivable, and compiles it, so long as the syntax is correct. Pascal attempts to impose a bit of learning with respect to "orthography," which is more than just spelling. In German, that's called Rechtschreiben. Aside from the rather obscure term, "orthography," I don't know that there's a single English word for it, but it should be used a lot more often, both in conjunction with writing English prose and with coding.

The reason the Pascal compiler "slaps your wrist" each time you do something really, Really, stupid is so you'll learn not to do that. 'C' was written as the industry was getting away from the "dollars per line" notion of software cost and moving to a more constructive paradigm. Neither 'C' nor Pascal was written to be a "natural language" tool. That means each has characteristics, lexical and syntactic, as well as orthographic, which have to be learned and understood.

A Pascal program that compiles will probably do "something" discernible. That doesn't necessarily hold for 'C'.

Managers who like 'C' often like it simply because the line count is smaller. I don't think that's a good thing at all.

They don't pay for code by the line any longer, so what should be important, above all, is for the code written last year by someone no longer available, whether he's quit, retired, been shot by a jealous husband, or whatever, to be picked up next year, after nobody initially associated with the project of which it's a part and thoroughly understood the first time it's examined, and not only after six weeks of study by high-dollar consultants.

This topic comes up often, and, embedded within it, is the requirement for much better practice in the industry. People don't stay in one company for an entire career as once was the case. Turnover is a big problem for software managers, and coding style and documentation are key issues for them. If coders were paid only for blocks of code that could be immediately understood, correctly, by a new graduate from school, things would improve.

I don't have a problem with the a-b++ or thisword && thatone in 'C', but with the sloppy practice that makes it impossible to track which system requirement justifies the presence of a given line, or block, of code, that sloppy practice being so much more common in 'C' than in Pascal, or in ASM.

Further, because 'C' is so universally taught, it's often viewed as an excuse, or shortcut, around acquiring knowledge of the task and the hardware environment. Sadly, the practice of simply "throwing something together" is all-too-often superficially successful. That's not to say that it can't happen in Pascal, ASM, or ADA.

The code, in whatever language it is written, should be constructed such the reader can easily remain focused on details such as why it's important that "this pointer be incremented here" rather than on "what does this statement mean?" If that practice were adopted, one could actually begin to believe in the existence of "self-documenting code."

I believe it's the crappy coding style and absent commenting that makes people believe 'C' is cryptic, and not necessarily the syntax.

RE






List of 70 messages in thread
TopicAuthorDate
C vs Pascal            01/01/70 00:00      
   A long time ago, in a Galaxy far, far away...            01/01/70 00:00      
      Choice ?            01/01/70 00:00      
   Chalk and Cheese            01/01/70 00:00      
      A bit too simplistic analysis            01/01/70 00:00      
         Bondage and discipline            01/01/70 00:00      
            Yes, you can            01/01/70 00:00      
               ?            01/01/70 00:00      
                  Thinking hard about writing code is essential            01/01/70 00:00      
                  blame users, not tools            01/01/70 00:00      
                     Real Programmers            01/01/70 00:00      
                        It\'s back to planning and documentation again            01/01/70 00:00      
         readibility            01/01/70 00:00      
            I have and do            01/01/70 00:00      
               I fully agree            01/01/70 00:00      
               C *is* cryptic by design            01/01/70 00:00      
                  You say cryptic, I say terse            01/01/70 00:00      
                     and what is the purpose...            01/01/70 00:00      
                        terseness/ clatity            01/01/70 00:00      
                           any language depends on naming            01/01/70 00:00      
                              i do not            01/01/70 00:00      
                                 Why not, if appropriate?            01/01/70 00:00      
                                    one-char index isn't a problem            01/01/70 00:00      
                           never say never to have a multiline C construct            01/01/70 00:00      
                              multi-line conditional            01/01/70 00:00      
                  still just symbols            01/01/70 00:00      
                  No one says you have to use every short cut in C            01/01/70 00:00      
                     it's not the shortcuts...            01/01/70 00:00      
                        whatever it is            01/01/70 00:00      
                           Just a minute ...            01/01/70 00:00      
                              C can thrill you            01/01/70 00:00      
                  Not the point            01/01/70 00:00      
            free choice            01/01/70 00:00      
               commercial?            01/01/70 00:00      
                  yes, commercial            01/01/70 00:00      
                     I did never question...            01/01/70 00:00      
                        choices are good            01/01/70 00:00      
                           yeah, yeah            01/01/70 00:00      
                              ADD 1 TO COBOL            01/01/70 00:00      
                                 On Languages            01/01/70 00:00      
                                    braces            01/01/70 00:00      
                                       I like the literal BEGIN and END much better!            01/01/70 00:00      
                                          Perhaps            01/01/70 00:00      
                                             That\'s not what I meant ...            01/01/70 00:00      
                                                There I disagree            01/01/70 00:00      
                                                   words vs symbols - maybe solution for Richard            01/01/70 00:00      
                                                   Humans have to understand it, too            01/01/70 00:00      
                                                Games are for kidz            01/01/70 00:00      
                                                   headstart            01/01/70 00:00      
                                                      still comparing grass straws            01/01/70 00:00      
                                                         you said it            01/01/70 00:00      
                                                            but you did not get it            01/01/70 00:00      
                                                               good joke            01/01/70 00:00      
                                                                  yet more extrapolations/flame baits            01/01/70 00:00      
                                          BEGIN and END            01/01/70 00:00      
                                             No .. I probably should have listened to Mom ...            01/01/70 00:00      
                                    Pascal            01/01/70 00:00      
      More than a language            01/01/70 00:00      
         some of this is language independent            01/01/70 00:00      
            I love standards            01/01/70 00:00      
               Igor recognizes this...            01/01/70 00:00      
         Answers applicable to Turbo51            01/01/70 00:00      
            don't call it IDE...            01/01/70 00:00      
               IDE vs editor            01/01/70 00:00      
                  DIY or gdb or?            01/01/70 00:00      
                     GDB?            01/01/70 00:00      
                     8051 IDE            01/01/70 00:00      
                        this one?            01/01/70 00:00      
   On T51            01/01/70 00:00      
      Some cooments            01/01/70 00:00      

Back to Subject List