Monthly Archives: تیر 1394
nasser-torabzade starred dthree/vantage
حدیث هایی در مورد پستی

1- حضرت امام صادق (علیه السّلام) می فرمودند: به شما سفارش می کنم پرهیزگار باشید و با ارتکاب گناه، مردم را بر خود مسلّط نکنید و خویشتن را دچار ذلّت و خواری ننمایید.
منبع : وسائل جلد 3 ص202
2- حضرت علی بن ابی طالب(علیه السّلام) به حضرت حسین (علیه السّلام)در ضمن وصایای خود فرموده اند: کسیکه نسبت به مردم تکبّر نماید ذلیل و خوار خواهد شد.
منبع : تحف العقول ، ص88
3- و نیز فرموده اند :چه بسا عزیزانی که اخلاق ناپسند ، آنها را به ذلّت و خواری انداخته و چه بسا مردم پست و کوچکی که صفات پسندیده ، آنان را عزیز و محبوب ساخته است.
منبع : سفینه ، خلق ص411
4- حضرت امام علی (علیه السّلام) فرموده اند: بنده شهوت، اسیری است که هرگز آزادی نخواهد داشت.
منبع : غرر الحکم ،ص499و765
5- حضرت امام علی (علیه السّلام) فرموده اند: کسیکه مغلوب شهوت خویشتن است ذلّت و خواریش بیش از برده ی زر خرید است.
منبع : غرر الحکم ،ص499و765
ذلت طمع و حرص
6- حضرت امام علی (علیه السّلام) فرموده اند: ذلت و پستی و بدبختی ، در خوی ناپسند حرص و آز نهفته است .
منبع : غررالحکم ، ص96
7- حضرت امام علی (علیه السّلام) فرموده اند: در نظر افراد آگاه و درّاک، خوی ناپسند حرص، مایه ی پستی و ذلّت است.
منبع : فهرست غرر ،ص61
8- حضرت امام علی (علیه السّلام) فرموده اند: آنکس که بیماری حرص بر جانش مستولی گردد، به خواری و ذلّت بزرگ دچار خواهد شد.
منبع : غررالحکم ،ص 629
9- حضرت امام علی (علیه السّلام) فرموده اند: حرص فراوان و طمع شدید یک انسان را می توان، دلیل بدی او گرفت و به آن استشهاد کرد.
منبع : فهرست غرر، ص63
10- حضرت امام علی (علیه السّلام) فرموده اند: کسیکه صفحه ی خاطر را از پستی طمع پاک نکند خویشتن را ذلیل و پست کرده و در قیامت به خواری و اهانت بیشتری گرفتار است.
منبع : غررالحکم ، ص690
11- حضرت امام علی (علیه السّلام) در عبارتی کوتاه و حکیمانه تنافی چند خواهش نفسانی را با یکدیگر بیان فرموده اند: چه عجیب و حیرت آور است کار بشر، اگر در موردی امیدوار شود طمع خوارش خواهد کرد ،اگر طمع او را به جنبش درآورد، حرص هلاکش می کند، اگر دچار ناامیدی شود غم و غصّه او را می کشد، اگر به خوشبختی و سعادت رسد نگاهداری آن را فراموش می کند، اگر دچار خوف و هراس شود از ترس حیرت زده می گردد ، اگر در گشایش امنیّت قرار گیرد غافل می شود، اگر نعمت بر او تجدید شود دچار گردن کشی و بلند پروازی می گردد ، اگر دچار مصیبتی شد تأثّر و حزن او را رسوا می کند، اگر ثروتی بدست آورد دچار طغیان مالی می گردد، اگر فقر گریبان گیرش شد غرق اندوه می شود، اگر گرفتار تعب گرسنگی شد از ناتوانی زمین گیر می گردد، و اگر در خوردن زیاده روی کند از فشار شکم ناراحت می شود، پس کندرویها در زندگی بشر مضر است و تندرویها نیز مایه ی ویرانی و فساد، هر خیری را شرّی و هر نوشی را نیشی است.
منبع : آداب النفس جلد 2 ص 111- ارشاد مفید ص142
12- حضرت امام علی (علیه السّلام) فرموده اند: حرص شدید به لذائذ و مشتهیات نفسانی ، آدمی را گمراه می کند و از راه سعادت و رستگاری منحرف می سازد و سرانجام باعث هلاکت و نابودی او می شود.
منبع : غررالحکم ،ص781
13- حضرت امام علی (علیه السّلام) فرموده اند: بردباری در فقر تؤام با عزّت ، بهتر از ثروت آمیخته به خواری و ذلّت است.
منبع : غررالحکم ،ص89
14- حضرت امام علی (علیه السّلام) فرموده اند: گرسنگی بهتر از ذلّت سرافکندگی و زبونی است.
منبع : فهرست غرر، ص125
15- حضرت امام علی (علیه السّلام) فرموده اند: گدائی طوق ذلّتی است که عزّت را از عزیزان و شرافت خانوادگی را از شریفان سلب می کند.
منبع : غررالحکم ،ص96
16- حضرت امام علی (علیه السّلام) فرموده اند: مردم از ترس خواری به سوی ذلت و خواری می شتابند و با این کار، پستی و حقارت خویش را افزایش می دهند.
منبع : غررالحکم ، ص104
17- رسول اکرم (صلّی الله علیه و آله و سلّم) فرموده اند: بر هیچ مسلمانی جایز نیست که خود را ذلیل و خوار نماید.
منبع : تاریخ یعقوبی ،ص67
18- حضرت امام صادق (علیه السّلام) می فرمودند: آدمی از ذلت و حقارت کوچکی اظهار ناراحتی و اندوه می کند و همین جزع و بی قراری ، او را به ذلت بزرگتری گرفتار می نماید.
منبع : تحف العقول ص366
19- حضرت امام علی (علیه السّلام) فرموده اند: یک ساعت ذلّت با عزّت تمام دوران زندگی برابری نمی کند.
منبع : غررالحکم ، ص434
20- حضرت امام سجاد (علیه السّلام) فرموده اند: دوست ندارم که با ذلت نفس به ارزنده ترین سرمایه ها و ثروتها دست یابم.
منبع : مستدرک 2، ص364
21- حضرت امام صادق (علیه السّلام) فرموده اند: خداوند تمام کارهای هر مسلمانی را به خود او واگذار نموده اند مگر ذلیل کردن خود، یعنی مؤمن حق ندارد موجبات خواری و ذلّت خود را فراهم آورد.
منبع : کافی جلد 5 ص63
22- حضرت امام حسن عسکری (علیه السّلام) فرموده اند: چقدر قبیح است که در باطن مسلمان ، میل و رغبت به چیزی باشد که سبب ذلّت و خواری او شود.
منبع : تحف العقول ص489
24- حضرت امام علی (علیه السّلام) فرموده اند: مرگ ، بر زندگی آمیخته به پستی و خواری ترجیح دارد.
منبع : نهج البلاغه ، کلمه ی 390
25- حضرت امام محمدباقر (علیه السّلام) فرموده اند: بد آدمی است آنکس که در خویشتن مِیلی را بپرورد که در راه رسیدن به آن دچار ذلت و خواری شود.
منبع : محجة البیضاء جلد 4 ص108
گفتار و رفتار ذلت آمیز
26- حضرت امام علی (علیه السّلام) فرموده اند: روزی رسول اکرم بر جمعی از اصحاب خود وارد شد . آنان با گشاده روئی و حسن احترام، حضرت را سید ومولای خود خواندند. پیغمبر اکرم سخت خشمگین شد ، فرمود اینطور سخن نگویید و مرا سید و مولا نخوانید بلکه بگویید پیغمبر ما و فرستاده ی خدای ما ، سخن به راستی و حقیقت بگویید و در گفتار خود زیاده روی و غلو نکنید که گرفتار ضلالت و گمراهی خواهید شد.
منبع : جعفر پات ص184
27- روزی حضرت امام علی (علیه السّلام) بر مرکب سوار شد، جمعی پیاده به پشت سرش به راه افتادند، حضرت به آنها فرمود : مگر نمی دانید پیاده روی مردم در رکاب سوار باعث فساد اخلاق سوار و ذلت و خواری پیادگان است، برگردید و به راه خود بروید.
منبع : تحف العقول ص209
28- حضرت امام علی (علیه السّلام) در راه مسافرت شام با سربازان خود به شهر انبار آمد. در خارج شهر، مردم به رسم و آیین دوره ی ساسانیان کنار جاده زیر آفتاب به انتظار ایستاده بودند، موقعیکه رئیس مملکت به صف مستقبلین رسید، کدخدایان و تجار و بزرگان شهر یکباره به سوی آن حضرت هجوم بردند و در رکابش پیاده شروع کردند به دویدن. حضرت امام علی (علیه السّلام) از مشاهده ی این حرکت وهن آور و ذلّت بار، که منافی با آزادگی و شرافت اسلامی بود،سخت ناراحت شد و پرسید این چه کاری بود که کردید؟ گفتند: این رسم و روش ما است که به منظوربزرگداشت امرا و فرمانروایان خود انجام می دهیم. حضرت امام علی (علیه السّلام) آن روش تحقیر آمیز را به شدت نکوهش کرد و فرمود امرا و زمامدارانتان از این کار بهره ای نمی برند ولی شما با این عمل موهن، خویشتن را در دنیا به رنج و مشقت می اندازید و خود را حقیر و خوار می سازید. به علاوه در آخرت نیز عذاب و مشقت خواهید داشت و برای تن دادن به پستی و ذلت کیفر خواهید شد. سپس فرمود: چه زیان آور است مشقتی که آدمی از پی آن عذاب و کیفر بیند و چه پر منفعت است آسودگی و آرامشی که با آن ایمنی از عذاب الهی باشد.
منبع : نهج البلاغه ،کلمه ی 36
29- موقعیکه رسول اکرم (صلّی الله علیه و آله و سلّم) سواره حرکت می کرد اجازه نمی داد کسی با او پیاده راه برود مگر آنکه او را به ترک خود سوار کند و اگر پیاده از سوار شدن خودداری می نمود به وی می فرمودند شما بیشتر بروید و در مکان مورد نظر یکدیگر را ملاقات خواهیم کرد.
منبع : بحار ،ص153
30- ابی بصیر به حضرت امام صادق (علیه السّلام) عرض کرد: مردی کم بضاعت با افراد متمکن و ثروتمند رفیق سفر می شود. آنان با ثروت بسیاری که دارند آزادانه مصارف مسافرت را می پردازند ولی او قادر نیست مانند آنها خارج کند. امام فرمودند: دوست ندارم که خود را ذلیل و پست نماید ، البته با کسانی رفیق راه شود که در ثروت همانند وی هستند.
منبع : مکارم اخلاق ، ص131
31- حضرت امام محمدباقر (علیه السّلام) فرموده اند: با اقران و امثال خود مصاحبت کن و با کسانیکه مساعدت و کمک آنان بی نیازت میسازد رفاقت مکن چه این کار مایه ی ذلت و خواری است.
منبع : مکارم الاخلاق ،ص131
32- حضرت امام صادق (علیه السّلام) فرموده اند: شایسته نیست مؤمن ، خویش را ذلیل و خوار نماید. راوی سؤال می کند چگونه خود را ذلیل می کند؟ حضرت در جواب فرمود در امری مداخله می نماید که شایسته ی آن نیست و سرانجام باید از آن عذر بخواهد.
منبع : کافی جلد 5 ص64
33- حضرت امام صادق (علیه السّلام) فرموده اند: سزاوار نیست مرد با ایمان موجبات خواری و ذلت را فراهم نماید. عرض شد چگونه آدمی باعث خواری خود می شود؟ فرمود به کاری دست می زند که قدرت و طاقت انجام آن را ندارد.
منبع : سفینه (طمع) ص 93
پستی و فرومایگی
34- حضرت امام علی (علیه السّلام) فرموده اند: آنکس که خویشتن را پست و فرومایه بداند به خیر و نیکی او امیدوار نباش.
منبع: غررالحکم ص 712
35- حضرت امام هادی (علیه السّلام) فرموده اند: کسی که خود را کوچک و موهون بداند و در خود احساس حقارت کند خویشتن را از شر او در امان ندان.
منبع: بحار جلد 17 ص 214
36- حضرت امام علی (علیه السّلام) فرموده اند: زبان مردم فرومایه و بی شخصیت بر آنان حکومت می کند، هرچه می خواهند می گویند و از گفته های ناروای خود، به علت حقارت نفس، احساس شرمساری نمی کنند.
منبع: نهج البلاغه فیض ص 1079
37- رسول اکرم (صلّی الله علیه و آله و سلّم) فرموده اند: وقتی گناهکاران، سرور مردم شوند و فرومایگان پست، رؤسا مردم باشند و در جامعه به بدکاران احترام شود، باید در آنجا منتظر بلا و بدبختی بود.
منبع: بحار جلد 17 ص 41
38- حضرت امام علی (علیه السّلام) فرموده اند: موقعی که فرومایگان در بین مردم سروری و بزرگی بدست آورند آروزی خوشبختی و سعادت آن جامعه از میان می رود و درهای ترقی و تعالی به روی مردم، بسته می شود.
منبع: غررالحکم ص 412-427
39- حضرت امام علی (علیه السّلام) فرموده اند: کارهای بزرگ را به مردم پست و فرومایه سپردن باعث زوال دولتها است.
منبع: غررالحکم ص 412-427
40- حضرت امام صادق (علیه السّلام) روش برتری طلبان خشن و خودخواه را و همچنین رفتار مهرطلبان زبون و پست را مطرود شناخته و ضمن سخنان خود به عبدالله بن جندب فرموده اند: نه بداخلاق و تندخو باش که مردم به ملاقاتت بی رغبت باشند و از تو دوری گزینند و نه پست و فرومایه باش که آشنایانت تو را با دیده ی تحقیر بنگرند و آنانکه تو را می شناسند خوارت بدارند.
منبع: تحف العقول، ص 304
41- روزی حضرت علی (علیه السّلام) بر مرکب سوار شد و کسانی پیاده در رکابش به راه افتادند. حضرت عنان کشید و فرمودند: مگر نمی دانید پیاده روی افراد در رکاب سوار، باعث فساد اخلاق راکب و مایه ی ذالت و خواری پیادگان است. برگردید و پیاده با من نیایید.
منبع: تحف العقول،ص209
nasser-torabzade starred eduardoboucas/include-media
Introduction to Chain of Responsibility
In this article, we’ll explain and demonstrate the Chain of Responsibility pattern.

Definition
The Chain of Responsibility is a behavioral design pattern that processes a request through a series of processor (handlers/receivers) objects. The request is sent from one handler object to another and processed by one (pure implementation) or all of the handlers. All the handlers are part of the chain.
Two simple examples containing a chain logic are:
- a person using an ATM to get cash, (enter pin, amount, receipt);
- a help desk call (options list, press dial buttons, follow the steps).
Participants
The pattern in the short version includes:
- The Handler: defines an interface for handling requests. It can be an abstract class, which optionally implements default methods and the way to set a successor in the chain.
- Many concrete handler objects: process the request and optionally provide access to successors;
CoR can also include:
– a Client object to perform the request and set up the chain;
– a Request object;
– a Response object;
– other design patterns.
The CoR design pattern is not one that is used often, but its core logic makes it useful in several cases.
CoR is useful when:
- the handler must be determined automatically (e.g., a logging system);
- the handler cannot be known in advance (e.g., handling exceptions);
- the request must pass through a specific chain’s priority (e.g., event propagation, command propagation) or the order of the chain must be dynamic.
Basic usage
CoR is often applied in conjunction with Composite pattern, so it’s easy to treat all the handlers in the same way and dispatch the request to the chain’s successors.
Below is a basic PHP example:
<?php
abstract class BasicHandler
{
/**
* @var Handler
*/
private $successor = null;
/**
* Sets a successor handler.
*
* @param Handler $handler
*/
public function setSuccessor(Handler $handler)
{
$this->successor = $handler;
}
/**
* Handles the request and/or redirect the request
* to the successor.
*
* @param mixed $request
*
* @return mixed
*/
abstract public function handle($request);
}
Below is an example (not fully implemented) continuing with the code above:
class FirstHandler extends BasicHandler
{
public function handle($request)
{
//provide a response, call the next successor
}
}
// .. code for SecondHandler and ThirdHandler classes ..
$firstHandler = new FirstHandler();
$secondHandler = new SecondHandler();
$thirdHandler = new ThirdHandler();
$firstHandler->setSuccessor($secondHandler);
$secondHandler->setSuccessor($thirdHandler);
$result = $firstHandler->handle($request);
Advanced usage
The power behind this pattern is the flexibility and the open logic in the chain organization.
This flexibility becomes clearer with some examples.
From the BasicHandler code, it’s possible to automate the handle method (with some constraints) moving its scope from the children to the parent abstract class.
While the example below doesn’t solve all the CoR issues, it shows how the pattern can be easily restructured and adapted to different logic.
<?php
abstract class AdvancedHandler
{
/**
* @var Handler
*/
private $successor = null;
/**
* Sets a successor handler,
* in case the class is not able to satisfy the request.
*
* @param Handler $handler
*/
final public function setSuccessor(Handler $handler)
{
if ($this->successor === null) {
$this->successor = $handler;
} else {
$this->successor->setSuccessor($handler);
}
}
/**
* Handles the request or redirect the request
* to the successor, if the process response is null.
*
* @param string|array $data
*
* @return string
*/
final public function handle($request)
{
$response = $this->process($request);
if (($response === null) && ($this->successor !== null)) {
$response = $this->successor->handle($request);
}
return $response;
}
/**
* Processes the request.
* This is the only method a child can implements,
* with the constraint to return null to dispatch the request to next successor.
*
* @param $request
*
* @return null|mixed
*/
abstract protected function process($request);
}
class FirstHandler extends AdvancedHandler
{
public function process($request)
{
//do something
}
}
// .. code for SecondHandler and ThirdHandler classes ..
$firstHandler = new FirstHandler(); $secondHandler = new SecondHandler(); $thirdHandler = new ThirdHandler(); //the code below sets all successors through the first handler $firstHandler->setSuccessor($secondHandler); $firstHandler->setSuccessor($thirdHandler); $result = $firstHandler->handle($request);
The example above minimizes the methods inside the Concrete Handler (increasing the cohesion) despite the constraint on a not null response.
If it’s necessary to go to the end of the chain for each request, it’s easy to refactor the handle method returning the response when the successor is null, because the last chain’s handler doesn’t have a successor. It is also possible to use a more structured Response object.
There are several modifications to the CoR – for example, combining this pattern with others, like the Factory or Decorator pattern to obtain an incremental construction/change of the Response.
Real world examples include the making of a car (chassis, interior, exterior, painting, wheels, etc.), or the creation of a web page (header, body, content, and footer).
I encourage you to explore other pattern modifications.
Next, we’ll look at some suggestions on common CoR issues like configuring the priority and speeding up the chain.
Configuring the chain
Extracting the logic for configuring the chain’s handlers helps keep the code clean and allows for easy changes.
Using a configuration object with Dependency Injection we can make the configuration global (e.g. via a yaml file).
class Client
{
private $firstHandler;
public function setChainOrder($handlersOrder)
{
//code for setup the chain
}
public function process($request)
{
$response = $this->firstHandler->handle($request);
return $response;
}
}
$client = new Client(); $client->setChainOrder($myHanldersOrder); $client->process($request);
Dependency Injection can allow for more flexibility. For example, the chain can be configured by each Request object, as in the example below, with a little code modification.
$client = new Client(); $handlersOrder = $request->getHandlersOrder(); $client->setChainOrder($handlersOrder); $client->process($request);
Speeding up the chain
If the CoR is stressed by several requests and the handlers are also complex – maybe they create other classes to process the request – a Service Container could be useful.
A Service Container (or dependency injection container) that manages the instantiation of objects without creating them each time helps improve memory and performance.
If CoR receives the same type of request often, a caching system is useful for improving speed.
One possible solution is to use an implementation of the Flyweight Pattern to store responses and provide the stored response (if it exists) on identical requests, without having to process the chain again.
In this example, I have added a simple cache to the AdvancedHandler class.
abstract class AdvancedHandler
{
//code ...
final public function handle($request)
{
$response = $this->cache->getResponse($request);
if ($response === null) {
$response = $this->handleRequestWithChain($request);
}
return $response;
}
final public function handleRequestWithChain($request)
{
$response = $this->process($request);
if (($response === null) && ($this->successor !== null)) {
$response = $this->successor->handleRequestWithChain($request);
}
$this->cache->setResponse($response);
return $response;
}
//code ...
}
Final thoughts
The Chain of Responsibility can be a very powerful pattern. It is also possible to implement a chain of chains, making a multidimensional structure.
CoR promotes loose coupling: every handler could be changed (or removed) without a big impact on the whole structure, but its flexibility, with a wrong design, can cause problems on all the chain’s objects involved.
I advise you to make a thorough analysis of the problem you are trying to solve before implementing the CoR pattern, and pay attention to the definition of the handler (abstract class or interface), the request, the response and their interactions.
OOP In JavaScript: What You NEED to Know
(Object Oriented JavaScript: Only Two Techniques Matter)
Prerequisite:
JavaScript Objects in Detail
JavaScript Prototype
Object Oriented Programming (OOP) refers to using self-contained pieces of code to develop applications. We call these self-contained pieces of code objects, better known as Classes in most OOP programming languages and Functions in JavaScript. We use objects as building blocks for our applications. Building applications with objects allows us to adopt some valuable techniques, namely, Inheritance (objects can inherit features from other objects), Polymorphism (objects can share the same interface—how they are accessed and used—while their underlying implementation of the interface may differ), and Encapsulation (each object is responsible for specific tasks).
Our Career Paths and Courses Website Is Now Live
New UPDATE: June 8, 2015
Enrollment for our Career Paths is well underway. Enroll now. Career Path 1: Junior JavaScript Developer and Career Path 3: Modern Frontend Developer are already full (you may still get a spot if you join the wait list now).
The second cohort for Career Path 5: Modern Fullstack Developer is also full. The second cohort starts immediately after the first cohort of Career Path 3 graduates.
In this article, we are concerned with only Inheritance and Encapsulation since only these two concepts apply to OOP in JavaScript, particularly because, in JavaScript, objects can encapsulate functionalities and inherit methods and properties from other objects. Accordingly, in the rest of the article, I discuss everything you need to know about using objects in JavaScript in an object oriented manner—with inheritance and encapsulation—to easily reuse code and abstract functionalities into specialized objects.
We will focus on only the best two techniques1 for implementing OOP in JavaScript. Indeed, many techniques exist for implementing OOP in JavaScript, but rather than evaluate each, I choose to focus on the two best techniques: the best technique for creating objects with specialized functionalities (aka Encapsulation) and the best technique for reusing code (aka Inheritance). By “best” I mean the most apt, the most efficient, the most robust.
Encapsulation and Inheritance Overview
Objects can be thought of as the main actors in an application, or simply the main “things” or building blocks that do all the work. As you know by now, objects are everywhere in JavaScript since every component in JavaScript is an Object, including Functions, Strings, and Numbers. We normally use object literals or constructor functions to create objects.
Encapsulation refers to enclosing all the functionalities of an object within that object so that the object’s internal workings (its methods and properties) are hidden from the rest of the application. This allows us to abstract or localize specific set of functionalities on objects.
Inheritance refers to an object being able to inherit methods and properties from a parent object (a Class in other OOP languages, or a Function in JavaScript).
Both of these concepts, encapsulation and inheritance, are important because they allow us to build applications with reusable code, scalable architecture, and abstracted functionalities. Maintainable, scalable, efficient.
An instance is an implementation of a Function. In simple terms, it is a copy (or “child”) of a Function or object. For example:
// Tree is a constructor function because we will use new keyword to invoke it.
function Tree (typeOfTree) {}
// bananaTree is an instance of Tree.
var bananaTree = new Tree ("banana");
In the preceding example, bananaTree is an object that was created from the Tree constructor function. We say that the bananaTree object is an instance of the Tree object. Tree is both an object and a function, because functions are objects in JavaScript. bananaTree can have its own methods and properties and inherit methods and properties from the Tree object, as we will discuss in detail when we study inheritance below.
OOP in JavaScript
The two important principles with OOP in JavaScript are Object Creation patterns (Encapsulation) and Code Reuse patterns (Inheritance). When building applications, you create many objects, and there exist many ways for creating these objects: you can use the ubiquitous object literal pattern, for example:
var myObj = {name: "Richard", profession: "Developer"};
You can use the prototype pattern, adding each method and property directly on the object’s prototype. For example:
function Employee () {}
Employee.prototype.firstName = "Abhijit";
Employee.prototype.lastName = "Patel";
Employee.prototype.startDate = new Date();
Employee.prototype.signedNDA = true;
Employee.prototype.fullName = function () {
console.log (this.firstName + " " + this.lastName);
};
var abhijit = new Employee () //
console.log(abhijit.fullName()); // Abhijit Patel
console.log(abhijit.signedNDA); // true
You can also use the constructor pattern, a constructor function (Classes in other languages, but Functions in JavaScript). For example:
function Employee (name, profession) {
this.name = name;
this.profession = profession;
} // Employee () is the constructor function because we use the new keyword below to invoke it.
var richard = new Employee (“Richard”, “Developer”) // richard is a new object we create from the Employee () constructor function.
console.log(richard.name); //richard
console.log(richard.profession); // Developer
In the latter example, we use a custom constructor function to create an object. This is how we create objects when we want to add methods and properties on our objects, and when we want to encapsulate functionality on our objects. JavaScript developers have invented many patterns (or ways) for creating objects with constructor functions. And when we say Object Creation Patterns, we are concerned principally with the many ways of creating objects from constructor functions, as in the preceding example.
In addition to the patterns for creating objects, you want to reuse code efficiently. When you create your objects, you will likely want some of them to inherit (have similar functionality) methods and properties from a parent object, yet they should also have their own methods and properties. Code reuse patterns facilitate ways in which we can implement inheritance.
These two universal principles—creating objects (especially from constructor Functions) and allowing objects to inherit properties and methods—are the main focus of this article and, indeed, the main concepts with OOP in JavaScript. We first discuss the object creation pattern.
Encapsulation in JavaScript
(The Best Object Creation Pattern: Combination Constructor/Prototype Pattern)
As discussed above, one of the main principles with OOP is encapsulation: put all the inner workings of an object inside that object. To implement encapsulation in JavaScript, we have to define the core methods and properties on that object. To do this, we will use the best pattern for encapsulation in JavaScript: the Combination Constructor/Prototype Pattern. This name is a mouthful, but you needn’t memorize it, since we are only concerned with its implementation. Before we implement it, let’s quickly learn a bit more about the practicality of encapsulation.
Why Encapsulation?
When you simply want to create an object just to store some data, and it is the only object of its kind, you can use an object literal and create your object. This is quite common and you will use this simple pattern often.
However, whenever you want to create objects with similar functionalities (to use the same methods and properties), you encapsulate the main functionalities in a Function and you use that Function’s constructor to create the objects. This is the essence of encapsulation. And it is this need for encapsulation that we are concerned with and why we are using the Combination Constructor/Prototype Pattern.
To make practical use of OOP in JavaScript, we will build an object-oriented quiz application that uses all the principles and techniques we learn in this article. First up, our quiz application will have users (a Users Function) who take the quiz. There will be some common properties for every user who takes the quiz: each user will have a name, a score, an email, and the quiz scores (all the scores). These are the properties of the User object. In addition, each User object should be able to show the name and score, save scores, and change the email. These are the methods of the object.
Because we want ALL the user objects to have these same properties and methods, we cannot use the object literal way of creating objects. We have to use a constructor Function to encapsulate these properties and methods.
Since we know all users will have the same set of properties, it makes sense to create a Function (Class in OOP languages) that encapsulates these properties and methods. Thus, we will use the Combination Constructor/Prototype Pattern for this.
Implementation of Combination Constructor/Prototype Pattern
The User Function:
I will explain each line.
function User (theName, theEmail) {
this.name = theName;
this.email = theEmail;
this.quizScores = [];
this.currentScore = 0;
}
User.prototype = {
constructor: User,
saveScore:function (theScoreToAdd) {
this.quizScores.push(theScoreToAdd)
},
showNameAndScores:function () {
var scores = this.quizScores.length > 0 ? this.quizScores.join(",") : "No Scores Yet";
return this.name + " Scores: " + scores;
},
changeEmail:function (newEmail) {
this.email = newEmail;
return "New Email Saved: " + this.email;
}
}
Make Instances of the User function
// A User
firstUser = new User("Richard", "Richard@examnple.com");
firstUser.changeEmail("RichardB@examnple.com");
firstUser.saveScore(15);
firstUser.saveScore(10);
firstUser.showNameAndScores(); //Richard Scores: 15,10
// Another User
secondUser = new User("Peter", "Peter@examnple.com");
secondUser.saveScore(18);
secondUser.showNameAndScores(); //Peter Scores: 18
Explanation of Combination Constructor/Prototype Pattern
Let’s expound on each line of code so we have a thorough understanding of this pattern.
The following lines initialize the instance properties. These properties will be defined on each User instance that is created. So the values will be different for each user. The use of the this keyword inside the function specifies that these properties will be unique to every instance of the User object:
this.name = theName;
this.email = theEmail;
this.quizScores = [];
this.currentScore = 0;
In the code below, we are overwriting the prototype property with an object literal, and we define all of our methods (that will be inherited by all the User instances) in this object. Discussion continues after the code:
User.prototype = {
constructor: User,
saveScore:function (theScoreToAdd) {
this.quizScores.push(theScoreToAdd)
},
showNameAndScores:function () {
var scores = this.quizScores.length > 0 ? this.quizScores.join(",") : "No Scores Yet";
return this.name + " Scores: " + scores;
},
changeEmail:function (newEmail) {
this.email = newEmail;
return "New Email Saved: " + this.email;
}
}
This way of overwriting the constructor is simply for convenience, so we don’t have to write User.prototype each time, like this:
User.prototype.constructor = User;
User.prototype.saveScore = function (theScoreToAdd) {
this.quizScores.push(theScoreToAdd)
};
User.prototype.showNameAndScores = function () {
var scores = this.quizScores.length > 0 ? this.quizScores.join(",") : "No Scores Yet";
return this.name + " Scores: " + scores;
};
User.prototype.changeEmail = function (newEmail) {
this.email = newEmail;
return "New Email Saved: " + this.email;
}
By overwriting the prototype with a new object literal we have all the methods organized in one place, and you can better see the encapsulation that we are after. And of course it is less code you have to type.
In JavaScript, you add methods and properties on the prototype property when you want instances of an object to inherit those methods and properties. This is the reason we add the methods on the User.prototype property, so that they can be used by all instances of the User object. Read more about JavaScript Prototype in Plain Language.
Constructor Property
In my post JavaScript Prototype, I explained that every function has a constructor property, and this property points to the constructor of the function. For example:
function Fruit () {}
var newFruit = new Fruit ();
console.log (newFruit.constructor) // Fruit ()
The one disadvantage of overwriting the prototype is that the constructor property no longer points to the prototype, so we have to set it manually. Hence this line:
constructor: User
Prototype Methods
In the following lines, we create methods on the prototype (in the object literal) so that all instances of Users can have access to these methods.
saveScore:function (theScoreToAdd) {
this.quizScores.push(theScoreToAdd)
},
showNameAndScores:function () {
var scores = this.quizScores.length > 0 ? this.quizScores.join(",") : "No Scores Yet";
return this.name + " Scores: " + scores;
},
changeEmail:function (newEmail) {
this.email = newEmail;
return "New Email Saved: " + this.email;
}
We then created instances of the User object:
// A User
firstUser = new User("Richard", "Richard@examnple.com");
firstUser.changeEmail("RichardB@examnple.com");
firstUser.saveScore(15);
firstUser.saveScore(10);
firstUser.showNameAndScores(); //Richard Scores: 15,10
// Another User
secondUser = new User("Peter", "Peter@examnple.com");
secondUser.saveScore(18);
secondUser.showNameAndScores(); //Peter Scores: 18
As you see, we have encapsulated all the functionality for a User inside the User Function, so that each instance of User can make use of the prototype methods (like changeEmail) and define their own instance properties (like name and email).
With this pattern, you can use the standard operators and methods on the instances, including the instanceOf operator, the for-in loop (even hasOwnProperty), and the constructor property.
Inheritance in JavaScript
(The Best Pattern: Parasitic Combination Inheritance)
Implementing inheritance in our quiz application will permit us to inherit functionality from parent Functions so that we can easily reuse code in our application and extend the functionality of objects. Objects can make use of their inherited functionalities and still have their own specialized functionalities.
The best pattern for implementing inheritance in JavaScript is the Parasitic Combination inheritance 2. Before we dive into this awesome pattern, let’s see why its practical to use inheritance in our applications.
We have successfully implemented encapsulation by enclosing all the functionality for users of our quiz application by adding all the methods and properties that each user will need on the User function, and all instances of User will have those properties and methods.
Why Inheritance?
Next, we want to encapsulate all the functionalities for every Question. The Question function (Class in OOP languages) will have all the generic properties and methods that every kind of question will need to have. For example, every question will have the question, the choices, and the correct answer. These will be the properties. In addition, each question will have some methods: getCorrectAnswer and getUserAnswer, and displayQuestion.
We want our quiz application to make different types of Questions. We will implement a MultipleChoiceQuestion function and a DragDropQuestion function. To implement these, it would not make sense to put the properties and methods outlined above (that all questions will use) inside the MultipleChoiceQuestion and DragDropQuestion functions separately, repeating the same code. This would be redundant.
Instead, we will leave those properties and methods (that all questions will use) inside the Question object and make the MultipleChoiceQuestion and DragDropQuestion functions inherit those methods and properties. This is where inheritance is important: we can reuse code throughout our application effectively and better maintain our code.
Since the MultipleChoiceQuestion HTML layout and will be different from the DragDropQuestion HTML layout, the displayQuestion method will be implemented differently in each. So we will override the displayQuestion method on the DragDropQuestion. Overriding functions is another principle of OOP.
Lets Code.
Implementing the Parasitic Combination Inheritance Pattern
To implement this pattern, we have to use two techniques that were invented specifically for inheritance in JavaScript. Some notes about these techniques follow. No need to memorize any of the detail; just understand and be aware of the techniques.
Prototypal Inheritance by Douglas Crockford
Douglas Crockford created the following Object.create method 3, used in a fundamental way to implementing inheritance with the pattern we are using.
Object.create method
Ruminate on the method Crockford created:
if (typeof Object.create !== 'function') {
Object.create = function (o) {
function F() {
}
F.prototype = o;
return new F();
};
}
This method has been added to the ECMAScript5 specification, and you can access it with Object.create (). Let’s quickly understand it is doing.
Object.create = function (o) {
//It creates a temporary constructor F()
function F() {
}
//And set the prototype of the this constructor to the parametric (passed-in) o object
//so that the F() constructor now inherits all the properties and methods of o
F.prototype = o;
//Then it returns a new, empty object (an instance of F())
//Note that this instance of F inherits from the passed-in (parametric object) o object.
//Or you can say it copied all of the o object's properties and methods
return new F();
}
The crux of the matter with this Object.create method is that you pass into it an object that you want to inherit from, and it returns a new object that inherits from the object you passed into it. For example:
// We have a simple cars object
var cars = {
type:"sedan",
wheels:4
};
// We want to inherit from the cars object, so we do:
var toyota = Object.create (cars); // now toyota inherits the properties from cars
console.log(toyota.type); // sedan
Of course we can now add more properties to the toyota object, but let’s move on.
The next function we will use for inheritance is the inheritPrototype function. This function succinctly implements the parasitic combination inheritance for us. We pass in the parent object (or Super Class) and the child object (or Sub Class), and the function does the parasitic combination inheritance: makes the child object inherits from the parent object.
function inheritPrototype(childObject, parentObject) {
// As discussed above, we use the Crockford’s method to copy the properties and methods from the parentObject onto the childObject
// So the copyOfParent object now has everything the parentObject has
var copyOfParent = Object.create(parentObject.prototype);
//Then we set the constructor of this new object to point to the childObject.
// Why do we manually set the copyOfParent constructor here, see the explanation immediately following this code block.
copyOfParent.constructor = childObject;
// Then we set the childObject prototype to copyOfParent, so that the childObject can in turn inherit everything from copyOfParent (from parentObject)
childObject.prototype = copyOfParent;
}
Why did we manually set the copyOfParent.constructor?
________________________________________
We explicitly set the copyOfParent.constructor property to point to the childObject constructor because in the preceding step, var copyOfParent = Object.create(parentObject.prototype), this is what we actually did:
// We made a new object and overwrote its prototype with the parentObject prototype:
function F() {
}
F.prototype = parentObject.prototype;
// Then it was this new F object we assigned to copyOfParent.
// All of this was done inside the Object.create () method.
So, this new F object, which we assigned to copyOfParent, doesn’t have a constructor property anymore because we overwrote its entire prototype. Whenever you overwrite an object’s prototype (object.prototype = someVal), you also overwrite the object’s constructor property.
To make sure we have the correct value for copyOfParent constructor, we set it manually with this:
copyOfParent.constructor = childObject;
A commenter by the name of John correctly pointed our that I did not corruptly explain this bit, hence this detailed explanation.
________________________________________
Essentially, we are copying all the properties and methods from the parentObject to the childObject, but we are using the copyOfParent as an intermediary for the copy. And because the childObject prototype was overwritten during the copy, we manually set the copyOfParent constructor to the childObject. Then we set the childObject prototype to the copyOfParent so that the childObject inherits from the parentObject.
Okay, that was quite a bit. I am hopeful you understand some of that :).
Back to the fun stuff: Creating our quiz OOP style.
Now that we understand the inheritPrototype function we will be using, lets go ahead and implement our Question constructor.
Note that I use “constructor” and “function” interchangeably sometimes in this particular article when referring to the function, because the function will be used as a constructor to create instances.
The Question Constructor (Parent of all Question Objects):
(Can be thought of as the Super Class for Questions)
// The Question function is the parent for all other question objects;
// All question objects will inherit from this Question constructor
function Question(theQuestion, theChoices, theCorrectAnswer) {
// Initialize the instance properties
this.question = theQuestion;
this.choices = theChoices;
this.correctAnswer = theCorrectAnswer;
this.userAnswer = "";
// private properties: these cannot be changed by instances
var newDate = new Date(),
// Constant variable: available to all instances through the instance method below. This is also a private property.
QUIZ_CREATED_DATE = newDate.toLocaleDateString();
// This is the only way to access the private QUIZ_CREATED_DATE variable
// This is an example of a privilege method: it can access private properties and it can be called publicly
this.getQuizDate = function () {
return QUIZ_CREATED_DATE;
};
// A confirmation message that the question was created
console.log("Quiz Created On: " + this.getQuizDate());
}
Add Prototype Methods to The Question Object
All instances of the Question object will inherit these methods, because we are adding the methods on the Question prototype.
// Define the prototype methods that will be inherited
Question.prototype.getCorrectAnswer = function () {
return this.correctAnswer;
};
Question.prototype.getUserAnswer = function () {
return this.userAnswer;
};
Question.prototype.displayQuestion = function () {
var questionToDisplay = "<div class='question'>" + this.question + "</div><ul>";
choiceCounter = 0;
this.choices.forEach(function (eachChoice) {
questionToDisplay += '<li><input type="radio" name="choice" value="' + choiceCounter + '">' + eachChoice + '</li>';
choiceCounter++;
});
questionToDisplay += "</ul>";
console.log (questionToDisplay);
};
Child Questions (Sub Classes of the Question object)
Now that we have the Question constructor object setup, we can inherit from it and create sub classes (children objects). The power of inheritance is that we can create all sorts of questions now, and each can be quite versatile.
First, a Multiple Choice Question:
// Create the MultipleChoiceQuestion
function MultipleChoiceQuestion(theQuestion, theChoices, theCorrectAnswer){
// For MultipleChoiceQuestion to properly inherit from Question, here inside the MultipleChoiceQuestion constructor, we have to explicitly call the Question constructor
// passing MultipleChoiceQuestion as the this object, and the parameters we want to use in the Question constructor:
Question.call(this, theQuestion, theChoices, theCorrectAnswer);
};
And then we have to use the inheritPrototype function we discussed moments ago:
// inherit the methods and properties from Question
inheritPrototype(MultipleChoiceQuestion, Question);
After we have inherited from Question, we then add methods to the MultipleChoiceQuestion function, if necessary. But we must do it after we inherit, not before, or all the methods we define on its prototype will be overwritten. We are not adding any now.
A Drag and Drop Question
In a similar manner, we can make yet another type of question:
// Create the DragDropQuestion
function DragDropQuestion(theQuestion, theChoices, theCorrectAnswer) {
Question.call(this, theQuestion, theChoices, theCorrectAnswer);
}
// inherit the methods and properties from Question
inheritPrototype(DragDropQuestion, Question);
Overriding Methods
Overriding methods is a another principle of OOP, and we can do it easily with this pattern. Since the Drag and Drop questions will have a different HTML layout from the Multiple Choice questions (no radio buttons, for example), we can override the displayQuestion method so it operates specifically to the Drag and Drop question needs:
// Override the displayQuestion method it inherited
DragDropQuestion.prototype.displayQuestion = function () {
// Just return the question. Drag and Drop implementation detail is beyond this article
console.log(this.question);
};
In our real Quiz application, we would create a Quiz constructor that is the main application that launches the quiz, but in this article, we can test our inheritance code by simply doing this:
// Initialize some questions and add them to an array
var allQuestions = [
new MultipleChoiceQuestion("Who is Prime Minister of England?", ["Obama", "Blair", "Brown", "Cameron"], 3),
new MultipleChoiceQuestion("What is the Capital of Brazil?", ["São Paulo", "Rio de Janeiro", "Brasília"], 2),
new DragDropQuestion("Drag the correct City to the world map.", ["Washington, DC", "Rio de Janeiro", "Stockholm"], 0)
];
// Display all the questions
allQuestions.forEach(function (eachQuestion) {
eachQuestion.displayQuestion();
});
If you run the code, you will see that the displayQuestion for the multiple choice questions returns the question in a div tag, with choices formatted with radio buttons inside li tags. On the other hand, the drag and drop questions displayQuestion method simply returns the question without the choices.
Nicholas Zakas stated it wonderfully, “Parasitic combination inheritance is considered the most optimal inheritance paradigm” 5 in JavaScript. If you learn it and understand it well, you should use it in your JavaScript web applications.
You might be wondering how is the Combination Constructor/Prototype Pattern we used for Encapsulation earlier different from the Parasitic Combination Inheritance. They are similar, but the former is best used for encapsulation (creating custom objects), and it does not have all the inheritance mechanisms such as subclassing (creating child constructors that inherit from the parent constructor). Moreover, the inheritance pattern goes beyond setting up objects to just inherit properties and methods, it enables child objects to themselves be parent objects of other objects, and you can use private members, overriding, and other OOP concepts.
Final Words
I gave you the full details for implementing the best two patterns for OOP in JavaScript, and I am hopeful you understood at least the general concepts. Go use these patterns in your JavaScript applications. Note that you can use OOP in even small and medium applications, not just complex applications.
Be good and do good work, and take care of yourself: sleep well, eat well, and enjoy life.
Further Reading
Read chapters 6 and 7 of Zakas’s Professional JavaScript for Web Developers.
Read chapters 5 and 6 of Stefanov’s JavaScript Pattens.
Read chapter 4 of Herman’s Effective JavaScript.
Notes
- Professional JavaScript for Web Developers
Chapter 6.
- JavaScript Patterns
Chapters 5 and 6
- Effective JavaScript: 68 Specific Ways to Harness the Power of JavaScript
Chapter 4.
- http://javascript.crockford.com/prototypal.html
- Professional JavaScript for Web Developers
Chapter 6, page 215.
Understanding process.nextTick()
I have seen quite a few people being confused about process.nextTick(). Let's take a look at what process.nextTick() does, and when to use it.
As you might already know, every Node application runs on a single thread. What this means is that apart from I/O - at any time, only one task/event is processed by Node's event loop. You can imagine this event loop to be a queue of callbacks that are processed by Node on every tick of the event loop. So, even if you are running Node on a multi-core machine, you will not get any parallelism in terms of actual processing - all events will be processed only one at a time. This is why Node is a great fit for I/O bound tasks, and definitely not for CPU intensive tasks. For every I/O bound task, you can simply define a callback that will get added to the event queue. The callback will fire when the I/O operation is done, and in the mean time, the application can continue to process other I/O bound requests.
Given this model, what process.nextTick() actually does is defer the execution of an action till the next pass around the event loop. Let's take a simple example. If we had a function foo() which we wanted to invoke in the next tick, this is how we do it:
function foo() {
console.error('foo');
}
process.nextTick(foo);
console.error('bar');
If you ran the above snippet, you will notice that bar will be printed in your console before foo, as we have delayed the invokation of foo() till the next tick of the event loop:
bar
foo
In fact, you can get the same result by using setTimeout() this way:
setTimeout(foo, 0);
console.log('bar');
However, process.nextTick() is not just a simple alias to setTimeout(fn, 0) - it's far more efficient.
More precisely, process.nextTick() defers the function until a completely new stack. You can call as many functions as you want in the current stack. The function that called nextTick has to return, as well as its parent, all the way up to the root of the stack. Then when the event loop is looking for a new event to execute, your nextTick'ed function will be there in the event queue and execute on a whole new stack.
Let's see where we can use process.nextTick():
Interleaving execution of a CPU intensive task with other events
Let's say we have a task compute() which needs to run almost continuously, and does some CPU intensive calculations. If we wanted to also handle other events, like serving HTTP requests in the same Node process, we can use process.nextTick() to interleave the execution of compute() with the processing of requests this way:
var http = require('http');
function compute() {
// performs complicated calculations continuously
// ...
process.nextTick(compute);
}
http.createServer(function(req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World');
}).listen(5000, '127.0.0.1');
compute();
In this model, instead of calling compute() recursively, we use process.nextTick() to delay the execution of compute() till the next tick of the event loop. By doing so, we ensure that if any other HTTP requests are queued in the event loop, they will be processed before the next time compute() gets invoked. If we had not used process.nextTick() and had simply called compute() recursively, the program would not have been able to process any incoming HTTP requests. Try it for yourself!
So, alas, we don't really get any magical multi-core parallelism benefits by using process.nextTick(), but we can still use it to share CPU usage between different parts of our application.
Keeping callbacks truly asynchronous
When you are writing a function that takes a callback, you should always ensure that this callback is fired asynchronously. Let's look at an example which violates this convention:
function asyncFake(data, callback) {
if(data === 'foo') callback(true);
else callback(false);
}
asyncFake('bar', function(result) {
// this callback is actually called synchronously!
});
Why is this inconsistency bad? Let's consider this example taken from Node's documentation:
var client = net.connect(8124, function() {
console.log('client connected');
client.write('world!rn');
});
In the above case, if for some reason, net.connect() were to become synchronous, the callback would be called immediately, and hence the client variable will not be initialized when the it's accessed by the callback to write to the client!
We can correct asyncFake() to be always asynchronous this way:
function asyncReal(data, callback) {
process.nextTick(function() {
callback(data === 'foo');
});
}
When emitting events
Let's say you are writing a library that reads from a source and emits events that contains the chunks that are read. Such a library might look like this:
var EventEmitter = require('events').EventEmitter;
function StreamLibrary(resourceName) {
this.emit('start');
// read from the file, and for every chunk read, do:
this.emit('data', chunkRead);
}
StreamLibrary.prototype.__proto__ = EventEmitter.prototype; // inherit from EventEmitter
Let's say that somewhere else, someone is listening to these events:
var stream = new StreamLibrary('fooResource');
stream.on('start', function() {
console.log('Reading has started');
});
stream.on('data', function(chunk) {
console.log('Received: ' + chunk);
});
In the above example, the listener will never get the start event as that event would be emitted by StreamLibrary immediately during the constructor call. At that time, we have not yet assigned a callback to the start event yet. Therefore, we would never catch this event! Once again, we can use process.nextTick() to defer the emit till the listener has had the chance to listen for the event.
function StreamLibrary(resourceName) {
var self = this;
process.nextTick(function() {
self.emit('start');
});
// read from the file, and for every chunk read, do:
this.emit('data', chunkRead);
}
I hope that demystifies process.nextTick(). If I have missed out something, please do share in the comments.
8 Products Demonstrating the Future of Tech
8 Products Demonstrating the Future of Tech

A few weeks ago, New York Magazine’s Kyle Chayka asked me to share eight products that demonstrate the future of technology.
Yesterday he summarized my email reply in Product Hunt Predicts the Tech Hits of 2016 so I thought I would share my full response here.
Meerkat

Meerkat launched just over a month ago, immediately capturing the attention of the tech industry and several mainstream celebrities like Jimmy Fallon, Tony Hawk, Jim Gaffigan, and others. Livestreaming has existed for over a decade with predecessors like Justin.tv, YouNow, and Twitch (which was recently acquired by Amazon for nearly $1B) and more recently, Twitter entered the space with Periscope.
Today, everyone has a livestreaming device in their pocket. Mobile bandwidth speeds are faster, camera quality has improved, and established social graphs like Twitter enable broadcasters to quickly find an audience on nascent platforms. But it’s also important to recognize a shift in behavior. I believe “regular” people are more willing to broadcast than before as they’ve become accustomed to sharing everyday moments on Snapchat, Twitter, Instagram, and elsewhere. Josh Constine wrote a good piece on this shortly after Meerkat’s launch.
Be My Eyes
Be My Eyes quickly became one of the most upvoted products on Product Hunt when it launched. The app connects the blind to someone with sight via their mobile phone to help them see in real-time. This is a fascinating example of how technology can be used to connect people and build empathy among strangers.
Magic

Magic’s pitch: “Text 83489 to get whatever you want on demand with no hassle.” A bold claim that has yet to be proven as a scaleable business model, Magic is one example of many on-demand virtual assistant services that use a combination of humans and machines to perform micro-tasks. These platforms have an opportunity to become a middle man between 3rd party services and API’s like Uber, Postmates, Instacart, and other on-demand services, satisfying one’s desires through a text message.
Snapcash
Snapchat’s launch of Snapcash came as a surprise to most people. Now its millions of photo and video-sharing snappers can quickly send people money via text. This becomes particularly interesting as it relates to the future of media and monetization for content creators. Many have tried creating a platform enable writers, video broadcasters, and other independent creators to generate revenue online through microtransactions but this model rarely works outside some niches like gaming. Snapchat’s context and movement toward media with the launch of Discover, is well-positioned to make this work for a large, mainstream audience. Notable competitors, Facebook Pay and $Cashtags by Square recently entered the market.
Clara

On-demand services like Uber, Sprig, and Instacart save us time and make life more convenient. Similarly, there’s an increasing number of services designed to simplify workflows and eliminate busywork. Clara schedules your meetings, taking on the time-consuming and frustrating process of coordinating with someone’s calendar over email. For many, it replaces much of the work of an Executive Assistant, increasing productivity and reducing possible headcount. Services that provide direct, measurable monetary ROI have a high likelihood of gaining traction and the increasing connectedness of the Internet (often through API’s) opens new opportunities for scaleable, machine-driven solutions.
Business for Messenger

Facebook recently announced Business for Messenger, giving its 600M+ monthly active users the ability to text messages businesses. Path Talk, RealTalk, Operator, and others are also in this space but there has been relatively little innovation in consumer-to-business communications. We still turn to old-fashion and inefficient phone calls that lack the convenience of asynchronous texting, personalization, historical knowledge, or flexibility of modern day messaging.
Digit
Digit is an example of an invisible app (view more in this collection) that automatically transfers money between your savings and checking account to save you money. Frugal Digit consumers simply use SMS to check the status and transfer money on-demand. Once setup, Digit doesn’t compete for attention like the overwhelming sea of apps we discover and use every day. There is no app to install or task to do. It just works.
Teleport

Teleport, an app for digital nomads and those evaluating where to live, just launched. Increasingly, companies are more accepting of remote teams and thanks to tools like Slack, GitHub, and others, it’s now much easier to work anywhere in the world. This is a trend that I believe will continue as “software eats the world” and people become more accustomed to this way of working. Teleport is one of many recent products built for this lifestyle and I expect to see many more build for this mark.
This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers.
حدیث هایی در مورد قضا و قدر

رضا به قضا
1- حضرت امام صادق (علیه السّلام) فرموده اند: انسان حریص از دو خصلت محروم و ملازم دو خصلت است: چون قانع نیست از آسایش و راحت محروم است و چون به قضاء الهی راضی نیست فاقد یقین است.
منبع: سفینه،(( حرص)) ص 244
2- حضرت امام صادق (علیه السّلام) فرموده اند: به راستی داناترین مردم به خدا راضی تر آنان است به قضا خدا عزوجل.
منبع : اصول کافی جلد 4، ص 191
3- حضرت امام صادق (علیه السّلام) فرموده اند: در آنچه خدا عزو جل به موسی بن عمران وحی کرد این بود که: ای موسی بن عمران، من هیچ آفریده را نیافریدم که نزد من محبوبتر باشد از بنده ی مومنم، به راستی من او را گرفتار می کنم برای آنچه که خیر او است و عافیت می دهم برای آنچه که خیر او است و آنچه برای او بد است از او دریغ می دارم باز هم برای آنچه که خیر او است، من داناترم بدانچه بنده ی من بدان اصلاح می شود، باید بر بلای من صبر کند و به نعمت های من شکر کند و باید راضی به قضای من باشد تا او را نزد خود در شمار صدیقان نویسم وقتی به رضای من کار کند و امر مرا اطاعت کند.
منبع : اصول کافی جلد 4، ص 195
4- حضرت امام صادق (علیه السّلام) فرموده اند: من در شگفتم از مرد مسلمان، خدا عزوجل چیزی برای او مقدر نکند جز این که خیر او است و اگر با مقراض او را ببرند و تیکه تیکه کنند خیر او است و اگر مشارق و مغارب را هم مالک شود، خیر او است.
منبع : اصول کافی جلد 4، ص 197
5- حضرت امام باقر (علیه السّلام) فرمودند: سزاوارترین خلق خدا که تسلیم شود بدانچه خدا مقدر کرده است، کسی است که خدا عزوجل را شناخته، هر که راضی به قضا است قضا بر سر او بیاید و خدا اجر بزرگ به او بدهد و هر که بدخواه قضا است قضا بر او بگذرد و خدا اجر او را ساقط کند.
منبع : اصول کافی جلد 4، ص 197
6- حضرت حسن بن علی (علیه السّلام) به عبد الله بن جعفر برخورد و به او فرمودند: ای عبدالله، چگونه مومن، مومن باشد با این که از قسمت مقدر خشمگین است و خود را زبون یابد با این که خدا بر او چنین حکمی کرده است، من ضامنم که هر که در پندار دلش جز رضا نباشد به درگاه خدا هر دعا کند مستجاب شود.
منبع : اصول کافی جلد 4، ص 197
7- ابن سنان از کسی که نامش را برد از حضرت امام صادق (علیه السّلام) گوید: به آن حضرت گفتم : چگونه مومن بداند که مومن است ؟ فرمودند: با تسلیم در برابر خدا و رضا بدانچه بر او وارد آید از مایه ی شادی یا خشم.
منبع : اصول کافی جلد 4، ص 199
جبر و اختیار
8- حضرت امام صادق (علیه السّلام) فرموده اند: مردم در کارهای خود نه مجبور و بی اختیارند و نه تمام اختیار و اراده به آنان تفویض شده است، بلکه کارهایی را که انجام می دهند در یک حد وسطی بین جبر و اختیار قرار دارد.
منبع: کافی1،ص160و159
9- از حضرت امام جعفر بن محمد (علیه السّلام) سوال شد آیا مردم در اعمال خود مجبورند یا مختار. فرمودند: نه جبر است نه اختیار، بلکه منزلی است بین این دو و حق در همان منزل است. درک این مرحله ی وسط تنها درخور عالِم است یا کسی که عالِم آن را به وی آموخته باشد.
منبع: کافی1،ص160و159
10- حضرت امام رضا(علیه السّلام) در ضمن حدیثی به این مطلب تصریح فرموده اند. راوی سوال می کند: معنی امر بین امرین چیست؟ فرمودند: وجود آزادی در انسان که می تواند به راه اطاعت اوامر حق و اجتناب از گناه برود. عرض کرد آیا خداوند در اعمال مردم اراده و مشیتی دارد؟ فرمودند: اراده و مشیت خداوند در طاعات و خوبیها، امر به طاعات و راضی بودن به وقوع طاعات و کمک در به جا آوردن طاعات است. اراده و مشیت خداوند در گناهان و بدیها، نهی از گناه و غضب در ارتکاب گناه و کمک نکردن در به جا آوردن گناه است. عرض کرد آیا خداوند در افعال مردم قضا و مقدری دارد؟ فرمودند: بلی، هیچ خوب و بدی را مردم به جا نمی آورند مگر اینکه برای خداوند نسبت به آنان قضایی است. پرسید این قضا چیست؟ فرمودند: حکم خداوند به آنچه مردم در کارهای خود استحقاق پاداش یا عذاب در دنیا و آخرت دارند. حضرت امام رضا(علیه السّلام) تمام اعمال خوب و بد مردم را در کمال صراحت مستند به قضاء الهی می کند. قضای خدا در اعمال بشر آزادی بشر است، همان آزادی و اختیاری که در اطاعت، او را مستحق پاداش و در گناه، مستحق مجازات می کند.
منبع: بحار،ج3،ص5
11- ابن ابی نصر می گوید: به حضرت امام رضا(علیه السّلام) عرض کردم بعضی از اصحاب ما قائل به جبر و بعضی قائل به اختیار هستند و درخواست داشت که حضرت رضا حق مطلب را بیان کند. دستور داد بنویس به نام خداوند بخشنده ی مهربان، امام سجاد (علیه السّلام) از حضرت باریتعالی نقل کرده که فرموده است: ای فرزند آدم تو با مشیت و خواست من دارای اراده و مشیت هستی، تو با نیرویی که از من داری واجبات مرا به جا می آوری، تو با نعمت من قوت و توان معصیت مرا پیدا کرده ای.
منبع: کافی1،ص159
12- حضرت امام علی (علیه السّلام) از دیوار مایلی که خطر خراب شدن داشت به طرف دیگر رفت. شخصی عرض کرد یا امیرالمومنین، از قضاء خداوند فرار می کنی؟ فرمودند: از قضاء خدا به قدر خدا می گریزم.
توضیح بیشتر در مورد حدیث:علی (علیه السّلام) فرار از دیوار خراب را قدر خدا می داند، زیرا خداوند مقدر فرموده بشر آزاد باشد، می تواند با اختیار خود بایستد و دیوار بر سرش خراب شود و می تواند با اختیار خود از محیط خطر خارج شود. در هر حال هر دو صورت قضا و قدر الهی است.
منبع: بحار،ج3،ص33
13- حضرت امام علی (علیه السّلام) فرموده اند: اگر خدا می خواست می توانست جهان را در مدتی کمتر از یک چشم بر هم زدن بیافریند. ولی نخواست و عالم را تدریجا آفرید و این ساختمان تدریجی را از طرفی برای مردان خدا و امناء وحی خود مثالی قرار داد که در ساختن افکار ایمانی و اخلاقی جامعه راه مدارا و ملائمت در پیش گیرند تا پیروزی بدست آورند، و از طرف دیگر آن را حجتی قاطع و الزام آور برای مردمی قرار داد که می گویند چرا خداوند در یک لحظه و به طور دفعی همه ی مردم را مومن و با اخلاق نمی سازد؟ زیرا قضا قطعی باری تعالی اینستکه موجودات تدریجا به کمال لایق خود برسند، همانطور که خداوند کاخ هستی را تدریجا و در مدت شش روز آفرید.
منبع: بحار14،ص2
Nette Framework: First Impressions
SitePoint’s PHP channel conducted its annual survey on the most popular framework of 2015 and the results were discussed here.
We saw some familiar names: Laravel, Symfony2, Phalcon, Silex, Slim, etc. But wait, what is this: Nette?

According to the survey result, it ranked number 3 in both “at Work” and “in Personal Projects”, just tailing the two giants: Laravel and Symfony2.
I had never heard of this framework before the survey results got published. A framework so popular is worth looking into. Thus, in this article, we will take a look at Nette, see what it can do and discuss some of the features.

NOTE: We will base our review on the official Getting Started tutorial.
Installation and bootstrapping
Nette uses a self-bootstrap approach (similar to Laravel) with the support of composer:
composer create-project nette/sandbox demo
This will create a demo directory in the current one, and a sandbox project will be loaded into said folder.
Nette’s Getting Started tutorial guides us through building a simple blog app which features basic blog functions like: list all posts, view an individual post, create/edit a post, comments, security etc.
Let me show you what the app will look like when you finish the tutorial (I have not added any CSS to it so the overall appearance is quite rudimentary):

NOTE: This is served in a Vagrant box.
In the next few sections, we will look at some of the fundamental concepts in Nette. As I am a long-time user of Symfony2 (SF2), I will use that for comparison most of the time. Please note that the comparison notes are purely my personal view.
Project structure
Nette is considered to be an MVC framework, though its “Model” layer is almost missing. Its project structure also reflects this but is organized in a very different way:

Above project structure is taken from Nette’s tutorial
Like in SF2, a dedicated www (web in SF2) directory is there to hold the entry PHP file: index.php and also .htaccess rules to provide rewrite instructions for Apache. It will also contain static resources (CSS, JS, fonts, images, etc).
vendor will hold all the vendor libraries, as usual.
Many other folders will go under app:
-
config: As its name suggests, all the configuration resides here. Nette usesconfig.neonandconfig.local.neonto provide configuration information related to database, security, services, app-wide parameters, etc. Nette will loadconfig.neonfirst and thenconfig.local.neon. The latter will override the same parameters defined in the former, as is common in other frameworks as well. You can find out about the Neon file format here. -
presentersandpresenters/templates: these two folders cover the controller and the template (view) portion. Nette uses Latte as its template engine. More on Latte later, and no Cappuccino – sorry. -
router: it holds the route factory class to customize pretty URIs and thus creates a bridge between a URI and a controller/action. More on this later.
Start from database
Nette comes with a handy tool called “Adminer” to mimic a PHPMyAdmin kind of functionality. The interface is clean and easy to use:

As an “embedded” tool, Adminer’s capability is limited so you may want to switch to your preferred database administration tool if this one doesn’t cut it. Also, it should be noted that we access Adminer from the adminer sub-directory in www. This may not be a good approach, especially in a production environment. This folder should be ignored in deployment phases – either via .gitignore, .gitattributes or otherwise and Nette should point this out in their docs.
Router
We are developing a simple blog app. We would want a URI showing a specific post (identified by its postId) to look like this: post/show/4 but not like this: post/show?postId=4.
Nette recommends using a router factory to manage the link between a URI (or a URI pattern) and its corresponding controllers/actions. The router factory is defined in app/router/RouterFactory.php:
class RouterFactory
{
/**
* @return NetteApplicationIRouter
*/
public static function createRouter()
{
$router = new RouteList();
$router[] = new Route('post/show/<postId>', 'Post:Show');
$router[] = new Route('<presenter>/<action>[/<id>]', 'Homepage:default');
return $router;
}
}
The definition of a route is straightforward:
- A URI “pattern” with parameter(s):
post/show/<postId>. - and a string in the form of “Controller:Action”:
Post:Show.
The detailed Nette routing documentation can be found here.
To use this router factory, we must register a service in app/config/config.neon:
services: router: AppRouterFactory::createRouter
To generate a link in our template based on a route, we can use the syntax below:
<a href="{link Post:Show $post->id}">{$post->title}</a>
I must admit this Latte syntax is a bit shorter than the corresponding Twig syntax. It uses {} for both echo statement and control statement. For example:
//To display a variable
{$var1}
//To run a foreach loop
{foreach $items as $item}
...
{/foreach}
Latte also has a powerful macro system to facilitate some common tasks. For example, the below code snippet will only display a list when $items is not null:
<ul n:if="$items"> ... </ul>
This can be handy when the user wants to display a certain section based on a returned result set.
Controllers and Actions
A presenter in Nette is the controller. All presenters are in the app/presenters folder and the file name should end with Presenter.php. As an example, we have PostPresenter for post related actions, SignPresenter for sign in / sign out related actions.
In a presenter file, we define a class to hold all the actions (methods) that can be invoked. For example, to show a particular post identified by its postId (and its related comments), the method will look like this:
namespace AppPresenters;
use Nette;
use NetteApplicationUIForm;
class PostPresenter extends BasePresenter
{
private $database;
public function __construct(NetteDatabaseContext $database)
{
$this->database = $database;
}
public function renderShow($postId)
{
$post = $this->database->table('posts')->get($postId);
if (!$post)
{
$this->error('Post not found');
}
$this->template->post = $post;
$this->template->comments = $post->related('comments')->order('created_at');
}
... ...
}
In renderShow($postId), a $post is grabbed from the database by matching $postId. Then, a template will be rendered with variables (the post and related comments in this case).
We notice that this process is simple but hides a lot of details. For example, where is this database coming from?
In app/config/config.local.neon, we can see this section (following the tutorial):
database: dsn: 'mysql:host=127.0.0.1;dbname=quickstart' user: root password: xxxxxx options: lazy: yes
This is a familiar database connection setup. When a controller/action is to be invoked, Nette transforms this DSN into a database object (or database context) and injects it into the constructor of that controller class. Thus, the database is accessible to all methods by means of Dependency Injection.
What about the template rendering? We just see the variable assignments but no explicit call to a “render” method. Well, this is also part of the Nette convention. When an action is given a render prefix, this action will render a template at the return of the method call.
In this case, the method is renderShow. This method is linked to URI like “post/show/3” as we defined earlier (in route definitions, the render prefix is ignored): $router[] = new Route('post/show/<postId>', 'Post:Show');.
renderShow will start to look for a template under app/presenters/templates looking for:
- A directory named “Post” because this is the controller name of this
renderShowaction. - Then a template named
Show.latteto populate all the variables and display it.
So let’s summarize the naming and mapping conventions used in Nette in the below chart:

The Latte template engine
If you are familiar with Twig, you will find that Latte is quite easy to learn.
It uses {...} pair to escape from the regular HTML parsing and does not differentiate from a pure print (Twig equivalent: {{...}}) or a control ({%...%}). Also, a variable must be prefixed with the $ sign, or a string literal inside the { } pair will be treated as a macro and most likely cause a syntax error, saying “Unknown macro {xxxx}”.
There’s a handy feature when we’re dealing with an iteration on a result set, which is very common:
<ul n:if="$items">
{foreach $items as $item}
<li id="item-{$iterator->counter}">{$item|capitalize}</li>
{/foreach}
</ul>
Besides the regular usage of a foreach loop, a condition has been put in place to decide if the below <ul> section should be displayed or not. The <ul> section will only be there when there is at least one item in $items. With the help of this macro, we can save some lines and avoid using an if...endif pair.
Latte supports template inheritance, template including, filters, and many other cool features. Please visit its official documentation for details.
Auth and Forms
The official documentation on access control is a good starting point for us.
Nette supports in-memory and database credentials. By using in-memory authentication, we use the below snippet:
$authenticator = new NetteSecuritySimpleAuthenticator(array(
'john' => 'IJ^%4dfh54*',
'kathy' => '12345', // Kathy, this is a very weak password!
));
$user->setAuthenticator($authenticator);
Then, the system can explicitly make a user log in using:
$user->login($username, $password);
where the username and password can be obtained from a form submission.
Nette supports roles and ACL (Access Control List) and uses an “Authorizator” to enforce the authorization.
Firstly, we can create some roles with hierachy:
$acl = new NetteSecurityPermission;
//Define a guest role and a registered user role
$acl->addRole('guest');
$acl->addRole('registered', 'guest');
In the above code, role register inherits from guest.
Then, we define a few resources that a user may access:
$acl->addResource('article');
$acl->addResource('comments');
$acl->addResource('poll');
Finally, we set authorization rules:
$acl->allow('guest', array('article', 'comments', 'poll'), 'view');
$acl->allow('registered', 'comments', 'add');
So a guest can view an article, comments and a poll and a registered user, besides the privileges inherited from guest, can also add a comment.
I really don’t like this kind of access control. Even an annotation outside of a controlled method itself or the use of a decorator would be better than this, in my opinion. And I would say a centralized file (SF2’s security.yml) is the best practice: neat, clean, and flexible.
The forms are generated in their respective presenters. In particular, the form creation includes a callback event handler to process a successful form submission.
protected function createComponentCommentForm()
{
$form = new Form;
$form->addText('name', 'Your name:')->setRequired();
$form->addText('email', 'Email:');
$form->addTextArea('content', 'Comment:')->setRequired();
$form->addSubmit('send', 'Publish');
$form->onSuccess[] = [$this, 'commentFormSucceeded'];
return $form;
}
But, this is not the action of that form to be rendered.
For example, let’s look at the above code for renderShow to display a post detail page and a form for readers to enter comments. In the presenter, we only assigned a post variable and a comments variable to hold related comments. The comment input form is rendered in the template app/presenters/templates/Post/Show.latte:
<h2>Post new comments</h2>
{control commentForm}
The source of that page is extracted below:
<h2>Post new comments</h2>
<form action="/sandbox/www/post/show/4" method="post" id="frm-commentForm">
<table>
<tr class="required">
<th><label for="frm-commentForm-name" class="required">Your name:</label></th>
<td><input type="text" name="name" id="frm-commentForm-name" required data-nette-rules='[{"op":":filled","msg":"This field is required."}]' class="text"></td>
</tr>
...
<tr>
<th></th>
<td><input type="submit" name="send" value="Publish" class="button"></td>
</tr>
</table>
<div><input type="hidden" name="do" value="commentForm-submit"></div>
</form>
We see clearly that the form action assigned is /sandbox/www/post/show/4, which is essentially the URI that displays the post itself. There is no place in the source code to indicate that a hook to the commentFormSucceeded method exists.
This kind of “inside linking” may confuse Nette beginners a lot. I mean, to have a separate method to process the form is a common practice, and thus to have a URI assigned for such a process is also reasonable.
Nette using a callback/event handler to do this is also fine but there is certainly something missing or not clearly explained between when a user clicks the “Submit” button and the input is persisted in the database.
We know the persistence is performed in a method called commentFormSucceeded and we implemented that feature by ourselves. But how they are hooked up is not clear.
Other cool features
Nette comes with a debugger called “Tracy“. In debug mode, we will see a small toolbar at the bottom right corner of our page, telling us important page information:

It can be disabled in production mode by changing app/bootstrap.php:
$configurator->setDebugMode(false); // "true" for debug mode
NOTE: Please purge the temp/cache folder contents if you encounter any issues after changing from development mode to production mode.
Nette also includes a test suite called “Tester”. The usage is also straightforward. See here for details.
Final Thoughts
Nette is a relatively new framework. Its 2.0 release was about 3 years ago. It came to be noticed by many of us thanks to the SitePoint survey.
Its Github issue tracker is very active. My two questions posted there got answered in less than 10-30 minutes and both lead to the correct solution, but its documentation needs a lot of work. During my attempts to set up the tutorial app following its docs, I found a lot of typos and missing explanations.
If I could give SF2 a score of 10 – not saying SF2 is perfect but just for comparison’s sake – my initial score for Nette is between 7 to 8. It is mature, well written, easy to learn, equipped with advanced features but also has a few areas that need improving.
Are you familiar with Nette? Feel free to share your views and comments, too.
تعطیلی برنامهی «دستان» به بهانهی ارزن روی طناب!
یک برنامهی رادیویی یا تلویزیونی فرهنگی یا هنری وقتی چندین سال دوام میآورد، دیگر فقط یک برنامه نیست؛ تبدیل میشود به یک نهاد. و صداوسیما چه راحت بنیان یک نهاد را با تعطیلی آن متلاشی میکند. در کمتر از یک هفته، خبر تعطیل شدن سه برنامهی رادیویی و تلویزیونی منتشر شد. نخست برنامهی تلویزیونی «رادیو هفت» بعد از ۵ سال پخش زندهی شبانه. این برنامه که هر شب با مجریای متفاوت پخش میشد چه داشت؟ موسیقی آرام، قصهخوانی، گفتوگو در بارهی موضوعات مرتبط با آرامش، حافظخوانی و معرفی کتاب و ترانه. برنامهی بعدی که خبر تعطیلیاش آمد، برنامهی بیستسالهی «صبح به خیر ایران» بود.
و برنامهی سوم، تنها برنامهی تلویزیونی با موضوع موسیقی، آن هم در شبکهي کمبینندهی آموزش، آن هم هفتهای فقط یک شب. یک برنامهی جدی با مخاطب خاص که یک بخش آموزشی هم داشت که در آن استاد جهاندار، آواز درس میداد. گویا مسئولان شبکه ابتدا دستور داده بودند همین بخش آموزشی حذف شود و بعد ناگهان جلوی پخش برنامه را گرفتهاند و رسواتر آنکه گفتهاند دلیلش این است که این برنامه جنبهی آموزشی ندارد! یعنی تصور کنید مطلوب آنان این بوده که لابدّ به جای تدریسِ فقط آواز، مدرسان تار و سهتار و سنتور و کمانچه را هم بیاورند و خدانکرده در رسانهی ملی، ساز هم نشان بدهند! برنامهی موسیقی را میخواهید تعطیل کنید، تعطیل کنید، ولی ارزن را که روی طناب نمیشود پهن کرد! جنبهی آموزشی؟
عجب نیست از صداوسیما که اغلب میکوشد خلاف جهتِ رودخانهی اکثریت جامعه حرکت کند، اما بسی عجیب است خوشبینیِ آنانی که میپنداشتند با آمدن محمد سرافراز به جای ضرغامی، قرار است اتفاق خوبِ خاصی در این سازمانِ بیسروسامان بیفتد. مردم اگر قرار است سرگرم باشند، همین که به خندههای رامبد جوان و جوکهای مهمانانِ «خندوانه» و لهجه و تکیهکلامهای «جنابخان» بخندند، کفایت میکند. کتاب و شعر و هنر به چه کار میآید! مردم اگر موسیقی میخواهند بشنوند، چرا باید «هایهایهای» بیمزه و کسالتبار قربانی و عقیلی و جهاندار و امثال آنان را بشنوند؛ همان دوفدوفهای انواع برنامهها بسشان است! وارد مسائل اجتماعی و سیاسی هم که اصلاً نمیشویم، که همانا با تقوا نزدیکتر است. جنبهی آموزشی یعنی این!
کامنتها
