| ▲ | someothherguyy 4 days ago |
| setup_spi(
&adc,
mode=SPI_01,
rate=15,
cs_control=CS_MUXED,
cs=0x01
);
setup_spi(
&eeprom,
mode=SPI_10,
rate=13,
cs_control=CS_MUXED,
cs=0x02
);
setup_spi(
&mram,
mode=SPI_10,
rate=50,
cs_control=CS_DIRECT,
cs=0x08
);
ftfy |
|
| ▲ | DonHopkins 4 days ago | parent | next [-] |
| This is good, and objectively better than letting the random unbounded length of the function name define and inflate and randomize the indentation. It also makes it easier to use long descriptive function names without fucking up the indentation. setup_spi(&adc,
mode=SPI_01,
rate=15,
cs_control=CS_MUXED,
cs=0x01
);
setup_spoo(&adc,
mode=SPI_01,
rate=15,
cs_control=CS_MUXED,
cs=0x01
);
setup_s(&adc,
mode=SPI_01,
rate=15,
cs_control=CS_MUXED,
cs=0x01
);
validate_and_register_spi_spoo_s(&adc,
mode=SPI_01,
rate=15,
cs_control=CS_MUXED,
cs=0x01
);
|
| |
| ▲ | DemocracyFTW2 3 days ago | parent [-] | | Here, fixed it for you: setup_spi(
&adc,
mode = SPI_01,
rate = 15,
cs_control = CS_MUXED,
cs = 0x01 );
setup_spoo(
&adc,
mode = SPI_01,
rate = 15,
cs_control = CS_MUXED,
cs = 0x01 );
setup_s(
&adc,
mode = SPI_01,
rate = 15,
cs_control = CS_MUXED,
cs = 0x01 );
validate_and_register_spi_spoo_s(
&adc,
mode = SPI_01,
rate = 15,
cs_control = CS_MUXED,
cs = 0x01 );
|
|
|
| ▲ | Marazan 4 days ago | parent | prev [-] |
| That is harder to read than the long line version. However, it is the formatting I adopt when forced to bow down to line length formatters. |
| |
| ▲ | lenkite 4 days ago | parent | next [-] | | Err..I find the short-line version easier to read. Esp if you need to horizontally scroll. This is why a Big Dictator should just make a standard. Everyone who doesn't like the standard approach just gets used to it. | |
| ▲ | someothherguyy 4 days ago | parent | prev [-] | | to you, to me, it reads nicely, and thus the issue -- editors should have built in formatters that don't actually edit source code, but offer a view | | |
| ▲ | thaumasiotes 4 days ago | parent [-] | | To me, that reads fine, but it has lost the property elevation wanted, which was that it's easy to compare the values assigned to any particular parameter across multiple calls. In your version you can only read one call at a time. |
|
|