Jump to content

Your favorite programming language?


Sniffy

Recommended Posts

ATTENTION! OFF TOPIC!Just for the record...referring to the example given previously...The instruction to separate a comma delimited record into its fields (field1 to fieldX)and count the length (into field1Counter to fieldXCounter) is done by the single instruction:

UNSTRING  theCommaDelimitedRecord  DELIMITED BY ","	INTO  field1  COUNT IN  field1Counter		  field2  COUNT IN  field2Counter		  field3  COUNT IN  fleld3Counter		  field4  COUNT IN  field4Counter		  fieldX  COUNT IN  fieldXCounterEND-UNSTRING

Ask yourself the questions:

  • Does this need any further comments?
  • Is it too verbose? Or is it self documenting?
  • Can everybody, including those who have never seen or used COBOL, understand this?
  • Is this code (single instruction) easy to maintain?

So, what is there actually to criticize?n.b. The 'unstring' instruction is more powerful than the example given above...but that is an other story.Regards, Wim.

Link to comment
Share on other sites

I agree for that it's really self describing. But then again, every language could be if you understand it and name your variables properly. For example:

<xsl:for-each select="item"><xsl:copy-of select="price" /></xsl:for-each>

It's pretty darn easy to understand that the price of each item will be copied. Infact, I showed a similar piece of code to a friend who happens to be an admin of a site with tutorials about various things. He's a PHP guru and recently learned XML, but has never seen XSLT code before. When he saw it, he was like "When are you going to write something about XSLT?".But nevertheless, COBOL is readable. If my above example was like

forEach item createCopyOf price

it would have been more readable.If you now tell me that I've just written something in COBOL without knowing, I would be truly amazed :) .

Link to comment
Share on other sites

boen_robot,XML is descriptive! That is the whole idea behind XML (or SGML for that matter).It describes structure. But XML is not intended to be a program language.It would be unwise to simulate extensive database queries, even though, due to the defining nature of XML, this is (some what) possible.Therefore to 'criticize' XML for the fact that it is not an all inclusive language or database (n.b. XML is not a program language nor a database!) is unjust and ignores the domain for which XML was intended, namely: (definable, strict and parseable) structures.The sneers at COBOL are equally unjustified...and more often than not based on ignorance.At least, that is my personal observation.Regards, Wim.p.s. About criticizing COBOL: I never feel personally insulted and I actually read these (sometimes) funny sneers with the same laughter as anybody else does.So, if somebody does know a funny story or anecdote, don't hesitate to amuse me and others.

Link to comment
Share on other sites

I only gave example with XSLT, because I know it best. I think justsomeguy and aspnetguy could give better examples with non-markup languages such as ASP(.NET) and PHP.By the way, XSLT itself is not about describing structure nor database storage, but that's just a detail...

Link to comment
Share on other sites

boen_robot,What is XSLT without XML?I approached your example for the fact that XSLT is the presentation definer for XML!XSLT by itself has no meaning nor function.I could be grossly mistaken of course!....my knowledge of XML is rudimentary!Regards, Wim.

Link to comment
Share on other sites

my knowledge of XML is rudimentary
I guess your sneers at XML come from ignorance than...in your own words.I was not saying that COBOL is not useful or even a great lanaguage I was saying I see no advantage to using it (for myself) and that based on the thought that the large piece of code shown was onlhy performing hte tasks of unpacking the string. However you are entitled to your opinions and I am entitle to mine.Whether it is true (in your opinion or in reality) or not I feel it is a waste of time to learn a langauge that has only one purpose and can only accomplish limited tasks (no matter how good it performs them).
Link to comment
Share on other sites

boen_robot,What is XSLT without XML?I approached your example for the fact that XSLT is the presentation definer for XML!XSLT by itself has no meaning nor function.
Not exactly. XSLT is the bridge from one XML language to another. The reason why XML is suppose to be "interoperable". Because by using XSLT, one XML that one application understands can be converted to another XML which another application understands. In the real world, that's most otfen customXML-to-XHTML transformation. XHTML is the language for the structure, XML alone is the data and XSLT is the glue which binds the data to the structure or any other XML based format (or plain text on that matter).I've seen some pretty weird things done by XSLT which manipulates empty XML files. In other words, it doesn't manipulate them. It just needs them to start doing it's thing. Other applications pass parameters to this XSLT and based on them, it does some unimaginable stuff. Such cases make people (including myself) ask themselves VERY deeply "is XSLT an XML based programming language?". I mean... if it could only work with RDBMS' like MySQL, hide it's source code and work with the file system it could start being comprable with PHP and the such. By the way, XSLT 2.0 includes some functions for handling non-XML files, so the thing I'm talking about may not be as distant as I'm thinking.I do agree that XSLT and COBOL are uncomparable though. Not only the markup/non-markup conflict, but also the purpose, the field of use, etc. I was just talking about readability in general.P.S. I know why W3C decided not to add the features I mentioned above.- Supporting MySQL or any other RDBMS' would mean that they are throwing XML away.- W3C creates "royalty free licence" languages and I guess this also implies open sourceness. Also, XSLT is read in the browser. In other words: it's client side thing. The browser needs the source to use the XSLT. Of course, you can hide the source with a server side language, but that's still not XSLT alone.- XSLT is by it's core a convertion language. Dealing with the file system can't be a part of a convertion. Infact, the non-XML files functions I'm talking about refer to text files, detecting existance of files, pointers to files, etc. but not actually edit, save or delete them. Only perform things based on them. And considering it's partial client side nature, imagine if a client can manipulate your server. No, thanks.
Link to comment
Share on other sites

I have a few languages that I like quite alot.1. PHP - I love its flexability and convenience, and its amazingly convenient web functionality. I'm not so much a fan of it's strange Object-Oriented behavior or some of the unfortunate side effects weak typing can have, but oh well.2. Java - So clean, so friendly, such a beautiful API! The opposite of PHP in error-proneness, but the rigidity that comes along with it can be frustrating3. XML/XSL/Anything related - Finally, a universal, human-readable language. I'm as happy as a leetle gurl :)

Link to comment
Share on other sites

I have one that I haven't seen yet in this, unless of course, I may be going blind? Well, anyways, my favorite, unexpectedly is just plain HTML. I would've never gone onto other langauges without first learning HTML. I started with it, then moved on to client-sides, then server-sides, then onto compiliation languages, and, well, HTML is just where I started... :) So, without learning it first, I would've never been in the world I live in now. :)

Link to comment
Share on other sites

HTML isn't a programming language, it's a formatting language. There is no logic or control or data manipulation involved, only suggestions for presentation.I'll be the first to admit that I have little to no knowledge of COBOL, but I'm not arguing (or sneering..) against using COBOL itself so much that I am arguing against using something that is so old. Old is not synonymous with bad, but it is synonymous with antiquated or outdated, and the fact is that programmers as a group have learned so much since COBOL was designed that there are simply better tools available today then there were 50 years ago. It's the same reason why I don't drive a 57 Chevy, cars today are much easier to maintain (although much more complex) and more reliable then they were 50 years ago. The only reason to drive a 50-year old car is for the sake of nostalgia, and I'm only 27 to begin with.I would also say that your argument against comments is more of an argument against bad programmers or bad maintainers. It's not the language's fault if people don't maintain the comments as well as the code.

About the one size fits all solution:I am all for it!...except for the fact that I have never found a solution satisfying all requirements and, at the same time, being easy to use!
I will sacrifice ease of use for an elegant solution any day of the week. If I have to spend an extra few weeks to come up with a solution that will be better for the next few years, then so be it. PHP has come the closest for me. I started out writing PHP probably much the same way that most people start with it. Some of my applications were essentially HTML pages with PHP thrown in, others were purely PHP applications with huge blocks of HTML inside echo statements. Neither of those approaches are easy to maintain, for both the logic and presentation (it might be notable to mention that HTML is used for presentation, not PHP). These days, I use templates. My PHP pages do not contain any HTML code, except for the occasional page that needs a tree structure displayed or something else that would make for a much more confusing template. I wrote my own template engine, and that's what I use. My templates are HTML pages with various extra tags thrown in to add the appropriate values from the PHP processing page. Here is an example of a PHP page, minus some of the extra processing to handle various events:
<?phprequire_once ("include/global.conf.php");require_once ("include/variables.permissions.php");auth_user();$page_name = "Permissions";require_once("include/template.php");$page = new Page();$content = array();$content['sys_name'] = $SYSTEM_NAME;$content['sys_path'] = $HTTP_SYSTEM_PATH;$content['page_title'] = $SYSTEM_NAME . ($page_name != "" ? ": $page_name" : "");$content['error_text'] = parse_errors();$content['selected_menu_item'] = 'permissions';$page->set_template("permissions.wtf");$page->process($content);$page->output();?>

And an example template, this one for a login page:

{*type=file header.tpl}		<br />{*type=if_start name=error_text}		<br />		<div style="text-align: center;" class="error_text">{*error_text}</div>{*type=if_end name=error_text}		<div style="width: 350px; margin: 0 auto;">		  <div class="float_box_title">Log in to {*sys_name}</div>		  <div class="float_box">			<div class="border_light content_text" style="padding: 5px;">  			  <form action="login.php" method="post" style="margin: 0px; padding: 0px;">			  <input type="hidden" name="page_mode" value="login" />			  <div class="float_box_left_item" style="width: 150px;">Email address:</div>			  <div class="float_box_right_item">{*type=textfield name=login_id size=25 maxlength=100 class=input_text}</div>			  <div class="float_box_left_item" style="width: 150px;">Password:</div>			  <div class="float_box_right_item"><input type="password" name="login_pw" size="25" maxlength="40" class="input_text"></div>			  			  <div style="margin: 20px 0px 20px 0px; text-align: center;" class="content_text">				{*type=checkbox name=setcookie class=input_text} Automatically log me in on this computer			  </div>			  <div style="text-align: center;"><input type="submit" value="Log In" class="standard_button" /></div>  			  </form>			</div>		  </div>		</div>		<br /><br /><br />		<div style="text-align: center;" class="fine_print">User name and password are <b>case-sensitive</b>		<br /><a href="pw_reset.php">Forgot password</a>		<br /><br />{*type=file footer.tpl}

Logic and presentation are separated, and the same language is behind it all. In theory, separate people could be responsible for each part of the system with minimal interaction between them. In practice, I don't really have a lot of programmers helping me out.

But that is not the point. The point is:What, for instance, if you want to switch from a relational database to an object database?It would not be wise to have an SQL statement in either your presentation or data manipulation logic!
I think that's a little alarmist. First of all, it would have to be a very compelling reason to switch from relational to object, and since relational databases are extremely popular, well-supported, and have plenty of features, I don't see that happening in the first place. The same goes with SQL. There isn't even a well-defined standard set to replace SQL anywhere on the horizon, I don't think that SQL will be going anywhere in the near future.Regardless, I do use a database abstraction layer in my applications to abstract out the details of the specific DBMS. If I want to move to Oracle or PGSQL, I only have one file to change. Similarly, PHP includes the PEAR package, which does all of the abstraction work for you for a large number of things, including a database class that does not require SQL statements.
It is not good enough that the aces and gurus understand the system!The system must be understand by the mediocre majority.
I disagree. Code should not be dumbed down so that it is clearly understood by everyone. The point of code is not to be readable and understandable by the majority, the point of code is to execute quickly and efficiently. If the mediocre majority cannot understand the commented code that I produce, then the mediocre majority needs to get less mediocre. Employers should expect more from their programmers. Obviously this doesn't hold true for hobbyist programmers, but hobbyist programmers typically do not have a use for writing complex code.I think the moral of all of this is that it is hugely about programmer preference and needs of the system. If a specific system would be better served by using a specific language over another one, then that language should be used.
Link to comment
Share on other sites

I guess your sneers at XML come from ignorance than...in your own words.I was not saying that COBOL is not useful or even a great lanaguage I was saying I see no advantage to using it (for myself) and that based on the thought that the large piece of code shown was onlhy performing hte tasks of unpacking the string. However you are entitled to your opinions and I am entitle to mine.Whether it is true (in your opinion or in reality) or not I feel it is a waste of time to learn a langauge that has only one purpose and can only accomplish limited tasks (no matter how good it performs them).
Aha...you have the wrong impression!I do not sneer about XML at all. On the contrary.I am thrilled about XML and dying to use it!I already asked the forum a question about a specific detail about using XHTML.Regretfully this information was lost due to the hacker activities last week.And about limited tasks...XML has a limited task. It is for defining structure only.You prefer the all-in-one solution, which I have personally never seen.I prefer delegating responsibilities of cooperating systems,Such as RDBMS, transaction systems, queing systems, processing systems (n.b. this is the core programming), format defining systems (such as XML) and presentation systems (such as browsers).But my background is from large scale, multi-user, multi-tasking, hybrid batch/online systems.And in this environment I have never seen an all-in-one system.The closest I can think of is java, but my roots are from the following reality:http://www.cobolportal.com/developer/future.asp?bhcp=1...anyway...'nuf said about COBOL! I had no intention to dominate this thread.I have the feeling that the focus is shifting from the orginal intend of noting your favorite (programming) language to a programming language war. And that was and is not my intention.Just one last remark...You said:
I was not saying that COBOL is not useful or even a great lanaguage I was saying I see no advantage to using it (for myself) and that based on the thought that the large piece of code shown was onlhy performing hte tasks of unpacking the string. However you are entitled to your opinions and I am entitle to mine.
This is not quite true.The code you came up with is a complete, compileable and working program for opening, reading, processing and closing a real life variable length sequential file, including some rudimentary error processing/messages!It is therefore a complete program!And it is a bit unfair to compare one php instruction against a complete program!That is why I rebutted with the instruction only! Which is (and I quote myself):
UNSTRING  theCommaDelimitedRecord  DELIMITED BY ","	INTO  field1  COUNT IN  field1Counter		  field2  COUNT IN  field2Counter		  field3  COUNT IN  fleld3Counter		  field4  COUNT IN  field4Counter		  fieldX  COUNT IN  fieldXCounterEND-UNSTRING

To justsomeguy,The evolution theory is antiquated.The relativity theory is antiquated.Both evolved during their origins and both are usable.COBOL evolved too! And COBOL still is very usable!And yes, my argument against comments is more of an argument against bad programmers or bad maintainers. It's not the language's fault if people don't maintain the comments as well as the code.But this is reality!Do you control who is coming after you to maintain the system!?!Have you ever fixed a bug at three 'o clock at night for a critical banking or public control system that must startup again at seven 'o clock in the morning!?! I did!Did you feel obligated to concentrate on comments and other non-impacting details!?!Also, people tend to concentrate on a detail when adding, changing or (partly) deleting a system.In reality nobody has the time or takes the effort to study every detail and more often than not programmers code workaround solutions instead of being 'neat', and at the same time it often is safer to leave the comments alone.That is my reality in a multi-user, multi-tasking, border crossing, high volume financial system.Also realize that there are already an awful lot of java legacy systems out there!I remember around 1996 that the then 27 year olds declared:
...and the fact is that programmers as a group have learned so much since COBOL was designed that there are simply better tools available today then there were 50 years ago.
As if somebody programming COBOL is not aware of these other tools and paradigms!There is also confusion!For instance by 'ThePsion5'. He said:
XML/XSL/Anything related - Finally, a universal, human-readable language. I'm as happy as a leetle gurl
Not realizing that XML has its roots in the larger SGML and that HTML is an application of SGML and the fact that the vendors deviated from the orginal SGML standards to fit specific web solutions.XML is nothing less than going back to the 'antiquated' GML roots of the early seventies (with a world standard around 1985: SGML).I cannot comment on you PHP example for the simple reason I do not know PHP.But you did make a remark about abstraction.But with abstraction comes delegating responsibilities.And as you found out, the hard way(!), delegation is a must to write maintainable code.And it is fairly irrelevant what you use for the various responsibilities, for instance javascript versus PHP!...except for the fact that either one or the other is more standardised, more flexible, easier to maintain, more appropiate...and so on, and so on...I would not be surprised at all, you being familiar with PHP, thinking:"how could he compare PHP with javascript!?!""You cannot do 'X' with javascript!" (...whatever 'X' is!)But, to my understanding, both PHP and javascript are used for comparable situations!So, here we are again, one prefers what one knows best!And I know COBOL fairly well.But I know COBOL (still) is the dominant programming language for business applications.It is the dominant programming language for business apllications because of the proved track record.Is this going to change!?!No doubt! But so is PHP, javascript, java, eiffel, delhi/pascal...and so on, and so on...You also said:
I disagree. Code should not be dumbed down so that it is clearly understood by everyone. The point of code is not to be readable and understandable by the majority, the point of code is to execute quickly and efficiently. If the mediocre majority cannot understand the commented code that I produce, then the mediocre majority needs to get less mediocre. Employers should expect more from their programmers. Obviously this doesn't hold true for hobbyist programmers, but hobbyist programmers typically do not have a use for writing complex code.
Practice is, so far, that people are happy when their software is working.It is not so much that you have to 'dumb down' but it is utopia if you assume you can rely on whoever is coming after you!People tend to grow into complex systems.But it is very difficult, even for experienced programmers, to understand complete complex systems developed by others...developed, more often than not, years ago!That is my experience!More often than not a complex system tends to get infuriating complex when time and programmers passes by!You may have experienced this yourself!Ever had the experience that someone changed your 'baby' and you thought: "Why on earth has (s)he done it this way???"It happens!You ended by saying:
If a specific system would be better served by using a specific language over another one, then that language should be used.
If you really mean that than why do you dismiss COBOL merely on the fact that you feel it is 'antiquated'?Regards, Wim.
Link to comment
Share on other sites

If you really mean that than why do you dismiss COBOL merely on the fact that you feel it is 'antiquated'?
Because, like I said, I would assume that there is something better to use for the same task now. For example, C#.
Link to comment
Share on other sites

If you really mean that than why do you dismiss COBOL merely on the fact that you feel it is 'antiquated'?
Same reason I don't use PERL anymore. Same reason I chose C++ and not C. Same reason I use ASP.Net and not ASP.They are newer languages that have a stronger framework that take care of things that are left to the programmer in the older languages and they handle newer situations better.
Link to comment
Share on other sites

COBOL contains programmatic constructs that are superior than C++ and, I assume, C#I say "I assume C#" because I am not familiar with C# but I assume it is similar to Java....and of course I can give examples...but that is asking for COBOL details!Are you prepared!?!On an other note...I don't want to start a code war of "my-language-is-better-than-yours".I often use the example that a truck is good for moving loads and a Ferrari is good for speed.This makes a truck a bad 'fast driving' car and the Ferrari a bad 'transportation' car.But neither the truck nor the Ferrari is 'bad'...they just have their own niches in which they are good.The niche of COBOL is "business applications".And for that niche COBOL is very good!It is very good because it is built for it!As a Ferrari is built for speed, and truck is built for transportation!So, when I say 'superior constructs' than I mean superior for the business application.This does not mean that the other program language, language 'xxx', is a 'bad' language.Where 'xxx' is whatever you want it to be!Regards, Wim Ahlers.

Link to comment
Share on other sites

Posts about my-language-is-better are completely redundant. (just a statement :))Unless you've created your own language, don't post it! What's the point? Xml is as much my language as is A++. Even though I don't know either :)

Link to comment
Share on other sites

Posts about my-language-is-better are completely redundant. (just a statement :))Unless you've created your own language, don't post it! What's the point? Xml is as much my language as is A++. Even though I don't know either :)
Is there even a language called A++ :) ?
Link to comment
Share on other sites

Is there even a language called A++ :) ?
No...that is a hardware certification :)Again, I did not say COBOL was bad or useless I made a statement on why "I" dismiss COBOL because of its age along with OTHER languages that I have chosen to disgard in favor of newer languages.Once again this is only my opinion and I am not trying to convince anyone else.
Link to comment
Share on other sites

It's almost a moot point anywhere, COBOL is used for substantially different purposes than PHP is used for, you can't even compare them against each other in practice because they are for totally different things. The internet was 20 or 25 years down the road by the time COBOL hit the street.

Link to comment
Share on other sites

  • 4 months later...

I've come back with even more of interest of programming and an understanding.My favorite programming language of all though is probably actionscript, used with flash. It's based on javascript but with a step up of features. Although I haven't covered object oriented programming(but will in the next month or two), it does have OOP in it. It has it's own unique features too to make games easily and to make cool business applications.It has some server-side and XML compatibility but they'll have to work on it before it really catchs on in that way.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...