Skip to main content

Shortcomings of Commonly Used Computer Languages


A.     Typecasting issue in C++




C++ code of type casting, which is considered as an insecured code. The same problem occurred in Ariane 5, which ended up in a crash. 


According to (Soulie, 2007), Type casting is known as converting an expression of a given type into another type. In C, type converstion can be done using,

   1.      Implicit Convertion –  one type of data is automatically converted into compatible type of data.
   2.      Explicit Convertion – Many conversions, specially thos that imply a different interpreation of the value. It has 4 specific casting operators (dynamic_cast, reinterpret_cast, static_cast and const_cast).


Here, the conversion truncates, that is the fractional part is discared. There is a data loss, since the out put is 13, expected output was 14.
Remedy – Use static_cast and add 0.5 before casting.


c = static_cast(b + 0.5) + a; // output is 14

Because of above mentioned reasons, Eiffel does not allow these type castings.

B.     Break statement in Java



Break statement is used to terminate the loop program on a pre defined condition. One basic rule in structured programming is, each control structure should contain only one entry point and one exit point. But above code has 2 exit points. 


In the above code snippet, for loop is supposes to execute 10 times. It has if condition to check loop, if it reach on 5 of value i, break point will be executed. Once break point is executed, for loop will terminate.
Moreover, using break statement is a bad practice, since that could possibly skip some code after the break. Also it is difficult to go through the flow of the program break statements. It would be more difficult with nested loops. So using break statement might help in some situations, such as switch statements, but in the other way program is not secured.



C.     Un-type variables in PHP



PHP (Hypertext Preprocessor) is a un-type programming language, which any variable can store data of any type. Un-typed programming languages make programmers responsibility to avoid run time errors.
It is not secured, since variable does not have a type and programmers have to keep sure about what is stored and where it is stored. Error may occur at run-time. 


Typed languages, such as Eiffel, Java and C++, identify errors at compile time, since they have compilers. Therefore, programs ensure that program will not fail at run-time. Therefore it is another vital feature of language security in typed languages. 


References



Blankenhorn, D., Lessons from Google Wave failure. CBS Interactive [Online] Available at: http://www.zdnet.com/blog/open-source/lessons-from-google-wave-failure/7025  [accessed: 31st October 2010]



Douglas, N. A., (2000), The explosion of Ariane 5. University of Minnesota [online] Available at: http://www.ima.umn.edu/~arnold/disasters/ariane.html [accessed: 29th October 2010]



Eiffel Software. Fortune 500 Technology Manufacturer Uses Eiffel Software to Dominate its Market. Available at: http://www.eiffel.com/executives/case_studies/storage/storage.pdf [accessed: 29th October 2010]



Goldstein, H., Who Killed the Virtual Case File?. North America: IEEE Spectrum, [online] Available at: http://spectrum.ieee.org/computing/software/who-killed-the-virtual-case-file [accessed 30th October 2010]



Greenemeier, L., (2005), Tech vs. Terrorism, UBM TechWeb [online] Available at: http://www.informationweek.com/news/global-cio/showArticle.jhtml?articleID=164300083 [accessed: 30th October 2010]





National Research Council (2004), A Review of the FBI’s Trilogy Information Technology Modernization Program. Computer Science and Telecommunication Board, National Academies Press, Washington D.C, [online] Available at: http://www.nap.edu/openbook.php?record_id=10991&page=R1 [accessed: 30th October 2010]


Neimat, T., Why IT Projects Fail, The PROJECT PERFECT White Paper Collection [Online] Available at:  http://www.projectperfect.com.au/downloads/Info/info_it_projects_fail.pdf   [accessed: 30th October 2010]



Nell, D., Chip, W., (2008), Programming and problem solving with JAVA. Jones and Bartlet publishers, Ontario, [online] Available at: http://www.nap.edu/openbook.php?record_id=10991&page=R1 [accessed: 30th October 2010]



Soulie, J. (2007), Type Casting. cplusplus.com [Online] Available at: http://www.cplusplus.com/doc/tutorial/typecasting/   [accessed: 30th October 2010]



Warren, C., Lessons Google Can Learn From Wave’s Failure, Mashable [Online] Available at: http://mashable.com/2010/08/06/google-wave-lessons/  [accessed: 30th October 2010]






Comments

Popular posts from this blog

D. S. Senanayake College - My Alma Mater

  History In 1967, Minister of Education Hon. I.M.R.A. Iriyagolla began the ground work for establishing the Boys' school in Cinnamon Gardens. It was named after the first prime minister, Hon. D.S. Senanayake of Sri Lanka. Mr. R.I.T. Alles, a teacher of Royal College, Colombo 07 became the Principle of the new school. The location in which the college stands today was at that time called the "Kumbikale", which was cleared with the help of the community and some boy scouts from Royal College. After years of hard work, D.S. Senanayake College opened her doors to youngsters on 10th February 1967. Today The first batch of 167 students was housed in a prefabricated building sheltered by woven coconut leaves. Today it accommodates more than 6500 students from Grade 01 to 13. The ratio of Student : Teacher is now 23 : 1. Currently, 275 teachers are educating students. School colors are Black and Gold where motto is "Country Before Self...

"Hello World" in Different Languages

TRUE STORY!!! And in Binary  :  1000100111010101101011101000000111101010100011101101110111101101010010100010101010101011110101000101010101010101010100100101000101010101110101010100000010111011110110101001010001010101010101111010100010101010101010101010010010100010101010111010 101011001110111101101011101111011010100101000101010101010111101010001010101010101010101001001010001010101011101010100010100010101010101011110101000101010101010101010100100101000101010101110101010.. What the hell? :O Ref -  https://www.facebook.com/photo.php?fbid=554573284591554&set=a.241809332534619.55240.241806149201604&type=1&relevant_count=1&ref=nf