Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

Python readability through descriptive naming -


i have been using python year now, coming java background. found python quite easy learn because of focus on readability , simple design. thing don't understand python why language focuses heavily on readability, uses non-descriptive names modules, functions, constants etc.. 1 thing java descriptive class/attribute/method names (i objective-c more reason). seems python programmers in general seem have taken c type approach naming use short names possible everything. know wants little typing possible lot of programmers spend majority of time reading code rather writing find choice between short non-descriptive names , long descriptive names, easy 1 make. (i longer descriptive names xd)

a few examples, looking @ modules in standard library,

  • sched — event scheduler, have been eventscheduler?
  • asyncore — asynchronous socket handler, asynchronoussockethandler?
  • imghdr — determine type of image, determineimagetype?
  • pickle?

i know isn't huge issue find myself more not having meaning of new (or forgotten) module come across when in other languages objective-c or java can meaning straight away modules/functions/attributes definition. on note, people tend write code similar way standard library written can sure if standard library uses non-descriptive names average developer use more non-descriptive names.

i wondering know why is?

i guess there's balance struck between being descriptive , concise, , python's scripting background makes more concise java (because hobbyists lazy typing ;-) ). @ risk of sounding fanboy, python tries walk line between descriptive-but-long (java), , short-but-tricky (*cough*perl).

things used , understood can short, have str type rather asciistring or unicodestring (python2/3 respectively). more specialised functions, urllib.urlencode or random.normalvariate longer names.

the core language kept simple (e.g. there no character type, one-character strings). idea there's "one right way it", along duck typing, mean there's no need names do_something_with_type_a. and, while it's excuse, there clear documentation that's not obvious.

as itertools? module name doesn't matter, it's grouping of functions. of functions clearer (chain, cycle, repeat), less (islice, izip). suppose assume concepts "zipping" , "slicing" straightforward once you're familiar python.

sched/asyncore/imghdr: admittedly brief , undescriptive, i've never seen of them used. date days of 8-character filenames, , updating them has never been priority.

pickle: quirky, have once, it's obvious. couldn't call "serializer", because it's specific serialisation, not generic framework.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -