Ver Mensaje Individual
  #3  
Antiguo 09-12-2007
Avatar de Héctor Randolph
[Héctor Randolph] Héctor Randolph is offline
Miembro Premium
 
Registrado: dic 2004
Posts: 882
Reputación: 20
Héctor Randolph Va por buen camino
En general, yo estoy de acuerdo en romper con el límite de las 80 columnas. Sin embargo, que pasa cuando necesitamos imprimir el código fuente, hasta el momento no he tenido problemas con el formato de 80 columnas. La pregunta es qué pasaría con un formato de 100 o más columnas, probablemente se hará un ajuste de línea en la impresión y el resultado tal vez no sea muy legible.

Por otra parte,CodeGear en su guía para dar formato a código Object Pascal, recomienda precisamente el uso de 80 columnas

http://dn.codegear.com/article/10280#4.4

Código:
4.4 Continuation Lines

Lines should be limited to 80 columns. Lines longer than 80 columns should be
broken into one or more continuation lines, as needed. All the continuation
lines should be aligned and indented from the first line of the statement, and
indented two characters. Always place begin statements on their own line.

Examples:

    // CORRECT

    function CreateWindowEx(dwExStyle: DWORD; 
      lpClassName: PChar; lpWindowName: PChar; 
      dwStyle: DWORD; X, Y, nWidth, nHeight: Integer;
      hWndParent: HWND; hMenu: HMENU; hInstance: HINST; 
      lpParam: Pointer): HWND; stdcall;

    // CORRECT 

    if ((X = Y) or (Y = X) or
      (Z = P) or (F = J) then
    begin
      S := J;
    end;
Por supuesto que esta guía es solamente una recomendación, pero siempre es bueno seguir un estándar.

Saludos
Responder Con Cita