For C#, JetBrains ReSharper often suggests that you invert your if
statements to reduce the number of nested if
-statements.
For example, it suggests that the code below:
private void Foo()
{
if (someCondition)
{
// Some action
}
}
could be converted to:
private void Foo()
{
if (!someCondition) return;
// Some action
}
Is there a similar way to do this with VHDL code? Even if it is possible, is there a good reason to avoid this coding style in VHDL?
I am wondering if it possible to achieve something like this in VHDL
process(clock)
begin
if (rising_edge(clock)) then
-- Some action
end if;
end process;
becomes
process(clock)
begin
if (not rising_edge(clock)) then
return;
end if;
-- Some action
end process;