Tuesday, October 19, 2010

Project 11 - Problems Solving Techniques (part 7)

 Translating PDL, specifically for the purposes of this part of project 11, into QBASIC.

PDL or Program Design Language is as high-level a language as you can get, without turning speech directly into computer code. When you code in PDL you code in plain English, and use absolutely no computer code, the idea is to make it as ambiguous as possible so you can easily translate it into any other language. There should be absolutely nothing in the PDL code that would indicate a specific language (for instance, ending each line with a Semi-colon would be indicative of Java or C++ amongst others, but not languages such as QBASIC). For instance, saying Lock the surface to prevent access by other programs (when talking about the drawing surface) could easily be attributed to Directx and Lock(), so it would be better to say Prevent the surface from being accessed by other programs.

Making out your code in PDL first, before putting it in another language gives you several advantages. First off, it's easy for project managers and lead programmers to review and look over to make sure you're on the right track and have the right specifications that the program needs, and this way they won't need to sift through endless lines of code to figure out what's going on with your routines and methods. Having done it first in PDL also means you've already written out the comments for your program, and you can just put them on the particular lines of code that they expressed originally.

QBASIC is a very high-level language, and translates from PDL quite well. Becuase QBASIC uses commands such as: PRINT END INPUT RANDOMIZE it is easy to take a similar PDL form and translate it. For example: in PDL you could say: Output the answer. In QBASIC this would come out to: PRINT "The answer is:", answer$.

Similarities in other parts of life would be like British English into American English (or vice versa). For instance, the British refer to football as meaning Association football, known as soccer to Americans, and Americans would refer to Association Football only as soccer, and than Football is the American football. Another small difference would be the term "to table" something during a meeting. To Americans, this would mean to remove it from discussion and bring it up next time. To British, this would mean to bring it into discussion. Translating a book between the two would also be a fairly easy task, as most of the language is the same, however a few changes would need to be made like if the word naff (unstylish, usually used to mean "not very good") the translator would want to change that so an American reader would not be completely confused coming across that word. The same goes with Australian English, as it is also derived from British English, however has it's own divergences.

Those would all be good examples going from PDL to QBASIC, but you can go farther down the levels than that, for instance taking PDL and making Java. This would be like translating English into French, they share a common base in Latin, and there are many similarities between the two, however a lot more effort of translation would be needed to make it work well, unlike translating different types of English between each other.

1 comment:

  1. Where to play online slots online and find out the best online
    With online 평택 출장안마 casinos becoming more accessible, online slots 영주 출장안마 are now 경상남도 출장샵 more accessible to those with a limited number of games. Find 전주 출장마사지 out the best slot machine games 광명 출장샵

    ReplyDelete