Skip to main content

Code Style

1

All coding styles is acceptable.

Tabs or Spaces

Lines width/height

For an example possible conding style for Events.

# Don't worry about headers
_ @sys.events;
_ @os.util2;

Variant A: Simple, Default

my.ev {
# ev, o0... - event
if (_0==ui.event.button.click) {
# ..
};
};

ui.event.process4(ide.pool,nid, my.ev);

Variant C: Swift 5 lines

ui.event.process4(ui.pool,sl1, sliderSize.ev); sliderSize.ev {
# ev, o0... - event
if (_0==ui.event.slider.value.change) {
# ..
};
};

Variant B: Swift 3 lines, Minimal

ui.event.process4(ui.pool,sl1, sliderSize.ev); sliderSize.ev { # ev, o0... - event
if (_0==ui.event.slider.value.change) {
# ..
};};

Low level variants

Variant D: Slider old school. Not bad.

tb0:=1;
while(tb0) {
tb0:=ui.event(sl0);
#if (tb0==ui.event.slider.push) {
# watch(tb0);
#};
#if (tb0==ui.event.slider.pop) {
# watch(tb0);
#};
if (tb0==ui.event.slider.value.change) {
apply.modifier(line0, o0);
};
};

CPU style

Variant E: Low level CPU style

ui.event.process3 {
# b0, pool,id, fn
b0 _0;
pool0 _1;
id0 _2;

b0:=1;
while(b0) {
b0:=events.pop(u0, pool0,id0);
_3(_0);
};
};

Fortune 500

Read that code to be lucky

_ @os.util0;

new.node.common0(mel0, 0,0,1, 768/8*2,1024/8*2, node.fid.by.name(u0, ai.chat.avatar.mel), 0);
``