Advantages and Disadvantages of ANSI style and Non-ANSI style port declarations

Hi,
I want to know what are the advantages and disadvantages between systemverilog ANSI style and Non-ANSI style port declarations. Why there are two styles? And which style is preferred the most?

-Thanks

K&R (non-ANSI) declarations

  • Advantages: none
  • Disadvantages: Unneeded and excess typing that can lead to mistakes. Violates the DRY principle.

ANSI declarations

  • Advantages: Don’t need to type as much. All the port information is in one location.
  • Disadvantages: None.

Fortunately for C, K&R style didn’t make it into the standard. Unfortunately for Verilog, it did make it into the standard, and folks still use it today.

In reply to sbellock:

And the reason there are two different styles is that non-ANSI was in the original Verilog specification and ANSI style was added in Verilog-2001. It’s unfortunate that immensely preferred ANSI style is still not taught in many college courses

LRM 23.2.2.1 advertises the following as an advantage:

Using the non-ANSI header style with a port list followed by separate declarations for each port allows flexibility on the internal data to be passed through ports.

There are some examples after this statement and one is similar to:


module m(a)
output [7:0] a;
logic signed [7:0] a;
...
endmodule

In this example the port a becomes signed through the last statement. But why is this an advantage at all? The same behavior can be achieved through an ANSI header by declaring the signal immediately.

The only advantage could be that the developer can separate ports from internal signals. But I did not have a need for this separation in my experience.

My conclusion is using non-ANSI header like this is not an advantage over an ANSI-header but only in case when the non-ANSI header style with a port list (each port name written two times) is followed by separate declarations (each port name written for the third time).

What do you think, am I mistaken about the advertised advantage in the LRM?