Skip to content

Commit f69beb9

Browse files
author
lifeoflikhon
committed
translated Function == Comments
1 parent 82e7a01 commit f69beb9

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

1-js/02-first-steps/14-function-basics/article.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -402,15 +402,15 @@ checkPermission(..) // পারমিশন চেক করে, true/false র
402402
এগুলো এক্সেপশন। বেশিরভাগ সময় ফাংশন নাম অর্থপূর্ন ও বিস্তারিত হওয়া উচিৎ।
403403
```
404404
405-
## Functions == Comments
405+
## ফাংশন == কমেন্টস
406406
407-
Functions should be short and do exactly one thing. If that thing is big, maybe it's worth it to split the function into a few smaller functions. Sometimes following this rule may not be that easy, but it's definitely a good thing.
407+
ফাংশন ছোট হওয়া উচিৎ ও একটা নির্দিষ্ট কাজ করা উচিৎ। যদি কোনো ফাংশন বড় কাজ করে থাকে, তাহলে তাকে ছোট ছোট অংশে ভাগ করে ফেলা জরুরি। মাঝে মাঝে এই ব্যাপারটা বিরক্তিকর লাগতে পারে, কিন্তু অবশ্যই ভবিষ্যতের জন্য অত্যন্ত ভালো অভ্যাস।
408408
409-
A separate function is not only easier to test and debug -- its very existence is a great comment!
409+
ছোট ছোট ফাংশন যে টেস্ট ও ডিবাগ করতে সুবিধাজনক তা-ই শুধু না, বরং -- এটা প্রোগ্রামকে অর্থপূর্ন কমেন্টের কাজে সাহায্য করে থাকে!
410410
411-
For instance, compare the two functions `showPrimes(n)` below. Each one outputs [prime numbers](https://en.wikipedia.org/wiki/Prime_number) up to `n`.
411+
উদাহরণস্বরূপ, দুইটা ফাংশন `showPrimes(n)` এর পার্থক্য নিচে দেখানো হলো। প্রতিটা-ই [মৌলিক সংখ্যা](https://en.wikipedia.org/wiki/Prime_number) রিটার্ন করে `n` অব্ধি।
412412
413-
The first variant uses a label:
413+
প্রথমটা একবারে কাজ করেঃ
414414
415415
```js
416416
function showPrimes(n) {
@@ -424,7 +424,7 @@ function showPrimes(n) {
424424
}
425425
```
426426
427-
The second variant uses an additional function `isPrime(n)` to test for primality:
427+
পরেরটা নতুন ফাংশন `isPrime(n)` কল করে মৌলিক সংখ্যা চেক করার জন্যঃ
428428
429429
```js
430430
function showPrimes(n) {
@@ -444,9 +444,9 @@ function isPrime(n) {
444444
}
445445
```
446446
447-
The second variant is easier to understand, isn't it? Instead of the code piece we see a name of the action (`isPrime`). Sometimes people refer to such code as _self-describing_.
447+
দ্বিতীয়টা বুঝতে সুবিধাজনক, তাই না? ভিতরের ফাংশন (`isPrime`) দেখে এর কাজ বুঝে যাওয়া যায়। মাঝে মাঝে প্রোগ্রামাররা এইধরনের কোডকে _স্ব-বর্ণনাকারী (সেলফ-ডেস্ক্রাইবিং)_ বলে থাকে।
448448
449-
So, functions can be created even if we don't intend to reuse them. They structure the code and make it readable.
449+
এর মানে ফাংশন তৈরি করা যেতে পারে যদি আমরা পরে ব্যাবহার না করতে চাই তবুও। সেটা কোডকে সাজাতে ও বুঝতে সাহায্য করে।
450450
451451
## Summary
452452

0 commit comments

Comments
 (0)