<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Digital Humanities Questions &#38; Answers &#187; Topic: What&#039;s wrong with python?</title>
		<link>http://digitalhumanities.org/answers/topic/whats-wrong-with-python</link>
		<description>Digital Humanities Questions &amp; Answers &#187; Topic: What&#039;s wrong with python?</description>
		<language>en-US</language>
		<pubDate>Wed, 18 Apr 2018 15:29:25 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://digitalhumanities.org/answers/search.php</link>
		</textInput>
		<atom:link href="/rss/topic/whats-wrong-with-python/index.xml" rel="self" type="application/rss+xml" />

		<item>
			 
				<title>Jim Allman on "What&#039;s wrong with python?"</title>
						<link>http://digitalhumanities.org/answers/topic/whats-wrong-with-python#post-534</link>
			<pubDate>Wed, 20 Oct 2010 03:14:33 +0000</pubDate>
			<dc:creator>Jim Allman</dc:creator>
			<guid isPermaLink="false">534@http://digitalhumanities.org/answers/</guid>
			<description>&#60;p&#62;Just wanted to pipe up here with a brief defense of Python, especially for collaborative academic work.&#60;/p&#62;
&#60;p&#62;Python code is remarkably &#60;strong&#62;easy to share and re-use&#60;/strong&#62;. By design, it generally offers just one preferred idiom (maybe two) for all common operations. Once you know the dance, it's pretty easy to follow the flow of new code without getting hung up in clever/obscure ways of doing things. (I'm looking at you, perl.)&#60;/p&#62;
&#60;p&#62;Python is easy to learn, and its flexibility &#60;strong&#62;repays the time spent learning it&#60;/strong&#62;. Without the required overhead of Java or C++ classes, it works well as a lightweight &#34;glue&#34; or scripting language. (Check out &#34;Hello world&#34; examples in each language to see what I mean.)&#60;/p&#62;
&#60;p&#62;This is not unique to Python, but the language itself can be &#60;strong&#62;shaped to your problem domain&#60;/strong&#62;. Its basic operations (and operators) can be overridden for a new class of object, so you can define what it means to &#34;add&#34; your objects, or sort them, or print them to the console for debugging.&#60;/p&#62;
&#60;p&#62;Regarding the lack of truly private member data, and the use of a naming convention for it: Python is sometimes called &#60;strong&#62;a language for consenting adults&#60;/strong&#62;. If you see names that are marked as private, and violate that implied contract, you're responsible for the consequences. But you always have the option.&#60;/p&#62;
&#60;p&#62;This hints at what, to me, is the best thing about Python, its (wait for it...) community, which I've found to be clue-ful and friendly. Of course, there are clever and helpful people working in all languages, but you can learn a lot by Googling for answers. When I do this for other languages, the results are a minefield of misinformation, bravado and me-too responses. Python responses are generally &#60;strong&#62;bright, pragmatic and humble&#60;/strong&#62;. I'm not sure why this is different, but that has been my experience.
&#60;/p&#62;</description>
		</item>
		<item>
			 
				<title>Ben Brumfield on "What&#039;s wrong with python?"</title>
						<link>http://digitalhumanities.org/answers/topic/whats-wrong-with-python#post-200</link>
			<pubDate>Wed, 29 Sep 2010 13:32:09 +0000</pubDate>
			<dc:creator>Ben Brumfield</dc:creator>
			<guid isPermaLink="false">200@http://digitalhumanities.org/answers/</guid>
			<description>&#60;p&#62;To me, the most scandalous part of Python is its lack of any serious effort at enforcing the kind of information hiding that's vital to object-oriented software.  To &#60;a href=&#34;http://docs.python.org/tutorial/classes.html#private-variables&#34;&#62;quote from the docs&#60;/a&#62;, &#60;em&#62;'“Private” instance variables that cannot be accessed except from inside an object don’t exist in Python.'&#60;/em&#62;&#60;/p&#62;
&#60;p&#62;Apparently there is a naming convention that gets around this by prefixing non-public variables and methods with underscores--so much for aesthetically pleasing code!--but I think I'm not the only developer with experience in Ruby, Java, and C++ who gets the heebie-jeebies from the idea.&#60;/p&#62;
&#60;p&#62;None of that means you shouldn't program in Python when you're building on an existing platform or using a Python library.  But it is a serious flaw that's specific to the language.
&#60;/p&#62;</description>
		</item>
		<item>
			 
				<title>cforster on "What&#039;s wrong with python?"</title>
						<link>http://digitalhumanities.org/answers/topic/whats-wrong-with-python#post-131</link>
			<pubDate>Thu, 23 Sep 2010 01:30:44 +0000</pubDate>
			<dc:creator>cforster</dc:creator>
			<guid isPermaLink="false">131@http://digitalhumanities.org/answers/</guid>
			<description>&#60;p&#62;I don't program. I say that advisedly because, reading Wayne's &#60;a href=&#34;http://twitter.com/wayne_graham&#34;&#62;twitter feed&#60;/a&#62;, you realize what those folks who REALLY program do.&#60;/p&#62;
&#60;p&#62;I do play around a bit though; and when I'm playing around, I am normally doing so with Python and/or Processing. The NLTK, mentioned by Stéfan, makes a host of text analysis tasks much easier--and much easier than any other tool of I am aware in any language. (A sorted frequency of word occurences? The NLTK makes that very simple).&#60;/p&#62;
&#60;p&#62;The resources available (including the Programming Historian, also mentioned by Stéfan) and the NLTK online &#60;a href=&#34;http://www.nltk.org/book&#34;&#62;book&#60;/a&#62;, make Python + NLTK an invaluable combination for the sort of part-time, semi-serious amateur &#34;programmer&#34; who is interested in exploring things that off-the-shelf text analysis tools might not enable.&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://processing.org&#34;&#62;Processing&#60;/a&#62; brings this same degree of ease to some basic visualization. &#60;/p&#62;
&#60;p&#62;Perhaps the chief division to be made is between web apps (upon which the demands can be quite extreme) and little locally run programs &#38;amp; scripts, where even a truly foolish gaff in how you're handling your data will nevertheless be consequence free. Both Wayne and Stéfan write code that gets deployed and used by wide audiences. The demands on such code are different from the little things I play around with I think.
&#60;/p&#62;</description>
		</item>
		<item>
			 
				<title>Wayne Graham on "What&#039;s wrong with python?"</title>
						<link>http://digitalhumanities.org/answers/topic/whats-wrong-with-python#post-127</link>
			<pubDate>Wed, 22 Sep 2010 16:19:55 +0000</pubDate>
			<dc:creator>Wayne Graham</dc:creator>
			<guid isPermaLink="false">127@http://digitalhumanities.org/answers/</guid>
			<description>&#60;p&#62;I should state up front that that statement (&#60;a href=&#34;http://twitter.com/wayne_graham/status/25120215542&#34; rel=&#34;nofollow&#34;&#62;http://twitter.com/wayne_graham/status/25120215542&#60;/a&#62;) was meant to be humorous. There's always a bit of teasing that goes on with different approaches to software development. &#60;/p&#62;
&#60;p&#62;On a more serious note, as a developer coming from a background in C/C++ and Java, I find that the use of significant white-space is, well, silly. I does make you write beautiful code, but there are &#34;better&#34; ways of enforcing this type of style on developers. That's not to say that there aren't silly things in Ruby either (I find the use of punctuation in methods counter to a decade's worth of programming habits). &#60;/p&#62;
&#60;p&#62;As far as functional languages go, I've come to really love one of the big tenants of Ruby community: testing. Testing is (unit, functional, etc.) has a lot of documentation, is relatively painless, and there are a lot of ways to generate reports on the quality of your code (check out metric_fu). This can be a bit more painful in PHP, but with appropriate workflows (we run our tests, documentation, and metrics with an ant script), it's not horrible. I can't speak to the Python development process as much (I've only had to tweak code), but I suspect the community as a whole is closer to the development mentality of Ruby than PHP. &#60;/p&#62;
&#60;p&#62;As with any functional language (e.g. PHP, Ruby, Python), or approaches to DH projects, you need to pick an approach that makes sense. These languages mask a lot of complex, low-level stuff that you may (but probably don't want) access to change. I also have to say that most DH projects don't require Java's sophistication, nor do they have to tools to support sustained Java development. You will be wading through large numbers of framework dependencies, and if you don't have not only the developers, but also the server-support staff in place, these can be a nightmare. If you want to go down that road, I would suggest a functional language implementation that can run on the JVM like Clojure (&#60;a href=&#34;http://clojure.org/&#34; rel=&#34;nofollow&#34;&#62;http://clojure.org/&#60;/a&#62;) to get going.&#60;/p&#62;
&#60;p&#62;One of the other things to weigh, especially in the start-up mentality of most DH shops, in choosing an approach if there is some support nearby. Someone new to programming probably shouldn't start out deploying a node.js application with dependencies on MongoDb as there just aren't folks around to ask when all your data suddenly disappears (and it will). However, it is a pretty safe bet to assume there's someone on higher ed campus with senior-level PHP experience. More and more, there's also probably a group of developers with experience in Rails/Sinatra/Django that can help with the issues that pop up during a development cycle (and these folks are generally more outgoing than Java developers).&#60;/p&#62;
&#60;p&#62;While I'll state again that I don't believe Ruby is necessarily better than Python; there are just a few idioms that I personally find make more sense to the way in which I develop this type of software, and recommend it for DH projects (&#60;a href=&#34;http://www.scholarslab.org/slab-code/why-ruby/)&#34; rel=&#34;nofollow&#34;&#62;http://www.scholarslab.org/slab-code/why-ruby/)&#60;/a&#62;. And, as to Python developers recently found, Ruby and Rails can be quite pleasant! &#60;a href=&#34;http://blog.brandonbloom.name/2010/09/how-two-pythonistas-accidentally-fell.html&#34; rel=&#34;nofollow&#34;&#62;http://blog.brandonbloom.name/2010/09/how-two-pythonistas-accidentally-fell.html&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			 
				<title>Stéfan Sinclair on "What&#039;s wrong with python?"</title>
						<link>http://digitalhumanities.org/answers/topic/whats-wrong-with-python#post-122</link>
			<pubDate>Wed, 22 Sep 2010 15:12:25 +0000</pubDate>
			<dc:creator>Stéfan Sinclair</dc:creator>
			<guid isPermaLink="false">122@http://digitalhumanities.org/answers/</guid>
			<description>&#60;p&#62;Well this is a proverbial can of works. I tend to think that different languages are useful in different situations, and that – if possible – the best is to have several languages in your toolkit and choose the right tool for the right job. Here are some very subjective and personal thoughts on different languages for digital humanities:&#60;/p&#62;
&#60;ul&#62;
&#60;li&#62;&#60;strong&#62;PHP&#60;/strong&#62;: A great scripting language for web-based development. In the simplest case, you embed code into HTML (which makes a lot more sense for many beginners than embedding HTML in code like with most other languages). One of its core strengths is also a weakness: there's a ton of built-in functions to make things easier (but there's a ton of built-in functions and finding what's most useful or even available can be a challenge). PHP is so widely available on servers with little or no setup, so it's very portable and very useful beyond a given task. The object orientation is quite sophisticated, but then you're often moving back and forth between a functional language &#60;em&#62;command(object)&#60;/em&#62; and an OO language (&#60;em&#62;object-&#38;gt;command&#60;/em&#62;). I sometimes use PHP to do quick tasks that aren't web-applications, just because the syntax seems to come to me faster than some of the other languages I use.&#60;/li&#62;
&#60;li&#62;&#60;strong&#62;Ruby&#60;/strong&#62;: I find this an elegant scripting language that can be nice to teach because it's architecturally very consistent (everything is an object, so you can do things like 5.times (in other words even the number five is an object, not a primitive). The most compelling argument for Ruby for many is Ruby on Rails, a framework for developing database driven web-applications (it can also be used without databases or without the web). Teaching Rails is a bit of a challenge because there are a lot of conventions to become familiar with, but the benefit is that you can very quickly prototype an application with scaffolded (or generated) code. Ruby is a prototype language, so you can inject new methods into existing classes (like &#60;em&#62;String.doSomethingFancy&#60;/em&#62;).&#60;/li&#62;
&#60;li&#62;&#60;strong&#62;Python&#60;/strong&#62;: Another widely used scripting language that's more object-oriented in design than PHP but less than Ruby. I think one of the real advantages of Python is an extensive natural language processing library (&#60;a href=&#34;http://www.nltk.org/&#34; rel=&#34;nofollow&#34;&#62;http://www.nltk.org/&#60;/a&#62;) and has other very useful resources (like William Turkel's Programming Historian &#60;a href=&#34;http://niche-canada.org/programming-historian)&#34; rel=&#34;nofollow&#34;&#62;http://niche-canada.org/programming-historian)&#60;/a&#62;. Personally, I use Python the least of these language, but it's definitely widely used – for instance, Google App Engine currently runs either Java or Python.&#60;/li&#62;
&#60;li&#62;&#60;strong&#62;Javascript&#60;/strong&#62;: This of course is an essential language for client-side (browser) applications, which is increasingly a part of any web-based application. I've begun using as the primarily language to introduce students to programming, partly because it's so useful, and partly because the core of the object-orientation is relatively clean (there are things that get messy, like global scoping and class inheritance, but even those are useful aspects of programming to explain).&#60;/li&#62;
&#60;li&#62;&#60;strong&#62;Java&#60;/strong&#62;: This one is fairly different from the languages above in that it's strongly typed (each variable needs to be explicitly declared as being of a certain type, like a string, a number, or a dog), and it's compiled (whereas other languages are interpreted/compiled each time they're invoked, with some nuances) – given a modern development environment (IDE), this distinction is much less significant since compilation happens in the background and automatically). I generally prefer Java for larger or more complex projects because it's strongly typed, which makes debugging and refactoring much easier: a decent IDE knows exactly what each variable and object is, so it's able to anticipate problems and automatically make changes throughout a code base (rather than having to search each usage and change it manually). Theoretically Java is fairly portable across platforms and can be used to develop stand-alone applications, applets, web applications, etc., but Java apps tend to also be resource intensive and more finicky to get running in a web environment. I'd strongly recommend Eclipse for development – it helps find problems as you're writing code and is useful in explaining what needs to be fixed.&#60;/li&#62;
&#60;/ul&#62;
&#60;p&#62;I haven't done much Perl in quite a while, and of course there are many, many other languages that I'm not mentioning here. Every programmer will have counter-opinions to much of what I've said (and several non-programmers will to, but I'm not concerned with them:).&#60;/p&#62;
&#60;p&#62;As I mentioned for Java, I think a key aspect is finding a good IDE, and I strongly recommend Eclipse, particularly since it has plugins for all the languages above (the plugins detect syntax problems as you type, among other features, whereas many editors simply do colour-coding of the syntax). But maybe IDEs are for a separate question... :)
&#60;/p&#62;</description>
		</item>
		<item>
			 
				<title>Vika Zafrin on "What&#039;s wrong with python?"</title>
						<link>http://digitalhumanities.org/answers/topic/whats-wrong-with-python#post-117</link>
			<pubDate>Wed, 22 Sep 2010 13:25:09 +0000</pubDate>
			<dc:creator>Vika Zafrin</dc:creator>
			<guid isPermaLink="false">117@http://digitalhumanities.org/answers/</guid>
			<description>&#60;p&#62;A collaborator I worked with a few years ago was in love with python.  According to him, python's strictly regimented syntax and its indentation requirements essentially forced good coding practices on people while providing a powerful engine for Doing Things.  To my collaborator, using it was as freeing as some people consider constrained writing to be.  Plus, I hear it's sometimes used to take advantage of the Java environment without having to learn Java.  So it's been in the back of my mind as a language I'd like to learn when an appropriate project presents itself.  (I'm terrible at learning programming by doing exercises.)&#60;/p&#62;
&#60;p&#62;Then yesterday, on Twitter, one of my DH friends said &#34;friends don't let friends program python.&#34;  What's that about?  Is it a matter of personal preference, or are there functions that we often need in DH but that python is unable to provide?  Or is there something else I need to know about it, a lurking dark secret?&#60;/p&#62;
&#60;p&#62;And related, I guess: what programming language have you found to be the most versatile, in your DH work?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
