#qi-hardware IRC log for Wednesday, 2012-01-04

wolfspraulMade in Optimistan10:41
wolfspraulBen NanoNote and Milkymist One are Made in Optimistan10:41
whitequarkso... pink11:09
whitequark*brain melts*11:10
wpwrakwhitequark: so that's what happens when barbie goes to university, takes philosophy classes, and finds an HTML editor someone left open in a classroom PC12:08
wolfspraulI see - optimism unleashes its irresistible power :-)12:16
wolfspraulwpwrak: what space/tab convention do you prefer personally?12:16
wolfspraulin c sources12:16
wpwraklinux kernel style. one tab per indentation level. four spaces for wrapped lines. void *foo(int bar)\n{\tvars;\n\tbody;\n}  and  \tif (cond) {\n\t\t...\n\t}12:20
blogicwpwrak: \o/12:20
wpwrakmax 80 characters per line. if you have to wrap anyway, make it < 80.12:21
blogicwpwrak: penalties for using spaces as indentation need to be imposed12:21
wpwrakblogic: oh, lots of editors auto-handle this. what's important is that it's 8 :)12:21
wpwraki.e., there's a penalty in indenting. keeps you from writing ten levels deep nested madness - simply because there's no room for it :)12:22
Aylawhat editor are you using?12:22
wpwrak(but any vi will do)12:22
Aylahere I get two spaces after a IF without brackets, instead of a real tab12:23
Aylado you know how to change that?12:23
wpwrakdunno. i don't use auto-indentation :)12:24
wpwrakafter a while, your fingers learn to do this on their own :)12:24
Aylawell, then there's litle point to use VIM instead of gedit for instance12:31
wolfspraulwpwrak: 8 or 4? (first you say "4 spaces for wrapped lines" then "important is that it's 8"12:32
wpwrakdon't know gedit. i like the compact and logical UI of vi12:32
wpwrakwolfspraul: 8 per indentation level. +4 for wrapping. e.g., \tfoo = very_long_identifier(\n\t    argument, argument,\n\t    still_more);12:33
wolfspraulok, got it12:34
wpwraklet's see what else ... spaces around operators except for unary and basic arithmetic (+, -, *, /)12:42
wpwraksizeof(foo) looks like a function. return foo; doesn't. switch and case at the same level (that's a bit of a compromise - otherwise, switch gets too messy to use)12:43
wpwrakspace between cast and thing being cast. no pascal parentheses in boolean expressions. (i.e., a == b && c == d and not (a == b) && (c == d) )12:44
wpwrakyeah, i think that's most of it. many more small details, of course )12:46
wpwrakah, also if .. else follows kernel style. so if (foo) bar; else blah; or if (foo) { bar; ...; } else { blah; ...; } or even if (foo) bar; else { blah; ...; } but not if (foo) { bar; ...; } else blah; instead, use if (foo) {bar; ...; } else { blah; }12:47
AylaI don't agree with switch/case12:48
Aylaand the kernel guidelines forbid if (foo) bar; else { blah; ...; }12:49
Aylait should always be if (foo) { bar; } else { blah; ...; }12:49
Aylawhen there's a "else", that is12:49
Aylaand even if "bar" is a single line of code12:49
wpwrakAyla: this was discussed sometime ago on lkml and the verdict was that if (cond) one; else { one; two; } is okay13:07
wpwrakthe example in CodingStyle is is (cond) { one; two; } else { one; }13:07
wpwraks/is is/is if/13:07
wpwrakbut that was a long long time ago :)13:08
wpwrakanyway, gotta run. dentist is waiting13:08
DocScrutinizer51wpwrak: which direction are you running?13:13
DocScrutinizer51toward or away from dentist?13:13
lars_wpwrak: just wanted to ask, when "sometime ago" was. CodingStyle is very explicit about that if one part has brackets the other part should have brackets two.13:44
wpwrakDocScrutinizer: toward :) it's the fitting of a crown. the nasty bits are already done.15:28
wpwraklars_: hmm, maybe ~6 years ago. lemme see if there are still any traces around15:29
wpwrakhmm, some old wisdom i found while searching: http://www.cs.helsinki.fi/linux/linux-kernel/2001-03/0260.html15:50
wpwrakfound the thread. was only a bit more than two years ago. and i mis-remembered:  if (foo) x; else { y; z; }  is still considered objectionable. just  if (foo) x; else y;  isn't.16:01
wpwrakhere's the thread; http://openmoko-public-mailinglists.1958.n2.nabble.com/PATCH-ASoC-Clean-up-coding-style-issues-in-GTA02-td2580184.html16:01
DocScrutinizerEEEEW!  (i.e., a == b && c == d and not (a == b) && (c == d) )19:01
wpwrakunlearn your pascal :)19:02
wpwrakall those redundant parentheses just make the code hard to read19:03
wpwrakC has a very thoughtfully designed precedence system. there's no need to pretend it's the mess wirth has created in pascal.19:04
DocScrutinizera == b && c == d || a == b & c == d | a = b & c == d && a |= b & c == d 19:04
DocScrutinizerindeed, every thoughtful19:05
wpwrakthat's why the great gnu has created compiler warnings :)19:06
qi-bot[commit] Jiri Brozovsky: Compiler from (limited) C to language used by HP48 calculators (master) http://qi-hw.com/p/openwrt-packages/5edbd6c19:09
whitequarkI think that C's operator system can be improved19:18
whitequarkjust borrow from perl19:18
DocScrutinizeryeah, they tried to fix C compilers that way. The first C 'compilers' were actually bloated macro assemblers for a simple reason of hw not allowing anything better. So C isn't designed for coders but for optimal RAM footprint and CPU usage of the compiler itself, and no compiler warnings level will turn C into a decent coding language. Actually the fewer the syntactic alternatives to code one semantic chunk, the better for readability19:19
wpwrakDocScrutinizer: please go on, while millions of happy C programmers productively ignore your ranting ;-)19:22
DocScrutinizerwhich ranting? I'm just stating age old known facts19:23
DocScrutinizerand I'm happy with assembler even19:23
DocScrutinizerif you want to to start ranting, ask me about my notion regarding redundancy of ms-basic constructs: while 'condition' do bla blub enddo.  vs repeat bla blub until not 'condition'.19:26
DocScrutinizers/to to/me to/19:26
wpwrakrants against ms-basic are about as relevant as placing dinosaur traps ;-)19:29
blogicis ranting about gw-basic ok ? :D19:32
DocScrutinizerwhatever, on a human logic level your arguments about readability due to precedence system conflict with your recourse to compiler warnings which for sure weren't invented because nobody ever is messing up a term like a == b && c == d by leaving out one char19:34
DocScrutinizeror put simpler: I don't agree on a == b && c == d being ANY readable19:36
DocScrutinizera && b << 3 | c == d19:38
DocScrutinizera & b < 3 || c = d19:38
DocScrutinizera && b < 3 || c == d19:39
DocScrutinizera && b < 3 | c == d19:40
viricgcc managed to compile C without any optimal ram footprint19:41
viricdoes that turn C more decent?19:41
DocScrutinizerneither you nor gcc existed when the compilers were built according to my above rationale19:42
DocScrutinizerC however existed already19:42
DocScrutinizerC is an extremely powerful macroassembler, nothing beyond. A lot of experienced coders will agree on that19:43
viricand what new exactly does your idea bring?19:44
DocScrutinizerand what new does your question introduce to the topic?19:45
blogici thinkt the answer is "the above rational" or not ?19:45
DocScrutinizerI think you lost me19:46
blogicwhere is the sed bot ß19:46
DocScrutinizerand the answer is 42, always been19:46
viricMaybe it is me who got lost :)19:47
viricI find C ok for its job19:48
DocScrutinizeranother undeniable fact is that *read*ability increases with redundancy, until it crosses a certain threshold. It maybe *write*ability that's better without "redundant" parentheses etc19:49
viricdo you like lisp? :)19:50
viricC is quite a good balance between the complexity to write/read and the complexity of writing a compiler for it.19:51
viricgiving enough granularity to the programmer to achieve code that runs fast19:52
DocScrutinizernonsense, nowadays no high level procedural language lacks the opportunity to allow coders to write fast code20:15
whitequarkblogic: sed bot is too stupid to understand perl syntax. just s///, nothing more.20:24
whitequarkbtw, this rant is funny20:25
whitequark(note that I'm not saying any of the above is not true. just funny a bit.)20:26
blogici thinkt the answer is "the above rational" or not ?20:34
wolfspraulpeople surely love that feature ;-)20:57
wolfspraulwe should get some of those interactive fiction bots into the channel...20:57
DocScrutinizerluckily buffer size is limited20:57
DocScrutinizerwhat annoys way more is you can't fix 2 typos with sedbot20:59
DocScrutinizerunless they are identical20:59
DocScrutinizertis sucks somtimes21:00
DocScrutinizeractually it's probably not exactly the buffersize that's limited, rather the max length of a single post as defined by freenode21:17
DocScrutinizerwhitequark: sedbot it just not editing anything but the least post - blogic's last post was >>[2012-01-04 20:45:57] <blogic> +e<<21:33
DocScrutinizerand even /g parameter isn't meant to change that21:33
DocScrutinizera funny idea though: s/x/y/G edits *all* posts ever posted by the user since last /join ;-D21:35
DocScrutinizerwolfspraul: what do you think, will users love *that*? ;-)21:35
DocScrutinizersillii idea to think sedbot would act on all lines starting with "s" ;-D21:59
DocScrutinizers/illii/illy/;some illegal command22:01
DocScrutinizers/ok/OK/;!seen DocScrutinizer51 22:02
DocScrutinizerin fact, I think: not even that will work22:04
DocScrutinizerthete's not been any /g22:05
DocScrutinizerI I wonder22:06
DocScrutinizers/I //22:06
DocScrutinizernow THAT is *BAD*22:07
DocScrutinizeribot/infobot/apt obeys /g22:08
DocScrutinizerqi-bot has a bug22:08
DocScrutinizeram I right in thinking qi.bot has a fine bug in this regex-sustition function?22:11
DocScrutinizerwho's qi-bot's master?22:15
jow_laptopyay, Bitcoin spam via twitter relayed to IRC22:59
wolfspraulyay well23:00
wolfspraulI actually clicked on the link to see whether there is open hardware there, but couldn't find it right away23:00
wolfsprauljow_laptop: what do you think about bitcoins?23:08
wolfspraulseems at some point a technology like that begs for dedicated secure hardware23:08
wolfspraulwhich should be open to be secure imho23:08
rohwolfspraul: bc arent the answer to the question for digital money. they are an experiment stirring stuff up to see whats possible.23:18
wolfspraulyes, roughly my thinking too. but as a transaction medium they work today, I would sell nanos and milkys for bitcoins, no problem.23:19
wolfspraulalso the combination of cryptography and networking is so interesting, maybe it can be used for other applications23:20
wolfspraulfrom a hardware side, I think this stuff cannot work unless there is secure hardware23:20
rohin the end it boils down to a technical issue. how to make sure its an exchange currency and not a currency imploding as the real ones right now due to speculation23:21
DocScrutinizerbitcoin, a chain letter philosophy concept23:31
wolfspraulwell I'm a small business man, and I am struggling with payment systems every day23:36
wolfspraulevery time I struggle, I think of bitcoin now and there is *hope* :-)23:36
wolfspraulthank you bitcoin!23:36
wolfspraulso I definitely sell hardware for bitcoins, no problem23:37
wolfspraulDocScrutinizer: you send me some bitcoins, I send you a Milkymist One ;-)23:37
wolfspraulI do not believe in the revolutionary part of bitcoins though, they will not replace other currencies etc.23:38
wolfspraulbut maybe a small little payment system, for geeks first? right now it seems to work...23:38
wolfspraulunless someone breaks through the crypto part right away and makes an infinite number of them, I think they will continue to stay around23:39
DocScrutinizerI found nobody who was able to convince 9 others and me about bitcoins being a thing worth looking into23:40
DocScrutinizerand tbh I'm not looking for somebody23:40
erikkugeleverything has it's merits, but bitcoin's main advantage currently is hiding illegal activity. Once it had OTHER advantages, popularity might grow.23:41
--- Thu Jan 5 201200:00

Generated by irclog2html.py 2.9.2 by Marius Gedminas - find it at mg.pov.lt!