What's you faviourate coding style?

S

solotim

Guest
Hi, group,

I'm a developer of veditor project: http://veditor.sourceforge.net/.
Veditor is an open source Eclipse plugin designed for Verilgo/VHDL
programmer. I am curious if there is anybody in this group have known
of this plugin.

Meanwhile, is there anyone like to offer me some infomation about
verilog coding style please? I manage to set some pre-loaded coding
style in Veditor so it can automatically format user's code.

Best regards and thanks.

Frank Tao
 
On Tue, 26 Jun 2007 06:57:14 -0000,
solotim <solotim.cn@gmail.com> wrote:

Meanwhile, is there anyone like to offer me some infomation about
verilog coding style please? I manage to set some pre-loaded coding
style in Veditor so it can automatically format user's code.
Yippeee - we can have "brace wars" just like in C!

if (...) begin
....
end else begin
....
end

vs.

if (...)
begin
....
end
else
begin
....
end

vs.

if (...)
begin
....
end
else
begin
....
end


vs.

if (...)
begin
....
end
else
begin
....
end

Let the entertainments begin!
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services

Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
jonathan.bromley@MYCOMPANY.com
http://www.MYCOMPANY.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
 
On Jun 25, 11:57 pm, solotim <solotim...@gmail.com> wrote:
Hi, group,

I'm a developer of veditor project:http://veditor.sourceforge.net/.
Veditor is an open source Eclipse plugin designed for Verilgo/VHDL
programmer. I am curious if there is anybody in this group have known
of this plugin.

Meanwhile, is there anyone like to offer me some infomation about
verilog coding style please? I manage to set some pre-loaded coding
style in Veditor so it can automatically format user's code.

Best regards and thanks.

Frank Tao
While I enjoy watching brace wars as much as the next fellow, I think
that having a single consistant style is more important than which
style you choose.

I've been letting "Mac's Verilog Mode" format my code for a while now,
and I've gotten quite used to that style.

G.

PS: I've started using Veditor, and I like it. Thanks for making it.
 
On Jun 26, 3:09 am, Jonathan Bromley <jonathan.brom...@MYCOMPANY.com>
wrote:
On Tue, 26 Jun 2007 06:57:14 -0000,

solotim <solotim...@gmail.com> wrote:
Meanwhile, is there anyone like to offer me some infomation about
verilog coding style please? I manage to set some pre-loaded coding
style in Veditor so it can automatically format user's code.

Yippeee - we can have "brace wars" just like in C!

if (...) begin
....
end else begin
....
end

vs.

if (...)
begin
....
end
else
begin
....
end

vs.

if (...)
begin
....
end
else
begin
....
end

vs.

if (...)
begin
....
end
else
begin
....
end

Let the entertainments begin!
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services

Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
jonathan.brom...@MYCOMPANY.comhttp://www.MYCOMPANY.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
I use the first style. It is the most compact, lowest number of lines
and least amount of indenting, and the "real" code still stands out
making it readable. I must also add that I wish we could just use
curly braces instead of begin-end.
 
On Jun 28, 8:51 am, romi <webe...@gmail.com> wrote:
On Jun 26, 3:09 am, Jonathan Bromley <jonathan.brom...@MYCOMPANY.com
wrote:



On Tue, 26 Jun 2007 06:57:14 -0000,

solotim <solotim...@gmail.com> wrote:
Meanwhile, is there anyone like to offer me some infomation about
verilog coding style please? I manage to set some pre-loaded coding
style in Veditor so it can automatically format user's code.

Yippeee - we can have "brace wars" just like in C!

if (...) begin
....
end else begin
....
end

vs.

if (...)
begin
....
end
else
begin
....
end

vs.

if (...)
begin
....
end
else
begin
....
end

vs.

if (...)
begin
....
end
else
begin
....
end

Let the entertainments begin!
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services

Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
jonathan.brom...@MYCOMPANY.comhttp://www.MYCOMPANY.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.

I use the first style. It is the most compact, lowest number of lines
and least amount of indenting, and the "real" code still stands out
making it readable. I must also add that I wish we could just use
curly braces instead of begin-end.

I use the third style because I like to see the "begin" and "end"
on their own lines. My major gripe about indenting is editors that
store tabs in the source file instead of converting to spaces. This
invariably leads to totally unjustified output when another person
opens the file with a different tab setting. By the way I'm currently
using Med with my own language settings file for Verilog, but I'm
not 100% happy with any editor. Big pluses for me include column
editing, regular expressions, and keystroke macros. Minuses include
inability to include line ends in search and replace operations.
I'd rather not use an editor with "smart" indenting if it forces
me to use a style I'm not comfortable with. Another indenting point
is separate indenting for `ifdef `else `endif. Many C editors like
to start all preprocessor commands in the left column even if they
are nested. I prefer to use indentation for nested preprocessor
commands as well. You'll never get everyone to agree on what is
"pretty" for source code editing, but having one automatic style
would be useful as long as I can turn it off.

Good Luck,
Gabor
 
Thank you all for the reply.
After reading your opinions, I felt "code style" is a fairly
subjective thing and quite hard to be unified. (Otherwise the
ISO should adopt one :))

ghel...@lycos.com
I've been letting "Mac's Verilog Mode" format my code for a while now,
and I've gotten quite used to that style.
PS: I've started using Veditor, and I like it. Thanks for making it.
I don't know "Mac's Verilog Mode" before you mentioned it. Have been
googled, this style is exactly my favoirate, and it accords with the
first style of the "brace war".
Thank you for supporting veditor. I'm just a new member of veditor-
developer
group, so those "thanks" should be owed to Tadashi(main developer) and
others.

romi
I must also add that I wish we could just use curly braces
instead of begin-end.
me too, although we can do nothing about it.

gabor
You'll never get everyone to agree on what is
"pretty" for source code editing, but having one automatic style
would be useful as long as I can turn it off.
I agree, so I'm trying to set some pre-load styles from which you can
select one
or none.

Best regards.

Frank
 

Welcome to EDABoard.com

Sponsor

Back
Top