Return-Path: X-Original-To: apmail-incubator-opennlp-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-opennlp-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 71CFD7954 for ; Wed, 9 Nov 2011 09:31:09 +0000 (UTC) Received: (qmail 59159 invoked by uid 500); 9 Nov 2011 09:31:09 -0000 Delivered-To: apmail-incubator-opennlp-dev-archive@incubator.apache.org Received: (qmail 59120 invoked by uid 500); 9 Nov 2011 09:31:08 -0000 Mailing-List: contact opennlp-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: opennlp-dev@incubator.apache.org Delivered-To: mailing list opennlp-dev@incubator.apache.org Received: (qmail 59112 invoked by uid 99); 9 Nov 2011 09:31:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Nov 2011 09:31:08 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of aliaksandr@autayeu.com designates 209.85.214.47 as permitted sender) Received: from [209.85.214.47] (HELO mail-bw0-f47.google.com) (209.85.214.47) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Nov 2011 09:31:00 +0000 Received: by bkbzs2 with SMTP id zs2so1205159bkb.6 for ; Wed, 09 Nov 2011 01:30:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autayeu.com; s=google; h=mime-version:x-originating-ip:date:message-id:subject:from:to :content-type; bh=qBhC8eS0w/YzaT0dBVPftZnpitfGR+I1tjPSTL7vyy4=; b=EpnCJ5LTUEWbLjT7Bp7WfaPkr7cNEPIpG4TbWXM0h4yjAnNpacP0Dwd6ykHrv2yuBv knxHN0D4JtqKT7afDzIfM4dJ3eaIWV26WkhSkD77cH8S+MAdTt1MHWNGwiaatYWkWRti vlP5DCeH1AVmTQDQwj6Ps1uELlaRbQimrDqF0= MIME-Version: 1.0 Received: by 10.204.140.129 with SMTP id i1mr1088868bku.19.1320831040056; Wed, 09 Nov 2011 01:30:40 -0800 (PST) Received: by 10.204.39.129 with HTTP; Wed, 9 Nov 2011 01:30:39 -0800 (PST) X-Originating-IP: [2.157.96.113] Date: Wed, 9 Nov 2011 10:30:39 +0100 Message-ID: Subject: Java5 for-each loops vs old-style loops From: Aliaksandr Autayeu To: opennlp-dev@incubator.apache.org Content-Type: multipart/alternative; boundary=00151747afbaf36d0404b149f04c X-Virus-Checked: Checked by ClamAV on apache.org --00151747afbaf36d0404b149f04c Content-Type: text/plain; charset=UTF-8 Dear all, I would like to ask your opinion: what do you think about "for-each" loops and old-style indexed loops. In my projects I have found that for-each loops have several advantages: 1) code readability - code is easier to read 2) less code - and fewer possibilities for mistakes 3) eases refactorings - one have to change less code during future changes There are many instances in OpenNLP where new style, shorter and cleaner loops can be used. I might provide a patch. What do you think? Aliaksandr --00151747afbaf36d0404b149f04c--