Re: Java versus Python

  • From: "black ares" <matematicianu2003@xxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Mon, 20 Jun 2011 19:17:45 +0300

and all this means more time spend on the task.

----- Original Message ----- From: "Homme, James" <james.homme@xxxxxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Monday, June 20, 2011 2:45 PM
Subject: RE: Java versus Python


Hi,
In my limited experience with this, if the interpreter sees uneven numbers of spaces, or spaces mixed with tabs, it complains. If it sees even numbers of spaces and tabs, it assumes that you know what you are doing. This can be a problem if you don't watch out for it.

The interpreter can give you some help, though, if you use the -t or -tt command line switches. Those tell you about tabs mixed with spaces.

For Eclipse users, if you use Control Shift F, Eclipse formats your code and makes the indentation even. That doesn't help, though, if you don't indent according to the logic you intend.

If you are a Braille-only user, Python allows you to indent by just a single space. This would allow you to preserve as many cells on your display as possible for code. You could then change the indentation by global replace if you need to work with sighted people.

If you are an EdSharp user, or if you are a JAWS user, you can get JAWS to tell you how much something is indented as you read through the code. I don't know about how this works with other screen readers.

The practice of writing and testing small bits of code may also help with this issue. It may also help to write a comment at the ends of statement blocks to make sure that you can easily tell where a bit of logic ends. If you are an EdSharp user, you might consider writing code snippets that you can drop in that are configured with comments that mark the ends of blocks of code. This way, you can guard against indentation mistakes.

None of this is full-proof, though.

Jim



-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx [mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Sina Bahram
Sent: Saturday, June 18, 2011 8:32 AM
To: programmingblind@xxxxxxxxxxxxx
Subject: RE: Java versus Python


Actually it doesn't. it simply assumes you are correct, and so it results in bugs in the program.

Take care,
Sina
-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx [mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of John J. Boyer
Sent: Saturday, June 18, 2011 12:24 AM
To: programmingblind@xxxxxxxxxxxxx
Subject: Re: Java versus Python

Sure, I just haven't used Python much. I'm glad the interpreter
detectsmisplaced whitespace.

John

On Fri, Jun 17, 2011 at 09:51:44PM -0600, Littlefield, Tyler wrote:
You seem to just be picking an argument here. A single misplaced
whitespace character will just cause the interpreter to tell you of the
fact, which isn't exactly destroying a program. It's the same as a
misplaced ; in c, c++ or Java.
On 6/17/2011 9:37 PM, John J. Boyer wrote:
>The mandatory indentation in Python means that a single misplaced
>whitespace can entirely destroy a program. This is not very robust. C
>programmers usually make sure their code is nicely indented by using a
>utility like the Gnu indent. I'm still looking for something similar for
>Java. Manual indentation is too error-prone.
>
>John
>
>On Fri, Jun 17, 2011 at 08:32:55PM -0600, Littlefield, Tyler wrote:
>>Java uses it's indentation much like braces are used. It's not where
>>things have to be in specific columns, but indentation sort of solves a
>>couple problems.
>>1) It means that all blocks of code are denoted by a deeper indentation
>>level than the block that branched it.
>>2) It also means that people usually stick to a nice style. I've seen a
>>lot of different code, for example:
>>while (bla)
>>do_something();
>>while (bla) {
>>do_something
>>}
>>while (bla)
>>{
>>do_something();
>>}
>>
>>Indentation can be a bit hard to get used to, but I personally like it
>>quite a lot.
>>On 6/17/2011 8:30 PM, John J. Boyer wrote:
>>>The thing I dislike about Python is mandatory indentation. This seems >>>to
>>>me a throwback to the old days of assembly language and Cobol, where
>>>things had to be in certain columns. I like the free-form syntax of >>>Java
>>>and C.
>>>
>>>John
>>>
>>>On Fri, Jun 17, 2011 at 07:15:55PM -0700, David Tseng wrote:
>>>>I personally find arguments about programming languages much analogous
>>>>to those seen in politics.  Both sides have great points but tend to
>>>>drive one another towards opposite extremes.  Some camps are die hard
>>>>dynamic language practitioners while others stick to strongly typed
>>>>code.
>>>>
>>>>I will say that strongly typed languages have kind of won the battle
>>>>historically.  Most of the industry writes in C-styled languages like
>>>>C/C++, java, etc.  Lisp, still beloved by many, kind of lost.  Python,
>>>>as many have shown, works wonderfully and frees up coders to actually
>>>>code, is still largely a wrapper on C.  For those who want absolute
>>>>performance, it's considered still an extra level of indirection
>>>>that's not worth the productivity gain.
>>>>
>>>>I love python and its free-form style and the amount of progress you
>>>>can make using it.  Python excels at the rinse and repeat (compile,
>>>>run, fix) style of coding.  The few seconds you need to compile a
>>>>C-styled language and run, you're already fixing the bug in python.
>>>>You're not babied into writing object-oriented code ala java, but can
>>>>independently mix in functional aspects if you wish.  You can just as
>>>>easily go OO if you want as well.
>>>>
>>>>
>>>>
>>>>On 6/17/11, Alex Hall<mehgcap@xxxxxxxxx>   wrote:
>>>>>Programming is certainly a matter of preference in most situations. I
>>>>>would probably give up if the only option were php, since I really
>>>>>hate that language (no offense to anyone). Java is easy enough, but I
>>>>>agree that it feels bulky at times. I like Python's ease of use and
>>>>>readability, plus you can create executables with it, something that
>>>>>is difficult in java. Some people don't like that python is loosely
>>>>>typed, but I prefer saying:
>>>>>name=raw_input("Enter your name: ")
>>>>>to, if memory serves:
>>>>>name=new String();
>>>>>in=new InputReader();
>>>>>name=in.readLine();
>>>>>or something along those lines.
>>>>>
>>>>>On 6/17/11, Littlefield, Tyler<tyler@xxxxxxxxxxxxx>   wrote:
>>>>>>I've used both. I really like python because it comes on most *nix
>>>>>>systems. I also like Python because of it's flexability and
>>>>>>versatility.
>>>>>>Java is nice enough, but it feels big bulky and clunky to me. That >>>>>>and
>>>>>>they seem to have some serious naming convention issues. Sometimes
>>>>>>things are capitalized, sometimes they're not--.net makes more >>>>>>sense.
>>>>>>On 6/17/2011 6:49 PM, John J. Boyer wrote:
>>>>>>>There has been a lot of discussion on the list lately about Python.
>>>>>>>Why
>>>>>>>is that?Personally i much prefer Java. Its syntx makes a lot more
>>>>>>>sense
>>>>>>>and it is just as powerful, if not more. A command-line build >>>>>>>system
>>>>>>>like ant can take most of the hassle out of working with Java
>>>>>>>classes.
>>>>>>>personally, I prefer this to Eclipse.
>>>>>>>
>>>>>>>BrailleBlaster is written in Java. I am using openjdk-1.6, Eclipse
>>>>>>>SWT
>>>>>>>and Apache Ant.
>>>>>>>
>>>>>>>John
>>>>>>>
>>>>>>--
>>>>>>
>>>>>>Take care,
>>>>>>Ty
>>>>>>my website:
>>>>>>http://tds-solutions.net
>>>>>>my blog:
>>>>>>http://tds-solutions.net/blog
>>>>>>skype: st8amnd127
>>>>>>My programs don't have bugs; they're randomly added features!
>>>>>>
>>>>>>__________
>>>>>>View the list's information and change your settings at
>>>>>>//www.freelists.org/list/programmingblind
>>>>>>
>>>>>>
>>>>>--
>>>>>Have a great day,
>>>>>Alex (msg sent from GMail website)
>>>>>mehgcap@xxxxxxxxx; http://www.facebook.com/mehgcap
>>>>>__________
>>>>>View the list's information and change your settings at
>>>>>//www.freelists.org/list/programmingblind
>>>>>
>>>>>
>>>>__________
>>>>View the list's information and change your settings at
>>>>//www.freelists.org/list/programmingblind
>>
>>--
>>
>>Take care,
>>Ty
>>my website:
>>http://tds-solutions.net
>>my blog:
>>http://tds-solutions.net/blog
>>skype: st8amnd127
>>My programs don't have bugs; they're randomly added features!
>>
>>__________
>>View the list's information and change your settings at
>>//www.freelists.org/list/programmingblind


--

Take care,
Ty
my website:
http://tds-solutions.net
my blog:
http://tds-solutions.net/blog
skype: st8amnd127
My programs don't have bugs; they're randomly added features!

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

--
John J. Boyer; President, Chief Software Developer
Abilitiessoft, Inc.
http://www.abilitiessoft.com
Madison, Wisconsin USA
Developing software for people with disabilities

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind


This e-mail and any attachments to it are confidential and are intended solely for use of the individual or entity to whom they are addressed. If you have received this e-mail in error, please notify the sender immediately and then delete it. If you are not the intended recipient, you must not keep, use, disclose, copy or distribute this e-mail without the author's prior permission. The views expressed in this e-mail message do not necessarily represent the views of Highmark Inc., its subsidiaries, or affiliates.
__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

Other related posts: