# Favorite programming language



## gpatrick (Mar 7, 2013)

This question was asked on another forum, but since there is more activity here I thought it would be interesting to see responses to favorite programming languages.

My favorites are classic Rexx and NetRexx.  

Classic Rexx because it has the simplicity of Basic and the power of PL/1.

NetRexx because it can be used for scripting or application development in the Java environment.


----------



## fonz (Mar 7, 2013)

What, you mean that besides C there are other programming languages? (/me ducks for cover )

Edit: depending on the job at hand, Haskell can be pretty cool too.


----------



## bbzz (Mar 7, 2013)

LISP, of course. Then the rest, far, far below.


----------



## taz (Mar 7, 2013)

C and assembler...but I hate and love assembler at the same time...C I just love


----------



## throAU (Mar 8, 2013)

In terms of syntax, I actually have a bit of a soft spot for Turbo Pascal (first compiled language I learned).  Compared to C, the pointer stuff is easier to read, its impossible to shoot yourself in the foot with regards to = vs. ==, etc.

I'm playing with Objective C at the moment and liking it.


----------



## kpa (Mar 8, 2013)

I used to think that everything has to be done in C because of the full control it gives to the programmer. Now I'm leaning towards using interpreted languages, perl python etc, wherever possible.


----------



## Savagedlight (Mar 8, 2013)

Being the hobby programmer I am, I actually like c# quite a bit. It handles all the "boring" tiny details like memory allocation, which lets me focus on concept, logical behavior and actually getting it to do what I want.


----------



## Carpetsmoker (Mar 8, 2013)

I like Python, for reasons that should be obvious.

But really, choice of programming language is secondary. Having a neat project & a cool team is so much more important (case in point: I am leaving my current Python job with a FreeBSD workstation for a PHP job where I'll get a Windows workstation).


----------



## Crivens (Mar 8, 2013)

The favorite language is always coupled to the problem at hand. When you have only a hammer, all problems look like a nail. So it is important, IMHO, to have a very large toolbox of languages and be careful _not_ to prefer one over all the others for all problems.

So my toolbox contains (in order of proficiency) : C, C++, Modula2, Objective-C, Pascal, Fortran, Oberon2, Prolog, Forth, Assembler(ppc,m68k,mips,sparc,arm), Lisp, ...

Some languages I know good enough to know the pain*efford/use value will not be below the line where I would use them over those which are already in my toolbox, but I can use them when the rest of the codebase is already in that language.


----------



## CurlyTheStooge (Mar 8, 2013)

I've been a working as a system administrator since 4 years and has extensively used shell scripting for automation tasks. As far as programming in concerned, being a Computer Science graduate I adore and praise the mother of all modern languages, C, which was my first programming language. These days, I'm on a break from the job to relearn system/kernel programming in C.
As a Slackware user I have a deep respect for FreeBSD philosophy and development. I wish to be a competent C programmer soon and serve in Slackware and FreeBSD community as a developer.

Regards.


----------



## xibo (Mar 8, 2013)

I like C, C++, Shell and Python. I think I like C most, though I'm not sure (because it's quite a pain for some problems).

Of cause, real Programmers write Assembly language, but I'm just a compiler yet... err I think I confused something.


----------



## Pushrod (Mar 8, 2013)

I used to think that Perl was the be-all end-all of programming languages, but now I have no interest in it, and looking at code I've written in Perl is painful.

I use Objective-C at work and like it.


----------



## drhowarddrfine (Mar 8, 2013)

I love assembly but do everything in C, which I also love. I want to learn Python and Lisp but never find uninterrupted time to work with it. I started on Haskell once.


----------



## Carpetsmoker (Mar 8, 2013)

> I want to learn Python and Lisp but never find uninterrupted time to work with it



The little schemer is probably one of my favorite programming books. It's certainly the most entertaining. IIRC the book also works for Lisp (then again, Lisp and Scheme differ little in the important key concepts).

I've never programmed anything truly useful in either Scheme or Lisp (yet...), but reading this book and learning the language definitely made me a better programmer. You should give it a try! (Teach yourself Scheme in fixnum days is also quite good, though not quite as entertaining. It's free though )


----------



## fonz (Mar 8, 2013)

The _best_ programming language is the one that best suits the job at hand (and platform, and the programmer's ability). What one's _favourite_ language is depends on a lot of things and there are hardly any wrong answers. Even C#, which is basically a half-arsed Java clone made just different enough that Microsoft can get away with it, can be a perfectly good answer if that's what you like. Personally I prefer C because it's closest to how my brain works, Haskell because it's just way cool or even Sinclair BASIC for nostalgic reasons


----------



## graudeejs (Mar 8, 2013)

assembler (fasm syntax), C, Ruby


----------



## wblock@ (Mar 8, 2013)

fonz said:
			
		

> The _best_ programming language is the one that best suits the job at hand (and platform, and the programmer's ability). What one's _favourite_ language is depends on a lot of things and there are hardly any wrong answers.



A good point.  It's worth adding that sticking to just one language can be restrictive, even if it seems comfortable.  Using languages that fit the problem domain can give better results even if you aren't as familiar with them.


----------



## jrm@ (Mar 8, 2013)

graudeejs said:
			
		

> assembler (fasm syntax), C, Ruby



Have you given up on perl?

http://forums.freebsd.org/showpost.php?p=31247&postcount=49


----------



## graudeejs (Mar 8, 2013)

jrm said:
			
		

> Have you given up on perl?
> 
> http://forums.freebsd.org/showpost.php?p=31247&postcount=49



Absolutely.
Ruby is so much nicer, easier to code, easier to read. It has Rails, rspec... It's a joy to write code in Ruby.

Besides I'm a full time Ruby on Rails programmer at CubeSystems


----------



## fonz (Mar 8, 2013)

throAU said:
			
		

> In terms of syntax, I actually have a bit of a soft spot for Turbo Pascal (first compiled language I learned).  Compared to C, the pointer stuff is easier to read, its impossible to shoot yourself in the foot with regards to = vs. ==, etc.


Moreover, there's a reason why most compiler building courses use Pascal as an example source language. Pascal is actually very well-designed, but somehow it appears to have died in the real world.


----------



## cpm@ (Mar 8, 2013)

One reason of why I like and therefore, I plead for C instead of others programming languages: 

By way of analogy, let's say that you were going to be learning Spanish, Italian, French, Portuguese or Romanian. Do you think knowing Latin would be helpful? Just as Latin was the basis of all of those romance languages, knowing C will enable you to understand and appreciate an entire family of programming languages built upon the traditions of C. In fact, Perl, PHP, and Python are all written in C. A list of C based programming languages.


----------



## ChalkBored (Mar 9, 2013)

cpu82 said:
			
		

> One reason of why I like and therefore, I plead for C instead of others programming languages:
> 
> By way of analogy, let's say that you were going to be learning Spanish, Italian, French, Portuguese or Romanian. Do you think knowing Latin would be helpful? Just as Latin was the basis of all of those romance languages, knowing C will enable you to understand and appreciate an entire family of programming languages built upon the traditions of C. In fact, Perl, PHP, and Python are all written in C. A list of C based programming languages.



Except Algol is Latin, not C.


----------



## drhowarddrfine (Mar 9, 2013)

Carpetsmoker said:
			
		

> The little schemer is probably one of my favorite programming books. It's certainly the most entertaining. IIRC the book also works for Lisp


And now for something entirely different!  I'll have to look for that. I see it's only an old publication.


----------



## drhowarddrfine (Mar 9, 2013)

kpa said:
			
		

> I used to think that everything has to be done in C because of the full control it gives to the programmer. Now I'm leaning towards using interpreted languages, perl python etc, wherever possible.



The problem I have is, when I try to come up to speed in any other language, I keep hearing myself say, "That looks just like C." or "I do it the same way in C." so I quickly lose interest, especially when C interfaces with everything but other languages, not always as easy. 

It took me a while to get around to learning javascript till I had to. Then I fell right into it because you can't do coding in a browser with C. I had to interface with PHP for one customer and it didn't take much for me to figure it out but there wasn't much to figure out either.

I guess that's why I'm more interested in Lisp because it doesn't look or act like C.


----------



## jrm@ (Mar 9, 2013)

drhowarddrfine said:
			
		

> I guess that's why I'm more interested in Lisp because it doesn't look or act like C.



You've mentioned in the past that you would like experiment with emacs.  You could kill two birds with one stone by introducing yourself to emacs lisp.


----------



## ananm1 (Mar 9, 2013)

I think Ruby or C


----------



## drhowarddrfine (Mar 9, 2013)

jrm said:
			
		

> You've mentioned in the past that you would like experiment with emacs.  You could kill two birds with one stone by introducing yourself to emacs lisp.



I have the same problem with emacs as I do with learning other languages. I don't get uninterrupted time and feel like, "I could be working on xyz problem right now." I'm not too busy but busy enough to completely fill my day.


----------



## cpm@ (Mar 9, 2013)

ChalkBored said:
			
		

> Except Algol is Latin, not C.



Good appreciation  

C was influenced by ALGOL 68. The interesting history of ALGOL (ALGOrithmic Language) which was a language so far ahead of its time, that it was not only an improvement on its predecessors, but also on nearly all its successors (Timeline of Programming Languages).


----------



## qsecofr (Mar 11, 2013)

For work work: RPG
For personal: perl


----------



## throAU (Mar 11, 2013)

fonz said:
			
		

> The _best_ programming language is the one that best suits the job at hand



That.

With the caveat also being "out of the languages you are proficient with".

If you've got time to learn the "best" language for a job, fine.  But if not, I'd much rather have to maintain well written code in language X, rather than code written by a programmer trying to write code structured exactly like language X in language Y.



But yes, too many people get hung up on trying to use a single language for everything, and it's just counter-productive.



			
				fonz said:
			
		

> Moreover, there's a reason why most compiler building courses use Pascal as an example source language. Pascal is actually very well-designed, but somehow it appears to have died in the real world.



I hear it (Turbo Pascal, which is what I was using) evolved into Delphi.

But yes, I agree it is a very good teaching language as it is fairly strict with data typing, structure, etc.

Yes, there are things that are awkward in Pascal, but for those I used to end up writing inline assembly, and use Turbo Pascal as the glue to tie it all together.

I miss it somewhat.


----------



## Crivens (Mar 11, 2013)

fonz said:
			
		

> Moreover, there's a reason why most compiler building courses use Pascal as an example source language. Pascal is actually very well-designed, but somehow it appears to have died in the real world.



Sad, but true. I think that pascal and it's sucessors have some kind of 'gap' between learned and proficient. You can learn the language pretty fast, but then it takes you a long time to write code in it that the compiler does not throw back at you. That this gap is filled with other (f.e. memory) problems and bugs in other languages does not help because you do not see it in that instant. Nicely put together here, also.


----------



## cpm@ (Mar 11, 2013)

I find it interesting to contrast the views expressed in this thread with PYPL index, whereby Microsoft's C# programming language earned the rank of the No. 1 programming language of 2012. It seems for me crazy :x


----------



## throAU (Mar 12, 2013)

Number 1 programming language by usage or number 1 by programmer satisfaction?

I suspect it is the former... simply due to being the best supported Windows application development language.



			
				Crivens said:
			
		

> Sad, but true. I think that pascal and it's sucessors have some kind of 'gap' between learned and proficient. You can learn the language pretty fast, but then it takes you a long time to write code in it that the compiler does not throw back at you. That this gap is filled with other (f.e. memory) problems and bugs in other languages does not help because you do not see it in that instant. Nicely put together here, also.



Yeah, Pascal will complain at compile stage a lot more, but due to the typing you are a lot less likely to run into situations where the program compiles and then crashes at run time or (worse) compiles, runs and silently generates incorrect results 

I often wonder how much more secure software would be if it wasn't typically written in C or C++.


----------



## cpm@ (Mar 12, 2013)

throAU said:
			
		

> Number 1 programming language by usage or number 1 by programmer satisfaction?
> 
> I suspect it is the former... simply due to being the best supported Windows application development language.



Obviously, C# became number 1 for its high usage and can not question the degree of satisfaction of MS developers, better let they lonely begin their flame war for reply what makes a good systems programming language :e


----------



## Crivens (Mar 12, 2013)

throAU said:
			
		

> I often wonder how much more secure software would be if it wasn't typically written in C or C++.


Amen to that.

Also, forcing runtime array index checks, pointer checks, type checks ... makes for a lot more robust program. Yes, it costs some cycles (if it cannot be optimized away later), but compare that with the time you take debugging something or rebooting a crashed machine.


----------



## zspider (Mar 12, 2013)

Sh and Dtksh. Hoping to get around to exploring other programming languages as well.


----------



## Carpetsmoker (Mar 12, 2013)

> I often wonder how much more secure software would be if it wasn't typically written in C or C++.



Cyclone is an interesting language focused as fixing some of C's perceived flaws:
http://en.wikipedia.org/wiki/Cyclone_(programming_language)

(Never used it though).

Also, C++ is already lot safer than C, although you can still use it in an unsafe manner of course.


----------



## kpa (Mar 13, 2013)

I couldn't agree more. Most the of the simple and stupid errors that have lead to stack overflow vulnerabilities could have been avoided by not using C/C++ at all for tasks where performance isn't critical. Optimizing the handling of user input (for example) by using C is plain dangerous and futile because most of the time it's linear in time, you won't gain an order of magnitude improvements there.


----------



## Crivens (Mar 13, 2013)

Carpetsmoker said:
			
		

> Cyclone is an interesting language focused as fixing some of C's perceived flaws:
> http://en.wikipedia.org/wiki/Cyclone_(programming_language)


One of the ')' escaped, must be a recycled lisp char finally escaping to freedom 
You may also look at D if you come from C++.


----------



## expl (Mar 13, 2013)

C and other languages that support primitive data types and have access to raw stack, have clear advantage only when working in tight loops or when dealing with unpadded binary formats.

At work I do ~80% of my code in pure python mostly binding code and user interface, ~18% in SQL functions that deal with data formatting, ~2% in Cython that deals working with C/C++ libraries/APIs directly and working with binary data and/or extensive loops. Writing everything from scratch in real world using C is not the brightest idea.

For my personal stuff I try to use C++ as it is such a beautiful language, creating neat polymorphic code layouts in C++ should be an art form.


----------



## drhowarddrfine (Mar 13, 2013)

Things like PYPL and Tiobe are a lot of hooey. Wouldn't a brand new language with no users rise quickly on PYPL just because people search for it? Wouldn't it rise quickly on Tiobe if no one used the language so those who do would put out a lot of 'help wanted' ads?

And who's looking for those tutorials? High school kids wanting to make a new game or seasoned professionals?


----------



## cpm@ (Mar 13, 2013)

drhowarddrfine said:
			
		

> Things like PYPL and Tiobe are a lot of hooey. Wouldn't a brand new language with no users rise quickly on PYPL just because people search for it? Wouldn't it rise quickly on Tiobe if no one used the language so those who do would put out a lot of 'help wanted' ads?
> 
> And who's looking for those tutorials? High school kids wanting to make a new game or seasoned professionals?



To consider that your opinion is objective, what alternative to measurement indexes can suggest? IMHO, it's the best way to conclude a good criticism.


----------



## Crivens (Mar 13, 2013)

To share some thoughts on this thread, on this thread, I'd like to post this thus somehow recursive entry 

I want to plead for learning more languages, even if you know you are not going to use them very often. On the university here, you are hit with imperative languages, functional languages and object oriented ones, typeless and type strict ones. Even if you know that you are not going to use *scheme* very often, learning such different languages does wonders for your thinking. A mind once stretched sufficiently enough never regains the original limits, as it is said. Also your jaw may drop when the tutor writes a huffman encoder in some lines on the blackboard.

Oh, and then throw in event driven things like verilog and VHDL, and suddenly a talent for spotting race conditions might manifest itself. I know all this sounds a little like boasting, but belive me : I could not write ten lines of verilog, VHDL or scheme (or others) now which would be accepted by the most sloppy compiler for them, because I did not use them since university. But it leaves traces in your ability to think, which George Orwell addressed with his _newspeak_ in 1984. Your vocabulary shapes what you can say, and thus what you can think. And if your mental vocabulary does not contain things like *always @*, you might have trouble with efficiently thinking about event driven user interfaces or race conditions. 

So, while we all have our 'favorite' language, please please do not stop there, and please do not stay too close to the language you prefer all the time. You might learn something suprising, or something useful. But you will learn something.


----------



## Carpetsmoker (Mar 13, 2013)

^ Exactly. Doubleplusgood!


----------



## fonz (Mar 13, 2013)

Crivens said:
			
		

> So, while we all have our 'favorite' language, please please do not stop there, and please do not stay too close to the language you prefer all the time.


Good point indeed.



			
				expl said:
			
		

> I try to use C++ as it is such a beautiful language, creating neat polymorphic code layouts in C++ should be an art form.


Eep... Far be it for me to say that C++ is crap, or slow, or useless or anything. And I do understand the attraction of certain polymorphism concepts, but one thing that in my opinion C++ is not, is beautiful. I especially find the syntax for the polymorphism aspects of C++ downright horrendous. Most of the concepts are sound, but the syntax leaves a lot to be desired as far as I'm concerned.


----------



## expl (Mar 13, 2013)

fonz said:
			
		

> Eep... Far be it for me to say that C++ is crap, or slow, or useless or anything. And I do understand the attraction of certain polymorphism concepts, but one thing that in my opinion C++ is not, is beautiful. I especially find the syntax for the polymorphism aspects of C++ downright horrendous. Most of the concepts are sound, but the syntax leaves a lot to be desired as far as I'm concerned.



I don't understand what you don't like there.. Syntax is very straight forward I don't think you can get it any more clear/simple as it is now, considering the prototypes are static and hard-typed at compile time (not comparable to dynamic prototypes of Objective-C, Python, etc..).

Compared to C, C++ structuring is amazingly beautiful when done correctly without to much template abusing. Just try to compare popular APIs that come in C and C++ and check how many unnecessary lines you have to write for simple things like maintenance of certain context without any benefit of performance.


----------



## drhowarddrfine (Mar 13, 2013)

cpu82 said:
			
		

> To consider that your opinion is objective, what alternative to measurement indexes can suggest? IMHO, it's the best way to conclude a good criticism.



I don't know of an alternative. Not my area of expertise but something that doesn't work can't be the best of anything.

I briefly looked at your Wikipedia link and there is says something about PYPL that's different than the original post. There it says the data is collected using Google Trends of what developers search for. I don't know that you can narrow it down to "what developer's search for" in Trends but ...

A guy named Naisbitt used to write some books called "Megatrends" which outlined the future world based on trends his company followed by reading hundreds of newspaper from around the world. Note I didn't say "predictions" but "trends". The last two I read, years ago, have shown he was on target but his analysis is done by experienced humans and not data globbing.

So following trends can work. I just don't think the data gathering methods used by PYPL or TIOBE are the best ones.


----------



## fluca1978 (Mar 14, 2013)

As times goes by, I found that it is not a matter of _what is your favourite language_ but _what is your favourite language to do such and such_ question. For many programmers _such and such_ can be substituted with _everything_, but I find myself happy to program some pieces in C, some in C++, many others in Perl, or shell or Lisp, or another one. 

Now back to the question, I can say I love _Perl_ even if I cannot use in my day-to-day job that is related to a language I don't like very much (the one that starts with _J_). And I can say that being a Perl programmer I don't feel interested in learning Python, even if one day I will do!


----------



## vand777 (Mar 15, 2013)

C++ followed by C#.


----------



## alie (Mar 15, 2013)

Perl, C/C++, Java


----------



## MadHatter (Mar 19, 2013)

C/C++ and JAVA


----------



## Majorix (Mar 19, 2013)

My favorites are D and Ruby.


----------



## jackp (Mar 21, 2013)

My favorite is F# -- it's powerful and elegant without being overly-complex. (BTW, F# 3.0 is in the ports tree as of today, in lang/fsharp).

Runners-up are Haskell, C#, and C.


----------



## jackp (Mar 21, 2013)

Carpetsmoker said:
			
		

> Cyclone is an interesting language focused as fixing some of C's perceived flaws:
> http://en.wikipedia.org/wiki/Cyclone_(programming_language)



There are some good academic papers floating around if you want to read more about Cyclone. Another interesting C variant is Single-assignment C (SaC) -- it's a functional-language take on C with some uses in high-performance computing.

If you want full-on insanity, check out ATS (https://en.wikipedia.org/wiki/ATS_(programming_language)). It's a dependently-typed functional language intermixed with C -- the result is both extremely complicated and extremely fast.


----------



## stevekamau87 (Apr 4, 2013)

C, Lisp, Python, Shell, Assembly


----------



## TiberiusDuval (Apr 6, 2013)

Pascal, I liked it quite much.


----------



## Naught0 (May 21, 2013)

My favorite programming languages are Applesoft BASIC for the Apple II/e/gs and Assembly / Machine Language for M68k/MOSTEC-6502, but *I* haven't used them for many years. Today *I* mostly play with C/C++/Perl with a bit of Assembly thrown in when needed.


----------



## freesbies (May 21, 2013)

I love C\C++ and Python. They're fantastic programming languages to start coding.


----------



## ShelLuser (May 21, 2013)

gpatrick said:
			
		

> This question was asked on another forum, but since there is more activity here I thought it would be interesting to see responses to favorite programming languages.


(Turbo / Borland) Pascal and Java (with an expansion to C#).

Now, keep in mind that I'm a semi-professional developer, meaning so much that it's not my primary job. My main job and interest lies in systems administration, but the beauty of that profession (in my opinion) is that it can become so broad that it will easily include programming (think making shell scripts for example).

Pascal is the first "real" programming language I learned (apart from having taught myself Basic and Assembly on the Commodore 64), and although I hardly use it any more I still like to think back with fond memories. Even tried using FreePascal once on Linux but nah; I admire the effort but I sort of closed this chapter. But being able to use inline assembly code and having access to TurboVision still manages to impress me (in a way TurboVision was the 'engine' behind the Pascal IDE itself).

But Java is my primary programming environment, though this has now heavily shifted towards C#.NET. I ran into Java when I started administering Solaris servers, and during a customer installation (which initially triggered an error) I recognized a "Java stack trace", which sparked my interest in the language considering that Sun was obviously using Java themselves (in this time to develop their own OS installer).

I quickly picked up NetBeans, version 4.1 at that time, and basically never looked back. Needless to say; the main advantage back then was obviously being able to target both Linux as well as Windows environments.

The main things which make Java so appealing to me are the clean cut structure, the very easy way to setup / build your own documentation (Javadoc) and the development environment (NetBeans) itself. I really enjoy being able to use Java to extend on my programming environment which has it's roots deep into Java as well. It's not so much an IDE but a complete platform as well, which you can use to build modules for it or use it as a framework for your own applications. And the initial embrace of UML also managed to spark my interest, though I currently rely on an external (commercial) solution for that.

Alas, due to recent events all this has now shifted towards C# (basically .NET as a whole since I also use other aspects as VB.NET and ASP.NET) and this currently forms the core of my primary development environment (the environment itself is now Visual Studio 2012 Professional).

Even so, Java is still my all time favourite language.


----------



## kpa (May 21, 2013)

I've been lately looking into Objective C and Ruby. Objective C looks like a pretty neat language, kind of C combined with Smalltalk. Ruby because I like Python overall but I strongly dislike the choice of using whitespace as a syntactic element.


----------



## fluca1978 (May 22, 2013)

kpa said:
			
		

> I like Python overall but I strongly dislike the choice of using whitespace as a syntactic element.



I have to tell you that I would be glad if other languages take the same formatting approach (or a similar one). And I have to say I don't like Python very much...


----------



## MorgothV8 (May 22, 2013)

It always was C and assembler but I'm beginning to really like PHP.


----------



## kpa (May 22, 2013)

fluca1978 said:
			
		

> I have to tell you that I would be glad if other languages take the same formatting approach (or a similar one). And I have to say I don't like Python very much...



I understand that it results in cleaner and much more readable code since you have to follow the indentation rules rigorously. However, I've learned programming with languages where whitespace is throwaway and not having to bother about whitespace or indentation is more natural for me.


----------



## fluca1978 (May 23, 2013)

kpa said:
			
		

> not having to bother about whitespace or indentation is more natural for me.



That's the problem: you have to bother!

You have to adhere to a style(9) or your code will be rejected. Therefore, having a language that allows you to switch from one style to another is just a false-truth, because everyone coding will adhere to one pretty much rigid way of writing code. 

And again, please note that I'm not a Pythonist (quite the opposite, I like Perl), but having worked with several languages and teams, I find ridiculous to start over again every time the battle of where the brackets should be, how much spaces to indent a block, change my editor (Emacs) settings to use K&R style or Java one and so on....


----------



## ChalkBored (May 23, 2013)

fluca1978 said:
			
		

> That's the problem: you have to bother!



I'm glad I don't have to bother.


```
prices = {
'apple':   0.40
,
               'banana': 0.50}
my_purchase = {'apple': 1
,
    'banana': 6}
grocery_bill = sum(prices[fruit] *
 my_purchase[fruit]
                   for fruit in my_purchase)
print 'I owe the grocer $%.2f' % grocery_bill
```


----------



## fonz (May 23, 2013)

kpa said:
			
		

> I understand that it results in cleaner and much more readable code since you have to follow the indentation rules rigorously.


For whoever cares: Amanda (a functional programming language similar to Haskell) uses sort of a compromise: in certain cases certain things need to go to the left or right of what's above, but otherwise one is free to do whatever one wants.


----------



## torr_from_fallout2 (May 24, 2013)

C and Objective-C.


----------



## fluca1978 (May 24, 2013)

ChalkBored said:
			
		

> I'm glad I don't have to bother.
> 
> 
> ```
> ...



While the above is fine for home projects, nobody will take into account code formatted in such a way, and patches will be rejected if not properly formatted. A lot of big projects have developed not only styles and conventions, but also whole programs to check that all the rules are applied. And if formatting rules are not applied the patch will not be considered at all, even if it works!

Think like this: you can write in English, but writing a book requires you to adhere to printing-conventions, or nobody will buy and read your product.


----------



## ChalkBored (May 24, 2013)

fluca1978 said:
			
		

> While the above is fine for home projects, nobody will take into account code formatted in such a way, and patches will be rejected if not properly formatted. A lot of big projects have developed not only styles and conventions, but also whole programs to check that all the rules are applied. And if formatting rules are not applied the patch will not be considered at all, even if it works!
> Think like this: you can write in english, but writing a book requires you to adhere to printing-conventions, or nobody will buy and read your product.



I was just illustrating that it wasn't a problem Python solves. All Python does is break when you don't paste it inside 

```
[/file] tags.
```


----------

