מים אפורים

Posted by Lee Elenbaas

לאחרונה מכרנו בית. בית שגרנו בו חמש שנים, הממוקם בעיר מדברית חמה. הקונה לא אהב חלק מן הדברים שעשינו, בכללם את מחזור המים האפורים, ושינה זאת. לפני המכירה, השכרנו את הבית לכמה שנים. כבר עם הדייר, הפסקנו את הפעלת מחזור המים, אבל לא ביטלו את האפשרות לחלוטין. עם המכירה האופציה בוטלה ונקברה ע”פ השינויים שעשה הקונה.

זה הביא אותי להסתכל על אורך החיים של הדיירים השונים בדירה.

עבורנו, החצר היתה חלק מן הבית. כמעט כל ימות השנה הדלת לחצר פתוחה, והילדים נכנסים ויוצאים בכל שעות היום.

עבור השוכרים החצר הפכה להיות מקום שמנצלים אותו רק בזמנים מסוימים כמשפחה. תדירות הניצול היתה של כמה פעמים בשבוע, אבל כבר לא כל הזמן.

הקונים, בינתיים, סגרו את החצר כפרויקט עתידי ולא ממש עושים בה שימוש.

מיזוג אויר

הסיבה המרכזית לשינוי באורך החיים שלנו מול השוכרים וקונים הינה המזגן.

במשך חמש שנים חיינו בדירה המדברית הזו ללא מזגן. השאלה האם לשים מזגן עלתה כל שנה,וכל פעם נדחתה מסיבות כלכליות. לא שלא יכולנו להרשות לעצמנו, אלא שהעדפנו לעשות דברים אחרים עם הכסף.

בנוסף איכות החיים שלנו מבחינת מזג אויר בבית עלתה משנה לשנה. עם התקדמות פיתוח הגינה.

נשארנו הרבה איך אנחנו חיים ללא מזגן. בדיעבד אני חושב שהתשובה היתה הגינה.

ברגע שבו עבור השוכרים הותקן מזגן. הדלת לגינה הפכה מפתוחה לסגורה.

השקיה

בתקופת המגורים שלנו, השקינו את הגינה על בסיס יומי. השקנו כמה מאות ליטרים ביממה בגינה. מה שאיפשר לגדל דשא, כמה עצים ושיחים ופרגולה של גפנים.

הנוכחות העצומה של מים בקרקע ובצמחי הגינה מיתנה את מזג האוויר המדברי, ואפשרה את החיים ללא מזגן.

בנוסף הגפנים שהלכו והתפתחו בחיבור בית הבית לשאר הגינה נתנו הפרדה של צל בין הבית למדבר.

השוכרים קיבלו מספר צמחים מבוססים,ביניהם את הגפנים. השקו הרבה פחות. אבל המשיכו לטפח את הקיים.

הקונים בינתיים מייבשים את הגינה ומחזירים את המדבר.

מים אפורים

הדבר שאיפשר לנו להשקיע כזו כמות של מים בגינה היה מחזור מים אפורים.

למעשה כל המים שהושקעו בגינה היו מים משימוש חוזר. מים של מקלחת, כביסה ותשתיות ידיים. תקופה קצרה אפילו של של כיור המטבח, אבל כמות הליכלוכים היתה גדולה מדי וההתעסקות עם הפילטר היתה רבה מדי שזה בוטל.

התחלנו את מיחזור המים מאידיאולוגיה, בשילוב שיקול כלכלי שזה יחזיר את עצמו עם הזמן.

כלכלה

זה לא החזיר את עצמו כלכלית.

ההשקעה בשינוי הצנרת לצורך הפרדה של מים אפורים בתור דבר ראשון.

ההשקעה בהמשך בפתרונות ביתיים למיחזור ופילטור שכולם נכשלו.

ולבסוף ההשקעה במערכת מחזור קנויה עם פילטרים ומקוריות שאיפשרה גם את הדחת האזנות במים האפורים.

ביחד עם ירידת מחיר המים שבאה עם כניסת מים מהתפלה למשק המים בישראל, הורידה את ההחזר החודשי על המיחזור.

התשומות

כן היתה משמעות כלכלית למיחזור. המשמעות היתה חשבון מים חודשי קטן משל שכנינו למרות שלא חסכנו בשימוש במים כלל. זה נהיה מורגש יותר רק לאחר חיבור הדחת האסלות למיחזור.

מערכת המיחזור והגינה דרשה התעסקות שוטפת. ניקוי פילטרים, גיזום, טיפוח, שתילה… התעסקות זו הביאה אותי להיות מחובר יותר לבית ולמשפחה.

מרחב המחיה שלנו בדירה היה רחב יותר. בזכות הכללת הגינה במרחב המשחק של הילדים, ומרחב הפעולה השותף של המבוגרים.

קדימה

בשורה התחתונה, מיחזור מים אפורים נתן לנו יותר מאשר לקח. אם נעבור שוב לדירה בה זה יעמוד על הפרק, אני חושב שנחזור על ההרפתקה.


מעבר למכשול

Posted by Lee Elenbaas

מעבר למכשול

כשהאופוריה חוגגת

אחרי המאמץ

פתאום המשקל קל יותר

הקרקע קופצנית

והחיים מחייכים

אפילו האכזבות נראות טוב יותר

לפחות עד שהתחושה תחלוף


Converting goto

Posted by Lee Elenbaas

I am working on a task I thought have passed from the world: Converting “goto” code to functional programming. And I am doing it in modern Javascript code.

This was covered by articles over 20 years ago, see http://ieeexplore.ieee.org/xpl/articleDetails.jsp?tp=&arnumber=126773&url=http%3A%2F%2Fieeexplore.ieee.org%2Fxpls%2Fabs_all.jsp%3Farnumber%3D126773

The basics are the normal loops, conditionals, break and continue.

Conversion rules

  • If you have a goto that jumps forward can be replaced by a simple if on the code it jumps over.

  • A goto that jump backwards is converted to loop. either a do-while loop, or an infinite loop.

  • Several jumps forward with overlapping skipped code can be made using flags, each goto condition will set the appropriate flags, and the code execution will depend on the flags.

  • Multiple jumps backward can be replaced by a single infinite loop, and appropriate flags.

In general, it is best to understand what the code tries to do. There is usually a better way then just make it work with the new tools.


No spaces?!

Posted by Lee Elenbaas

Readability

I am a firm believer of making code readable.

Readable code helps everyone, including the person who wrote it, to get into the code. Makes it easier to understand the logic, easier to fix bugs when you need to, and easier to re-factor if necessary.

There are basically two approaches:

  • Make it readable to everyone - by making it as simple as possible and as close as possible to English.
  • Make it follow a project convention.

You can see that the first option is a specific case of the second. Only the convention is very low level, with the attempt to target as many people as possible.

Up until now I always practiced the first option. Both in the companies i worked for and in my personal projects. And was confident that this is the correct route to go by. Right now i am in a company where i need to learn the convention used by the company. And this forced me to rethink my approach.

When I look at large projects, they all develop their own convention. Even if the developers strive to keep the code readable to everyone. The introduction of library functions, utilities, custom markup tags… all generates a new convention, one that is project specific. Anyone who try to get into a large project, have to understand enough of those project specific building blocks in order to be productive.

On the other hand, right now I have to face one of the steepest learning curves i have ever had to climb due to this project specific convention that I have to get used to.

In my case the major thing i have to get used to is condensed code. No spacing, no unnecessary characters, no comments, no empty lines. And did i say it before: no spaces. even between sections of code that have different roles.

Comparing apples and oranges

When you compare the two approaches you get the following table:

  English like Project specific
Audience Wide Narrow
Learning curve Low High
Code size Higher Minimal

Lets look at each factor.

Audience

For projects that target wide audience. Educational projects, open source project, the wider the audience who can read the code, the better. For closed in house projects, the company really care only that the people inside the company will be able to easily get into the code, so it becomes a non-issue for them. Unless they have plans to open the code up in the future.

Learning curve

This is a clear cut. In every project, people change and new people need to come in. The steeper the learning curve is, the harder it is to get new people into it.

Code size

This is another clear cut. Smaller code means less bugs, and less to read and understand.

Conclusion

The bottom line is that whatever you will go by, you will make a compromise. Just make the right compromise for the project you are working on.


5 hours a day

Posted by Lee Elenbaas

New job

Started a new job yesterday. I am back in the position of learning from scratch.

This new company has a strong emphasis on the organizational culture:

  • How to write the code
  • How to get a task
  • How to work on it
  • How to report it
  • How to email
  • How to communicate

And more…

I can tell from the tools and the code base that the company has roots deep into the C/C++ Eco system, despite the work itself being in JavaScript. This means different tools and mindset then in most other JavaScript places I encountered.

Something I’ll have to get used too.

Commute time

But the mind boggling thing to me is the commute time.

2.5 hours for each direction. 5 hours a day. Half a day goes for every workday.

Yes I know it before I took the job, but knowing is not the same as feeling. Yesterday was the first day in a long while where I haven’t seen any of my kids awake at all. I left before they woke up, and came back after they already fall asleep. Why this morning I left only after I saw them leaving for their day.

Transportation

I rolled out a car since for it will be Russian Roulette with almost fully loaded gun.

I know I will fall asleep on the wheel. The only questions are when it will happen, and how badly I’ll be hurt.

This leaves public transportation, that is less then friendly.

Current rout

  • Home to bus station - same as with my previous work, mostly by car when my wife drop off the kids.

  • Bus to the train station - same as with the previous work. Sadly the bus usually arrive just as the train leaves so I have to wait for the next one.

  • Train to a more central station,where I’ll wait for the train that will get me to work

  • Train to train station closest to work

  • bus or shuttle to work

And the ride home is the same in reverse.

I just realized I forgot to measure the times for each segment. I’ll do it in the next few days and report it.

Mitigations

There are mitigating factors.

I can start the work on the train. Most days there is enough space to work. I have the laptop with everything I need on it. I just need to organize it, something I plan to do this week.

This should give about 90 min of offline work in each direction.

Future

I plan to improve the first and last parts by moving back to the bike.

A new train station is planned closer to my work that will eliminate one step from this route.

The real mitigator is, working from home. I do not plan on working totally from home, history thought me thus is problematic for me, but a few days a week will be great.

Rewrite

I am rewriting this post, more annoyed then I was when I first wrote it, since I lost it over network issue along the way. Mobile is not a good enough tool, yet.