Tell a friend
Link to us
Bookmark Us
Total Members
      Members: 87088
Sitemap Forum Chat
 
.NET Home
.NET Members (3607)
.NET Member Articles ( 33 )
.NET Discussion (418)
.NET Q & A ( 3 )
- .NET Ask Question
- .NET Questions
- .NET Unanswered Questions
.NET Resources
.NET Source Code (0)
.NET Articles (71)
.NET Blogs (47)
.NET Jobs (0)
.NET Components (2)
.NET Books (70)
.NET Websites (43)
.NET News (192)

 
Resource Directory

 
GROUP INFO
Members: 3607
Access Type: Anyone can join

 
GROUPS
.NET
ASP.NET
.NET
C#
ASP
Visual Basic
Java
Java
JSP
EJB
Other
Delphi
C++
Ajax
UML
JavaScript
PHP
Web Design
Web Hosting
SQL Server
Oracle
Project Management
More Groups

 
LEARNING CENTER
TUTORIALS
.NET
.NET Tutorial
ASP Tutorial
ASP.NET Database Tutorial
ASP.NET Development Tips
ASP.Net Security,Internationalisation And Deployment
ASP.NET Server Controls Tips
ASP.NET Tutorial
C Sharp Tutorial
LINQ Tutorial
Web Development
Flex Tutorial
HTML Tutorial
Javascript Tutorial
Learn AJAX Tutorial
PHP Tutorial
Software Development
Database Tutorial
SQL Tutorial
UML Tutorial
Java
Ant Tutorial
EJB 3 Tutorial
Grails Tutorial
Hibernate Tutorial
Java 1.6 Tutorial
Java Tutorial
Java Web Component Tutorial
Java XML Tutorial
JDBC Tutorial
JDK1.5 Tutorial
JSF Tutorial
JSP And J2EE Design Tutorial
JSP Tutorial
Service-Oriented Architecture (SOA) Tutorial For Managers
Spring Tutorial
Struts Tutorial
Tomcat Tutorial

RESOURCES
Q & A (531 )
Source Code (3276 )
Articles (365 )
Books (373 )
Components (1647 )
News (898 )
Websites (1208 )

SUBMISSIONS
Submit Article
Submit Website
Submit News
Submit Source Code
Submit Component

COMMUNITY
Authors
Members Directory
Discussion Forum
Chat

SITE
About Us
Sitemap
Search
Contact Us
Feedback
Tell a Friend
Advertise

 

.NET
BLOG
  Home > .NET > Blogs > Implicit Line Continuations
  

Implicit Line Continuations

WARNING: This is a speculative post. Caveat emptor.

One of the things that we'd like to address in the next version is line continuations. We know that they tend to annoy many developers who want to break their logical lines across multiple physical lines, and we've gotten many requests to get rid of them altogether. Unfortunately, there's a reason we haven't just dropped them--they actually are needed in certain scenarios. For example, take the following contrived example:

    Sub Main()
End _
Sub

If I remove the line continuation, I'll now get a compile error because "End" now is the "End" statement, and the Sub looks like it's trying to start a new subroutine in the middle of the current subroutine. There are quite a few of these syntactic ambiguities sprinkled throughout our grammar, some of which might be quite obscure and unnoticed until someone's code actually broke. So instead of taking a maximalist approach and trying to remove the line continuation everywhere, we've been thinking about a more minimalist approach and looking at where removing the line continuation might be most useful. This produced a much more tractable list of places where we might productively remove the line continuation. In particular:



  1. After binary operators in expression contexts. Note that this does not include assignment operators. For example:
    a = b  
    c

  2. After the following punctuators: comma (","), open parenthesis ("("), open curly brace ("{"), begin embedded expression in XML ("<%="). For example:
    Console.WriteLine(
    "{0} {1}",
    FirstName,
    LastName)

  3. Before the following punctuators: close parenthesis (")"), close curly brace ("}"), end embedded expression in XML ("%>"). For example:
    Console.WriteLine(
    "{0} {1}",
    FirstName,
    LastName
    )

  4. After an open angle bracket ("<") in an attribute context, before a close angle bracket (">") in an attribute context, and after a close angle bracket in a non-file-level attribute context (i.e. an attribute that does not specify "Assembly" or "Module"). For example:
        <
    Conditional("Foo"),
    Conditional("Bar")
    >
    <
    Conditional("Baz")
    >
    Sub Main()
    End Sub

  5. Before and after query expression operators. For example:
    Dim ys = From x In xs
    Where x > 5
    Select
    ten = x * 10,
    twenty = x * 20,
    thirty = x * 30

One thing that is not currently on the list is allowing an implicit line continuation after a dot, so you couldn't break up "a.b.c" implicitly. It's not that we can't do dot, just that it's quite a bit more expensive and problematic for Intellisense. We'd be interested to hear if this is something people really want to/need to do, or if it's just a nice-to-have.


Are there any other places that we missed that you can think of?





From: Panopticon Central
Date Published : Feb 27, 2008 11:55:00
 
 
 
 
 
 
 
 
Welcome Guest Signup
Member's Panel
EMAIL
PASSWORD
Forgot your password?
New User? Click Here!
 
Resend Activation Email!

Hosting Spotlight


Product Spotlight


SEARCH
 



 
 
 
 
 


Home | Login | About Us | Contact Us | Privacy Policy | Advertising | Feedback Please