Re: Do You Have (Or Have You Seen) Twitches in Programming ?
Posted: Thu Sep 20, 2012 8:25 am
Exactly. Most of the smaller elements of code style is mere opinion, though that opinion is often dear to us (it is in my case anyway).
They exist as a defensive measure against C's assignment syntax being a valid conditional statement. For instance, this is a common bug in C:IMP1 wrote:Is there anything actually wrong with the yoda conditions, or is it just unusual and so harder to read?
Code: Select all
if (c = 5) doSomething();
/* Branch is unconditional, as 5 is logically true. C is unintentionally modified. */
Code: Select all
_={_=_G}for--[[]]__--[[]]in(next),_["_"]do(_)[_]=(__)_[#_[_]],_[_[_]:byte(-#"#"
)+#_[_]-(#{}+#"(#''"*#"*#*#*"*#"_[_[]]")]=_[_],_[_]end(_)[_]=_._[_[#""]]{[_._[_
[#""]]]=_}_[""]=_._[_._[_[#[=[=#=]=]*-((#[=[#[=]#]=]))]](_._[_[-#[[_[-#[#_[_]]]
](_))]_[";"]=_._[_[#"#"+(#")#^")^#"#^"]]_["'"]=[[sub]]_['"']=_[""][_["'"]]_["/"
]=[[/_)=.,[#"('*:^;+]]_["'"]=_[""][_['"'](_[-#[[=[=]=]]],-#",_",-#"..").._["'"]
]_["["]=_['"'](_[-#"#-]_"],#",",#{_}).._['"'](_[-#"-"],#",",#"#").._['"'](_[-(#
"^#^")^#"^#"],#"-",#"(").._['"'](_[#_[-#"#"]*-#"[#"],#_[-#"#"],#_[-#"#"]).._[''
..'"'](_[-#[[=[]=]]],#_["/"]/#_["/"],#"/").._['"'](_[-(#"#)-")^#[[""]]],-#"-,",
-#[=[[]]=])_["]"]=_['"'](_[-#_[-#"-"]],#",",#"#").._[";"](_["["]..[=[('\]=]..(#
'#).'*#',..]]'*#'",#"#",'-#'(').."')")().._['"'](_[-#_[-#"-"]],-#_[-#"-"]-#"-",
-#_[-#"-"])_['_']=_[";"](_["["]..'(_[""].'.._[";"](_["["]..[[('\]]..((#_["/"]+#
"'")*#"#*("*#"..").."')")().._['"'](_[#_[-#"_"]*#"[_"],-#"#-,",-#"(,").._['"'](
_[-#_["/"]],-#",",-#"(")..'(_["/"],...,#"#","")-#"#")')_[";"](_["'"](_["'"]([[]
#/#)[([;#.))."[,[:[:[+)/,#[+#)[:[.)))^)^#/#)[([;#.))."[,[:[:[+)/,#[+#)[:[.)))^]
]],"[^".._["/"].."]",""),"(.)(.)",_[";"]("_['.'],_['#']=...".._["["].."(_['']."
.._["]"].."(_['_'](...)*#_['/']+_['_'](_['#'])))")))(...)_={#{...},#{#{}},#"#"}
Code: Select all
A = string.char( (#'##')^(#'######') + (#'#') )
Great, looking forward seeing that. Be sure to dispose a fire-extinguisher near your workplace.Inny wrote:This is going to bake my noodle this weekend. I'll probably be back here on sunday night with my own version of this.
Code: Select all
_={_=_G
}for--[[--]]__
in(next),_["_"]do
(_)[_]=(__)_[#_[_]]
=_[_]_[_]="sub"end(_)
[_]=_[_] [_[_]]_[_._]=#"_._"_[
_[_._]]=_[_](_[_[_._]*_ [_._]],_[_._],_[_._
]).._[_](_[(_[_._]+_[_._]/_[_._ ])*_[_._]],_[_._]/
_[_._]+_[_._]/_[_._],_[_._]).._[_](_[_ [_._]*_[_._]],_
[_._]+_[_._]-_[_._]/_[_._],_[_._]+_[_._]-_[ _._]/_[_._]
).._[_](_[_[_._]*_[_._]],_[_._],_[_._]).._[_](_[ _
[_._]*_[_._]],_[_._]/_[_._]-_[_._] ,_[_._
]/_[_._]-_[_._])_[_[_._]*_[_._]+_ [_._]-
_[_._]/_[_._]]=(_)_[_[_._]*_[_._]+ _[_._
]+_[_._]/_[_._]]=(_)_[#_+_[_._]/_[ _._]]
=_._[_[#_-_[_._]-#_/#_]]_[_[#_]]=_[ #_](_[
_[_._]].."(".._[#_-#_/_[_._]].."('" .._[_[_
._]]..[[("\\'..(...+#_*(_[_._]+_[_._] ))..'")')
)()]])_[_[#_]]=_[_[_._]][_[_[#_]](_[_. _]*_[_._])
.._[_[#_]](#_-_[_._]/_[_._]).._[_[#_]](_ [_._]+_[_._]
+_[_._]/_[_._]).._[_[#_]](_[_._]^_[_._]-_[_ ._])]_[_[_[#_]](
#_)]=#_*#_/_[_._]_[_[_[#_]](#_)]=_[_[_[#_]](#_)]+_[_[_[#_]](#_)]/_[(
_._)]_._[_[ _[#_]](_[_[_[#_]](#_)]+#_-_[_._],_[_[_[#_]](#_)]+#_-
#_/#_,_[_[_[ #_]](#_)]+#_/_[_._],_[_[_[#_]](#_)]+#_-#_/_[_._], _[
_[_[#_]](#_) ]+#_+#_/#_)](_[_[#_+_[_._]-_[_._]]](#_*#_/_[_._]-_[_.
_],_[_[_[#_] ](#_)]+_[_._] /_[_. _],_[ _ [_[#_]](#_)]+#_
/_[_._]+_[_. _],_[_[_[#_]]( #_)]+ #_/ _[_. _]+_[_._],_[_[
_[#_]](#_)] +#_-_[_._]-_[_ ._]/_ [_._ ],#_ +#_+_[_._]-_[
_._]/_[_._] ,#_*(_[_._]+_[ _._]) -_[_. _ ],_[_[_[#_]](
#_)]+#_-_[ _._]-_[_._ ]/_ [_._] ,_[_ [_[ #_]](#_)]+#_
-#_/#_,_[ _[_[#_]]( #_) ]+#_/ _[_ ._]+ _[_._],_[_[
_[#_]]( #_)],# _+#_ +# _ /# _ + #_/#_,_[_
[_[#_ ]](#_) ]+_ [_._ ]-_ [_._]/_[_
._],_[_[_[#_]](#_)]+#_-_[_._]/_[_._],(_[_._])^_[_._]*(_[
_._]+_[_._]/_[_._])+_[_._],_[_[_[#_]](#_)]+_[_._]*_[_
._],#_+#_+#_/#_+#_/#_,#_*#_/_[_._]+_[_[_[#_]](#_)]/
_[_[_[#_]](#_)],_[_[_[#_]](#_)]+#_+_[_[_[#_]](
#_)]/_[_[_[#_]](#_)]+_[_[_[#_]](#_)]/_[_[
_[#_]](#_)],_[_[_[#_]](#_)]-_[_._]))
_._=_[_[_._]][_[_[_[#_]](#_)]
]_[(#_)^#_-(#_)-#_]=
_._
BTW " let's talk about Javascript." that remind me a videoInny wrote:Oh man, that reminds me of that javascript program that can essentially do anything without using any alphanumeric characters. It boiled down to floating into the window and getting the characters you needed from the names of functions you knew would be there.Roland_Yonaba wrote:
I only do that when writing test code, but I cannot handle too much code like that. I do it plenty times in lua.org/demo.html because i cba to press space 4xNsmurf wrote:That lua logo is **AWESOME**
I'd say the worst habit of mine is not indenting. When I start coding, I just want to get something up and running, so I don't think about indenting, then it ends up as a habit, and I'm to lazy to go back and fix to If I start with something that's indented though, I'm fine...