Saturday, March 30, 2019

The Python Programming Language Computer Science Essay

The Python Programming Language computer Science EssayWikipedia definition of Python scheduling words is as followed Python is a general-purpose risque level programming language. Its design philosophy emphasizes encipher readability. Python claims to combine remarkable power with very clear syntax, and its measure subroutine library is large and comprehensive. Its use of indentation for block delimiters is unusual among popular programming languages. Python supports multiple programming paradigms (primarily object oriented, imperative, and functional) and features a fully dynamic oddball system and automatic memory management. Python is often used as a scripting language.andPython is a programming language that lets you work quickly, it in like manner integrate your systems more(prenominal) successfully. Python is a powerful programming language that is used in a wide variety of application domains. Python is often correspondd to Perl, Ruby or Java. close to of its key fea tures arFans of Python use the phrase batteries included to describe the standard library, which covers everything from asynchronous processing to zip files. The language itself is a flexible human dynamo that can handle practically any problem domain. Build your hold web server in three variants of figure. Build flexible data-driven code development Pythons powerful and dynamic introspection capabilities and advanced language features much(prenominal) as meta-classes, duck typing and decorators. Python lets you write the code you need quickly. And, give thanks to a highly optimized byte compiler and support libraries, Python code runs more than immobile enough for approximately applications. Python also comes with complete documentation, both integrated into the language and as separated web pages. Online tutorials tar queer both the seasoned programmer and the newcomer. All be designed to make you productive quickly. The availability of all right book completes the le arning package.and2andThe programme I have chosen to compare against Python is Cobra. In this essay I leave be comparing and contrasting between the two programming software. On comparison, I have prove Cobra has a more compile-magazine in regards to the error checking time. I view Cobra saves time when it comes to reporting more than one error at one time. Cobra allows aboveboard topical anaesthetic variable assignment, which is very similar to Python however with Cobra they give you a warning if they are never used. In Cobra these errors are caught at a compile-time and hardly take place during execution, like Python. Cobra believes getting them out of the focus early, which will increase productivity time.Contracts have numerous benefitsThey become sectionalisation of the document interface to a rule, showing what is expected to invoke the method and what can be relied on when the methods returns.They are technically enforced because they are executable.They catch run-tim e errors early when errors are still easy to diagnose.They are inherit by subclass methods so they do not need to be re- use (less coding).They whitethorn encourage developers to do more upfront thinking about how their classes will be used.and3andThe problem is that Python defaults to a binary floating rase grapheme even though most numbers that populate input are base 10. To help address this Python offers an additional Decimal slip that computes the square up numbers, but it must be used explicitly end, some would say, awkwardlySo Cobra does the inverse, defaulting to an accurate decimal type and offering the floating point type as an option. A simple f suffix on a number such as 0.1f gives the 64-bit point value. The types are create in with the names decimal, float, float64 and float32. The type float is an alias for float64. Note that in both languages, float math operations are faster than decimal. However, most applications should prefer accuracy over fixture that m ay not be noticeable or needed. For the another(prenominal) applications that really require more speed or compatibility with floating point based libraries, Cobra offers a command line option numberfloat64 which changes the types of literals like 1.0 and 0.5 to float64. Furthermore, Cobra provides a built-in number type which defaults to decimal but changes to float64 with this option. You can also specify -number decimal although the earn is redundant.and4andCobra complies d aver to machine code right out of the box. And Cobra favours static types for local variables by inferring them from their assignment. This promotes more compile-time error checking, especially when invoking library methods. But it also promotes speed. Python has solutions for improving speed for its developers you can write some of your Python modules in C and wrap them in SWIG. You can use Pyrex. Or you can baulk in Python and bring in C or C++ via Inline or Weave. But with Cobra the speed is built in fro m the beginning. You do not get kicked out to another language or get forced to consume another tool. Cobras performance is close or equal to that of C and Java, and is whence significantly faster than Python. adjure Python claims to be around 1.8X faster than Python, but this is still far slower than Cobra. Also, some users have found Iron Python can significantly slower than CPython and Jython.and5andSome applications including financial analysis, simulation, search, neural networks, games, and more require numerous CPU cycles which can cause Step2 to become a bottleneck during development. Cobra enables a tighter development cycle by offering high level coding and fast execution simultaneously. Because Cobra has no Global articulation Lock (GIL), it can run threads in parallel up to the number of cores available. Combined with its inherent speed, you can pack a dispense of computation in one process on one computer.and6andIn regards to the syntactic improvements, Cobra share s much in common with PythonIndentation denotes code blocks bring up literalsDictionary literalsPrint statementAssert statementFor foo in turf outSlicingAnd moreBut Cobra does not strive to be rearwards compatible with Python. This opens the door to some improvements. Cobra allows embedding expressions in string literals-often called interpolated strings in other languages. This turns every string literal into a mini-templating language.and7andThe Cobra compiler is implemented in Cobra. This means that the entire time the implementers are maintaining Cobra, they are using Cobra. This really tightens up the feedback loop on usability and bugs. This is in contrast to most other languages that are typically implemented in some other language. That practice greatly reduces the time that the language maintainers spend using their own language.and8andThese disadvantages to using Cobra areDocumentation needs expansion.Cobra classes are not manipulable at runtime like Python classes are. Like all budding languages, some people will pass over Cobra because it is new and, therefore, not that popular. Fortunately, many another(prenominal) people do not balk at newness as prove by the fact that many new languages of the past have gained popularity aft(prenominal) their introduction, including Python and C. The same will happen for Cobra, in time.Cobra is not yet available for JVM.and9andMy overall thoughts of both Python and Cobra programming language, after researching for hours, I came to the end point that although Cobra is the better programming language it is not as established as Python, as of yet. Cobra offers a lot more for the user compared to Python. However verbal expression that, I have only used the Python programming language software, so I can not give an answer as a user. Although from all the research I had come across, I still believe that Cobra would be a better programming language to use.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.