Wings 3D Development Forum
Where are the Erlang Style/Coding guidelines from Bjorn? - Printable Version

+- Wings 3D Development Forum (https://www.wings3d.com/forum)
+-- Forum: Wings 3D (https://www.wings3d.com/forum/forumdisplay.php?fid=1)
+--- Forum: Design & Development (https://www.wings3d.com/forum/forumdisplay.php?fid=6)
+--- Thread: Where are the Erlang Style/Coding guidelines from Bjorn? (/showthread.php?tid=1059)



Where are the Erlang Style/Coding guidelines from Bjorn? - ggaliens - 02-06-2015

Where are the Erlang Style/Coding guidelines from Bjorn?

I want to re-read them and get them back in my head.

Micheus ? If you find them and you stickly link them if there are not readily findable and I'm just being silly-blind.

Please let me know. Thanks.


RE: Where are the Erlang Style/Coding guidelines from Bjorn? - micheus - 02-06-2015

It's on his wings3d repository: link


RE: Where are the Erlang Style/Coding guidelines from Bjorn? - ggaliens - 02-06-2015

Cool. Thanks.

And on a related topic ... do you know how a developer is supposed to handle situation where he/she wants to
"insert" some new function in existing menu ... but the numbers for string translation are already "PACKED" so that no integer based insert canbe done w/o large resequcing ?

I assume it would be BAD to renumber all the items in the list as that would break the translation files ?

I don't know how it is supposed to work in this case so any imaginations or practical knowledge you might share would be appreciated.


RE: Where are the Erlang Style/Coding guidelines from Bjorn? - micheus - 02-07-2015

(02-06-2015, 10:26 PM)ggaliens Wrote: do you know how a developer is supposed to handle situation where he/she wants to "insert" some new function in existing menu ... but the numbers for string translation are already "PACKED" so that no integer based insert canbe done w/o large resequcing ?
You know, the numbers must be unique for each function name defined in a module.
If the new insertions are made in his/her plugin code there is no problem since the strings are stored in .lang for that source file ({source file, [{funcion_name, [{num, string},...]]}, ...]}).
If the new insertions are made in a existent code, then he/she should look for the next available number in the sequence for that function name.

Quote:I assume it would be BAD to renumber all the items in the list as that would break the translation files ?
yes.

Have I clarified your doubts? (you know, sometimes I don't know use the right English words Smile)


RE: Where are the Erlang Style/Coding guidelines from Bjorn? - ggaliens - 02-08-2015

I had no doubts. The Problem has not been "addressed".

If a developer wants to "INSERT" a new function ... and said function BELONGS in the middle of a sequnce that is already "PACKED" with respect to the string numbers used ... it seems at this new time and place ... numbers must either (a) be resequenced ... or (b) be out of order.

1
2
3
4 Some old function
100 My new function
5 Some other old function
6
7
8
9

Might have been better to have used floating point or outline style numbers like

1.2.3.1

Meh. Just not sure what I'm supposed to do ... that's all.


RE: Where are the Erlang Style/Coding guidelines from Bjorn? - micheus - 02-08-2015

(b)

If you need to know what is the number you have to "start count" - and if seems to be hard to count it in the source file - just look inside the .lang file. It's in order there.
It does ' need to be sequential - but should. So, you can use a pattern like this:
Fun1
101 (like 1.01)
102
103
Fun2
201
202
203
...


RE: Where are the Erlang Style/Coding guidelines from Bjorn? - ggaliens - 02-08-2015

Yeah. OK. I guess that's good enough and is expected answer.

In many modules I'm in ... nobody has done any "insert". But I think the placement of the item in he list from top to bottom should be more important than the flow of the string sequence numbers. So yeah ... I'll use 100, 200, etc if I need to.

Thanks.