This ANSI declaration, available in Verilog-2001, states each port's name, direction and type directly.
Choose ports and objects
Direction
Role
input
value received by the module
output
value produced by the module
inout
bidirectional connection
inout is useful at pins of a tri-state bus. Inside an FPGA, separate input, output and enable paths often make the circuit simpler.
A wire is a net driven by continuous assignment, a primitive or a module output. A reg is a variable assigned in an always or initial procedural block. Its name does not automatically require a flip-flop:
Swapped positions can go unnoticed, especially between equal-width signals. Prefer named association in RTL.
Keep drivers explicit
Usually give each signal one RTL driver. Multiple wire drivers can conflict and produce x in simulation.
Tri-state buses are a special case; FPGAs often replace internal tri-states with logic. A multiplexer that explicitly selects the source is easier to verify.