jurchiks Posted October 1, 2013 Report Share Posted October 1, 2013 ... t.i. tu right-paddo stundu nosaukumus ar punktiem, un ja nav stundas, tad vnk izvadi max. punktus?? srsly? Quote Link to comment Share on other sites More sharing options...
codez Posted October 1, 2013 Report Share Posted October 1, 2013 (edited) Negribās lamāties, bet jāprasa, tu esi d......? Tas taču ir tikai piemērs. Codepadā nevar noformēt ar html, tāpēc izmantoju padošanu ar punktiem, lai uzskatāmi varētu redzēt piemēra rezultātu. Edited October 1, 2013 by codez Quote Link to comment Share on other sites More sharing options...
Kavacky Posted October 2, 2013 Report Share Posted October 2, 2013 Negribās lamāties, bet jāprasa, tu esi d......?++ Quote Link to comment Share on other sites More sharing options...
metal-0-1 Posted October 2, 2013 Author Report Share Posted October 2, 2013 Vienkāršakais variants uztaisam Btw, vai šeit vienkāršākais lasās arī kā sliktākais? Liekas ka šis der praktiski visam, kas man vajadzīgs, bet vai ir vēl kāda situācija, kur šī vietā būtu jāpieiet kaut kā citādāk, sarežģītāk? Quote Link to comment Share on other sites More sharing options...
daGrevis Posted October 2, 2013 Report Share Posted October 2, 2013 Vari vadīties pēc šī te. > Beautiful is better than ugly. > Explicit is better than implicit. > Simple is better than complex. > Complex is better than complicated. > Flat is better than nested. > Sparse is better than dense. > Readability counts. > Special cases aren't special enough to break the rules. > Although practicality beats purity. > Errors should never pass silently. > Unless explicitly silenced. > In the face of ambiguity, refuse the temptation to guess. > There should be one-- and preferably only one --obvious way to do it. > Although that way may not be obvious at first unless you're Dutch. > Now is better than never. > Although never is often better than *right* now. > If the implementation is hard to explain, it's a bad idea. > If the implementation is easy to explain, it may be a good idea. > Namespaces are one honking great idea -- let's do more of those! Quote Link to comment Share on other sites More sharing options...
Kavacky Posted October 3, 2013 Report Share Posted October 3, 2013 Liekas ka šis der praktiski visam, kas man vajadzīgs, bet vai ir vēl kāda situācija, kur šī vietā būtu jāpieiet kaut kā citādāk, sarežģītāk?Jā, tad kad praktiski nederēs visam, kas tev vajadzīgs. Quote Link to comment Share on other sites More sharing options...
jurchiks Posted October 4, 2013 Report Share Posted October 4, 2013 @daGrevis - noice, izņemot to special cases punktu; bet varbūt ne tā saprotu. Quote Link to comment Share on other sites More sharing options...
Kavacky Posted October 4, 2013 Report Share Posted October 4, 2013 Nē, tam punktam tur jābūt. Quote Link to comment Share on other sites More sharing options...
jurchiks Posted October 4, 2013 Report Share Posted October 4, 2013 (edited) Nu un ko, piemēram, darīt, ja tev ir HTML tabula/unordered lists, kurā visi rowi/itemi, izņemot vienu, ielien 80 char line length robežā, bet viens ir par 5-10 chariem garāks? Rule says 80 chars, I say fuck it - lai ir 90 chari, at least looks consistent - nav jālauž kaut kā debīli, lai tik ielīstu tajos 80 charos. Edited October 4, 2013 by jurchiks Quote Link to comment Share on other sites More sharing options...
daGrevis Posted October 4, 2013 Report Share Posted October 4, 2013 Tad nu gan piemērs par HTML. Tur vairāk ir runa par programmēšanu. Quote Link to comment Share on other sites More sharing options...
jurchiks Posted October 4, 2013 Report Share Posted October 4, 2013 (edited) Nu labi, PHP kods, kurš printē kaut kādu statisku masīvu, piemēram, breadcrumbs. Same shit. Edited October 4, 2013 by jurchiks Quote Link to comment Share on other sites More sharing options...
daGrevis Posted October 4, 2013 Report Share Posted October 4, 2013 Nu es problēmu risinātu savādak, nevis ar `if length == 80`. Vari uzlikt kolonas platumu kā staipīgu, atkarībā no vārda garuma. Vai, `max(length(words), 80)`. Ir risinājumi, kas ir daudz elegantāki par vienu kondišionalu vienai kolonai — vajag tikai nedaudz padomāt. ;) Quote Link to comment Share on other sites More sharing options...
jurchiks Posted October 4, 2013 Report Share Posted October 4, 2013 (edited) $breadcrumbs = array( 'item1' => array('name' => 'Abc', 'link' => '/path/to/abc/'), 'item2' => array('name' => 'Def', 'link' => '/path/to/def/'), 'item3' => array('name' => 'Ghi', 'link' => '/path/to/ghi/'), 'item4' => array('name' => 'Omg wtf long name', 'link' => '/path/to/omg-wtf-long-name/') ); Edited October 4, 2013 by jurchiks Quote Link to comment Share on other sites More sharing options...
daGrevis Posted October 4, 2013 Report Share Posted October 4, 2013 ? Quote Link to comment Share on other sites More sharing options...
jurchiks Posted October 4, 2013 Report Share Posted October 4, 2013 (edited) Gribi lauzt to item4 2+ līnijās? Es nē. Special case, kas, manā gadījumā, ir special enough, lai neievērotu line width rūli. Edited October 4, 2013 by jurchiks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.