Pythonic : The Good Programmer

What link do you see between the easiness of prototyping offered by Python and the effort needed to build a complete application?

Guido: I never meant Python to be a prototyping language. I don’t believe there should be a clear distinction between prototyping and “production” languages. There are situations where the best way to write a prototype would be to write a little throwaway C hack. There are other situations where a prototype can be created using no “programming” at all—for example, using a spreadsheet or a set of find and grep commands.

The earliest intentions I had for Python were simply for it to be a language to be used in cases where C was overkill and shell scripts became too cumbersome. That covers a lot of prototyping, but it also covers a lot of “business logic” (as it’s come to be called these days) that isn’t particularly greedy in computing resources but requires a lot of code to be written. I would say that most Python code is not written as a prototype but simply to get a job done. In most cases Python is fully up to the job, and there is no need to change much in order to arrive at the final application.

A common process is that a simple application gradually acquires more functionality, and ends up growing tenfold in complexity, and there is never a precise cutover point from prototype to final application. For example, the code review application Mondrian that I started at Google has probably grown tenfold in code size since I first released it, and it is still all written in Python. Of course, there are also examples where Python did eventually get replaced by a faster language—for example, the earliest Google crawler/indexer was (largely) written in Python—but those are the exceptions, not the rule.


How does the immediacy of Python affect the design process?

Guido: This is often how I work, and, at least for me, in general it works out well! Sure, I write a lot of code that I throw away, but it’s much less code than I would have written in any other language, and writing code (without even running it) often helps me tremendously in understanding the details of the problem. Thinking about how to rearrange the code so that it solves the problem in an optimal fashion often helps me think about the problem. Of course, this is not to be used as an excuse to avoid using a whiteboard to sketch out a design or architecture or interaction, or other early design techniques. The trick is to use the right tool for the job. Sometimes that’s a pencil and a napkin—other times it’s an Emacs window and a shell prompt.


Do you think that bottom-up program development is more suited to Python?

Guido: I don’t see bottom-up versus top-down as religious opposites like vi versus Emacs. In any software development process, there are times when you work bottom-up, and other times when you work top-down. Top-down probably means you’re dealing with something that needs to be carefully reviewed and designed before you can start coding, while bottom-up probably means that you are building new abstractions on top of existing ones, for example, creating new APIs. I’m not implying that you should start coding APIs without having some kind of design in mind, but often new APIs follow logically from the available lower-level APIs, and the design work happens while you are actually writing code.

Source of Information : Oreilly - Masterminds of Programming

del.icio.us StumbleUpon Technorati DotnetKicks MisterWong Wists dzone
Digg Reddit Bumpzee Furl Facebook Google Live YahooMyWeb Slashdot Spurl Mixx BlinkList

Pythonic : The Good Programmer

How do you recognize a good programmer?

Guido: It takes time to recognize a good programmer. For example, it’s really hard to tell good from bad in a one-hour interview. When you work together with someone though, on a variety of problems, it usually becomes pretty clear which are the good ones. I hesitate to give specific criteria—I guess in general the good ones show creativity, learn quickly, and soon start producing code that works and doesn’t need a lot of changes before it’s ready to be checked in. Note that some folks are good at different aspects of programming than others—some folks are good at algorithms and data structures, others are good at large-scale integration, or protocol design, or testing, or API design, or user interfaces, or whatever other aspects of programming exist.


What method would you use to hire programmers?

Guido: Based on my interviewing experience in the past, I don’t think I’d be any good at hiring in the traditional way—my interview skills are nearly nonexistent on both sides of the table! I guess what I’d do would be to use some kind of apprentice system where I’d be working closely with people for quite some time and would eventually get a feeling for their strengths and weaknesses. Sort of the way an open source project works.


Is there any characteristic that becomes fundamental to evaluate if we are looking for great Python programmers?

Guido: I’m afraid you are asking this from the perspective of the typical manager who simply wants to hire a bunch of Python programmers. I really don’t think there’s a simple answer, and in fact I think it’s probably the wrong question. You don’t want to hire Python programmers. You want to hire smart, creative, self-motivated people.


If you check job ads for programmers, nearly all of them include a line about being able
to work in a team. What is your opinion on the role of the team in programming? Do you still see space for the brilliant programmer who can’t work with others?

Guido: I am with the job ads in that one aspect. Brilliant programmers who can’t do teamwork shouldn’t get themselves in the position of being hired into a traditional programming position—it will be a disaster for all involved, and their code will be a nightmare for whoever inherits it. I actually think it’s a distinct lack of brilliance if you can’t do teamwork. Nowadays there are ways to learn how to work with other people, and if you’re really so brilliant you should be able to learn teamwork skills easily—it’s really not as hard as learning how to implement an efficient Fast Fourier Transform, if you set your mind about it.


Being the designer of Python, what advantages do you see when coding with your language compared to another skilled developer using Python?

Guido: I don’t know—at this point the language and VM have been touched by so many people that I’m sometimes surprised at how certain things work in detail myself! If I have an advantage over other developers, it probably has more to do with having used the language longer than anyone than with having written it myself. Over that long period of time, I have had the opportunity to ponder which operations are faster and which are slower—for example, I may be aware more than most users that locals are faster than globals (though others have gone overboard using this, not me!), or that functions and method calls are expensive (more so than in C or Java), or that the fastest data type is a
tuple. When it comes to using the standard library and beyond, I often feel that others have an advantage. For example, I write about one web application every few years, and the technology available changes each time, so I end up writing a “first” web app using a new framework or approach each time. And I still haven’t had the opportunity to do serious XML mangling in Python.


It seems that one of the features of Python is its conciseness. How does this affect the maintainability of the code?

Guido: I’ve heard of research as well as anecdotal evidence indicating that the error rate per number of lines of code is pretty consistent, regardless of the programming language used. So a language like Python where a typical application is just much smaller than, say, the same amount of functionality written in C++ or Java, would make that application much more maintainable. Of course, this is likely going to mean that a single programmer is responsible for more functionality. That’s a separate issue, but it still comes out in favor of Python: more productivity per programmer probably means fewer programmers on a team, which means less communication overhead, which according to The Mythical Man-Month [Frederick P. Brooks; Addison-Wesley Professional] goes up by the square of the team size, if I remember correctly.


Source of Information : Oreilly - Masterminds of Programming

del.icio.us StumbleUpon Technorati DotnetKicks MisterWong Wists dzone
Digg Reddit Bumpzee Furl Facebook Google Live YahooMyWeb Slashdot Spurl Mixx BlinkList

The Pythonic Way

Are we moving toward hybrid typing?
Guido: I expect there’s a lot to say for some kind of hybrid. I’ve noticed that most large systems written in a statically typed language actually contain a significant subset that is essentially dynamically typed. For example, GUI widget sets and database APIs for Java often feel like they are fighting the static typing every step of the way, moving most correctness checks to runtime.

A hybrid language with functional and dynamic aspects might be quite interesting. I should add that despite Python’s support for some functional tools like map( ) and lambda, Python does not have a functional-language subset: there is no type inferencing, and no opportunity for parallellization.


Why did you choose to support multiple paradigms?
Guido: I didn’t really; Python supports procedural programming, to some extent, and OO. These two aren’t so different, and Python’s procedural style is still strongly influenced by objects (since the fundamental data types are all objects). Python supports a tiny bit of functional programming—but it doesn’t resemble any real functional language, and it never will. Functional languages are all about doing as much as possible at compile time— the “functional” aspect means that the compiler can optimize things under a very strong guarantee that there are no side effects, unless explicitly declared. Python is about having the simplest, dumbest compiler imaginable, and the official runtime semantics actively discourage cleverness in the compiler like parallelizing loops or turning recursion into loops. Python probably has the reputation of supporting functional programming based on the inclusion of lambda, map, filter, and reduce in the language, but in my eyes these are just syntactic sugar, and not the fundamental building blocks that they are in functional languages. The more fundamental property that Python shares with Lisp (not a functional language either!) is that functions are first-class objects, and can be passed around like any other object. This, combined with nested scopes and a generally Lisp-like approach to function state, makes it possible to easily implement concepts that superficially resemble concepts from functional languages, like currying, map, and reduce. The primitive operations that are necessary to implement those concepts are built in Python, where in functional languages, those concepts are the primitive operations. You can write reduce( ) in a few lines of Python. Not so in a functional language.


When you created the language, did you consider the type of programmers it might have attracted?

Guido: Yes, but I probably didn’t have enough imagination. I was thinking of professional programmers in a Unix or Unix-like environment. Early versions of the Python tutorial used a slogan something like “Python bridges the gap between C and shell programming” because that was where I was myself, and the people immediately around me. It never occurred to me that Python would be a good language to embed in applications until people started asking about that. The fact that it was useful for teaching first principles of programming in a middle school or college setting or for self-teaching was merely a lucky coincidence, enabled by the many ABC features that I kept—ABC was aimed specifically at teaching programming to nonprogrammers.


How do you balance the different needs of a language that should be easy to learn for novices versus a language that should be powerful enough for experienced programmers to do useful things? Is that a false dichotomy?

Guido: Balance is the word. There are some well-known traps to avoid, like stuff that is thought to help novices but annoys experts, and stuff that experts need but confuses novices. There’s plenty enough space in between to keep both sides happy. Another strategy is to have ways for experts to do advanced things that novices will never encounter—for example, the language supports metaclasses, but there’s no reason for novices to know about them.

Source of Information : Oreilly - Masterminds of Programming

del.icio.us StumbleUpon Technorati DotnetKicks MisterWong Wists dzone
Digg Reddit Bumpzee Furl Facebook Google Live YahooMyWeb Slashdot Spurl Mixx BlinkList

The Pythonic Way

Why do you call it a radical step?

Guido: Mostly because it’s a big deviation from current practice in Python. There was a lot of discussion about this, and people proposed various alternatives where two (or more) representations would be used internally, but completely or mostly hidden from end users (but not from C extension writers). That might perform a bit better, but in the end it was already a massive amount of work, and having two representations internally would just increase the effort of getting it right, and make interfacing to it from C code even hairier. We are now hoping that the performance hit is minor and that we can improve performance with other techniques like caching.


How did you adopt the “there should be one—and preferably only one—obvious way to do it” philosophy?

Guido: This was probably subconscious at first. When Tim Peters wrote the “Zen of Python” (from which you quote), he made explicit a lot of rules that I had been applying without being aware of them. That said, this particular rule (while often violated, with my consent) comes straight from the general desire for elegance in mathematics and computer science. ABC’s authors also applied it, in their desire for a small number of orthogonal types or concepts. The idea of orthogonality is lifted straight from mathematics, where it refers to the very definition of having one way (or one true way) to express something. For example, the XYZ coordinates of any point in 3D space are uniquely determined, once you’ve picked an origin and three basis vectors. I also like to think that I’m doing most users a favor by not requiring them to choose between similar alternatives. You can contrast this with Java, where if you need a listlike data structure, the standard library offers many versions (a linked list, or an array list, and others), or C, where you have to decide how to implement your own list data type.


What is your take on static versus dynamic typing?

Guido: I wish I could say something simple like “static typing bad, dynamic typing good,” but it isn’t always that simple. There are different approaches to dynamic typing, from Lisp to Python, and different approaches to static typing, from C++ to Haskell. Languages like C++ and Java probably give static typing a bad name because they require you to tell the compiler the same thing several times over. Languages like Haskell and ML, however, use type inferencing, which is quite different, and has some of the same benefits as dynamic typing, such as more concise expression of ideas in code. However the functional paradigm seems to be hard to use on its own—things like I/O or GUI interaction don’t fit well into that mold, and typically are solved with the help of a bridge to a more traditional language, like C, for example.

In some situations the verbosity of Java is considered a plus; it has enabled the creation of powerful code-browsing tools that can answer questions like “where is this variable changed?” or “who calls this method?” Dynamic languages make answering such questions harder, because it’s often hard to find out the type of a method argument without analyzing every path through the entire codebase. I’m not sure how functional languages like Haskell support such tools; it could well be that you’d have to use essentially the same technique as for dynamic languages, since that’s what type inferencing does anyway—in my limited understanding!

Source of Information : Oreilly - Masterminds of Programming

del.icio.us StumbleUpon Technorati DotnetKicks MisterWong Wists dzone
Digg Reddit Bumpzee Furl Facebook Google Live YahooMyWeb Slashdot Spurl Mixx BlinkList

The Pythonic Way

How did you choose to handle numbers as arbitrary precision integers (with all the cool advantages you get) instead of the old (and super common) approach to pass it to the hardware?

Guido: I originally inherited this idea from Python’s predecessor, ABC. ABC used arbitrary precision rationals, but I didn’t like the rationals that much, so I switched to integers; for reals, Python uses the standard floating-point representation supported by the hardware (and so did ABC, with some prodding).

Originally Python had two types of integers: the customary 32-bit variety (“int”) and a separate arbitrary precision variety (“long”). Many languages do this, but the arbitrary precision variety is relegated to a library, like Bignum in Java and Perl, or GNU MP for C. In Python, the two have (nearly) always lived side-by-side in the core language, and users had to choose which one to use by appending an “L” to a number to select the long variety. Gradually this was considered an annoyance; in Python 2.2, we introduced automatic conversion to long when the mathematically correct result of an operation on ints could not be represented as an int (for example, 2**100).

Previously, this would raise an OverflowError exception. There was once a time where the result would silently be truncated, but I changed it to raising an exception before ever letting others use the language. In early 1990, I wasted an afternoon debugging a short demo program I’d written implementing an algorithm that made non-obvious use of very large integers. Such debugging sessions are seminal experiences.

However, there were still certain cases where the two number types behaved slightly different; for example, printing an int in hexadecimal or octal format would produce an unsigned outcome (e.g., –1 would be printed as FFFFFFFF), while doing the same on the mathematically equal long would produce a signed outcome (–1, in this case). In Python 3.0, we’re taking the radical step of supporting only a single integer type; we’re calling it int, but the implementation is largely that of the old long type.

Source of Information : Oreilly - Masterminds of Programming

del.icio.us StumbleUpon Technorati DotnetKicks MisterWong Wists dzone
Digg Reddit Bumpzee Furl Facebook Google Live YahooMyWeb Slashdot Spurl Mixx BlinkList

Windows 7 Editions

Different people expect different things from their PCs, which is why we offer multiple editions of Windows 7. And because your needs can change over time, we have designed Windows 7 so that you can move up to editions with more features, without giving up the features you already have.



Windows 7 Starter
Windows 7 Starter makes small notebook PCs and other PCs with limited hardware easier to use because it puts less between you and what you want to do—less waiting, less clicking, and less hassle connecting to networks. Windows 7 Starter is designed to meet basic needs and combines the latest in reliability and responsiveness with the familiarity of Windows. Key features that you will find in the Starter edition include the following::
• Broad application and device compatibility
• Safety, reliability, and responsiveness
• Ability to join a homegroup



Windows 7 Home Basic
Windows 7 Home Basic is an entry-level edition that will be offered in a number of emerging markets to customers with value priced PCs. Windows 7 Home Basic makes it faster and easier to get to the programs and documents you use most often, so you can spend less time looking and more time doing the things you want to do. In addition to the benefits found in Windows 7 Starter, Home Basic includes the following:
• Live thumbnail previews
• Advanced networking support (ad hoc wireless networks and Internet connection sharing)
• Ability to extend your screen across multiple monitors



Windows 7 Home Premium
The best edition for consumers, Windows 7 Home Premium provides the best entertainment experience on your PC. You’ll find easy ways to connect to other PCs and devices, all in a visually rich environment that makes everyday use simpler and more engaging. With Home Premium you can create a homegroup to share all of your favorite photos, videos, and music with other networked PCs running Windows 7. And you’ll be able to watch shows for free when and where you want with Internet TV on Windows Media® Center.* In addition to the features in Windows 7 Starter and Home Basic, you’ll also get the following::
• Advanced window navigation and personalization with several new Microsoft Aero® desktop improvements
• The ability to create a homegroup, so you can easily share files between your networked PCs and devices
• The ability to watch Internet TV and record TV on your PC with Windows Media Center
• Remote Media Streaming and improved support for different media formats

*Note: For some aspects of Windows Media Center functionality, a TV tuner and additional hardware may be required. Internet access is required. Free Internet TV content varies by geography. Some content may require additional fees.



Windows 7 Professional
Windows 7 Professional has all the features you need for business, along with all the great media and entertainment features of Windows 7 Home Premium. You’ll be able to run many Windows XP productivity programs natively in Windows 7 or by using Windows XP Mode*, and recover your data easily with automatic backups to your home or business network. You’ll also be able to connect to company networks easily and more securely. In addition to the features in Windows 7 Home Premium, you’ll also get the following:
• Domain Join, which gives you the ability to join a managed Windows Server network
• Advanced Backup and Restore to help you back up your entire system to a home or business network, and Encrypted File System to help protect your data
• Windows XP Mode* for running older productivity applications that require Windows XP
• Location Aware Printing, which helps you set different default printers for your home and work networks

*Microsoft recommends 2 GB of memory, and an additional 15 GB of hard disk space per virtual environment, to run Windows XP Mode. Windows XP Mode requires either OEM pre-installation or post-purchase installation of Windows XP Mode (which runs on Windows 7 Professional or Ultimate) and a virtualization technology such as Windows Virtual PC.Windows Virtual PC requires a processor capable of hardware virtualization, with Intel-VT and AMD-V features enabled. Both Windows XP Mode and Windows Virtual PC can be downloaded from www.windows.com/business/downloads. For more information on system requirements, go to www.microsoft.com/virtual-pc.



Windows 7 Enterprise / Windows 7 Ultimate
Windows 7 Enterprise and Windows 7 Ultimate are the most versatile and powerful editions and are designed to address the needs of both enterprise customers and consumers who want every feature of Windows 7. While the features in these editions are the same, Windows 7 Enterprise includes volume activation capabilities and is only available to customers with a Microsoft Software Assurance Agreement.
Windows 7 Enterprise and Windows 7 Ultimate help make you productive anywhere, enhance security and control, and streamline PC management. They also offer remarkable ease of use with the entertainment features of Home Premium and the business features of Professional, plus the flexibility to work in many different languages. Quite simply, Windows 7 Enterprise and Windows 7 Ultimate include everything Windows 7 has to offer.

In addition to the previously mentioned features, these editions include the following:
• Microsoft BitLocker™ and BitLocker To Go™ drive encryption and data protection on internal and external drives and storage devices
• DirectAccess, which helps give you a more secure connection to your corporate network over the Internet
• Microsoft BranchCache™, which helps provide faster access to content from remote file and Web servers at branch locations
• Microsoft AppLocker™, which helps prevent unauthorized software from running on workers’ PCs
• Enterprise Search Scopes, which make it easy to discover and search content on intranet portals
• Multilingual user interface packs, which let you work in any of 35 languages



Windows Anytime Upgrade
Sometimes you want to be able to do more with your PC. That’s why we’ve made it easier for you to move from one edition of Windows to the next. For example, you may have purchased a small notebook PC with Windows 7 Starter but decide soon after that you want to customize your desktop or create a homegroup. With Windows Anytime Upgrade, you can add features to Windows 7 in as few as 10 minutes. Upgrading from one edition of Windows 7 to another with more features is easy and quick, and you’ll keep your programs, files, and settings.

SPECIAL NOTE:
In the EEA/EU (including Croatia and Switzerland) and Korea, Microsoft will ship versions of these editions that do not include certain features. “N” editions (for example, Windows 7 Home Premium N) do not include Windows Media Player and related technologies such as Windows Media Center and Windows DVD Maker (distribution in EEA/EU only). “KN” editions (for example, Windows 7 Home Premium KN) will not include Windows Media Player and related technologies such as Windows Media Center and Windows DVD Maker (distribution in Korea only). “K” editions (for example, Windows 7 Home Premium K) are the Korean language versions of the products, which contain links added to the Programs menu that go to Web sites that contain links to download competing media players and instant messaging software (distributed worldwide).



Microsoft Desktop Optimization Pack
Microsoft Desktop Optimization Pack for Software Assurance is a dynamic desktop solution available to Software Assurance customers for use with Windows 7. It helps reduce application deployment costs, enables delivery of applications as services, and allows for better management and control of enterprise desktop environments.

Technologies provided in the Microsoft Desktop Optimization Pack include:
• Microsoft Application Virtualization
• Microsoft Asset Inventory Service
• Microsoft Advanced Group Policy Management
• Microsoft Diagnostics and Recovery Toolset
• Microsoft System Center Desktop Error Monitoring
• Microsoft Enterprise Desktop Virtualization

Source of Information : Windows 7 Product Guide

del.icio.us StumbleUpon Technorati DotnetKicks MisterWong Wists dzone
Digg Reddit Bumpzee Furl Facebook Google Live YahooMyWeb Slashdot Spurl Mixx BlinkList
Subscribe to Developer Techno

Enter your email address:

Delivered by FeedBurner