Saturday, June 19, 2021

Tips from "The pragmatic programmer" book



"The pragmatic programmer" book has all these tips highlighted and are mentioned in Quick Reference Guide.
  1. Care About Your Craft
    Why spend your life developing software unless you care about doing it well? 

  2. Think  About Your Work
    Turn off the autopilot and take control. Constantly critique and appraise your work.

  3. Provide Options, Don,t Make Lame Excuses
    Instead of excuses, provide options. Don't say it can't be done: explain what can be done.

  4. Don't Live With Broken Windows
    Fix bad designs, wrong decisions, and poor code when you see them. 

  5. Be a Catalyst for Change
    You can't force change on people. Instead, show them how the future might be and help them participate in creating it. 

  6. Remember the big picture
    Don't get so engrossed in the details, that you forget to check what's happening around you.

  7. Make quality a requirement issues
    Involve your users in determining the project's real quality requirements.

  8. Invest regularly in your knowledge portfolio
    Make a learning habit.

  9. Critically analyze what you read and hear
    Don't be swayed by vendors, media hype, or dogma. Analyze information in terms of you and your project.

  10. It is both what you say and the way you say it
    There is no point in having great ideas if you do not communicate them effectively. 
  11. DRY-Don't Repeat Yourself
    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system. 

  12. Make it easy to reuse
    If it's easy to reuse, people will. Create an environment that supports reuse. 

  13. Eliminate effects between unrelated things
    Design components that are self-contained, independent, and have a single well-defined purpose.

  14. There are no final decisions
    No decision is cast in stone. Instead, consider each as being written in the sand at the beach, and plan for change.

  15. Use tracer bullets to find the target
    Tracer bullets let you home in on your target by trying things and seeing how close they land.

  16. Prototype to learn
    Prototyping is a learning experience. Its value lies not in the code you produce, but in the lessons. you learn. 

  17. Program close to the problem domain
    Design and code in your user's language

  18. Estimate to avoid surprises
    Estimate before you start. You'll spot potential problems up front. 

  19. Iterate the schedule with the code
    Use the experience you gain as you implement to refine the project time scales. 

  20. Keep knowledge in plain text
    Plain text won't become obsolete. It helps leverage your work and simplified debugging and testing.

  21. Use the power of command shells
    Use the shell when graphical user interfaces don't cut it. 

  22. Use a single editor well
    The editor should be an extension of your hand: make sure your editor is configurable, extensible, and programmable.

  23. Always use source code control
    Source code control is the time machine for your work - you can go back.

  24. Fix the problem, not the blame
    It doesn't really matter whether the bug is your fault or someone else's -- it is still your problem and you still need to fix it.

  25. Don't panic when debugging
    Take a deep breath and Think! about what could be causing the bug.

  26. "select" Isn't broken
    It is rare to find the bug in the OS or the compiler or even the third-party product or library. The bug is most likely in the application. 

  27. Don't assume it, prove it
    Prove your assumption in the real environment -- with real data and boundary conditions. 
     
  28. Learn a text manipulation language
    You spend a large part of each day working with text. Why not have the computer do some of it for you?

  29. Write code that writes code
    Code generators increase your productivity and help avoid duplication. 

  30. You can't write perfect software
    Software can't be perfect. Protect your code and users from the inevitable errors. 

  31. Design with contracts
    Use contracts to document and verify that code does no more and no less than it claims to do. 

  32. Crash early
    A dead problem normally does a lot less damage than a crippled one. 

  33. Use assertions to prevent the impossible
    Assertions validate your assumptions. Use them to protect your code from an uncertain world.

  34. Use exceptions for exceptional problem
    Exceptions can suffer from all the readability and maintainability problems of classic spaghetti code. Reserve exceptions for exceptional things. 

  35. Finish what you start
    Where possible, the routine or object that allocates a resource should be responsible for deallocating it. 

  36. Minimize coupling between modules
    Avoid coupling by writing "shy code" and applying the Law of Demeter.

  37. Configure, don't integrate
    Implement technology choices for an application as configuration options, not through integration or engineering. 

  38. Put abstractions in code, details in metadata
    Program for the general case, and put the specifics outside the compiled codebase.

  39. Analyze workflow to improve concurrency
    Exploit concurrency in your user's workflow. 

  40. Design using services
    Design in terms of services -- independent, concurrent objects behind well-defined, consistent interfaces.
     
  41. Always design for concurrency
    Allow for concurrency, and you'll design cleaner interfaces with fewer assumptions. 

  42. Separate views from models
    Gain flexibility at a low cost by designing your application in terms of model and views.

  43. Use blackboards to coordinate workflow
    Use blackboards to coordinate disparate facts and agendas, while maintaining independence and isolation among participants.

  44. Don't program by coincidence
    Rely only on reliable things. Be aware of accidental complexity, and don't confuse a happy coincidence with a purposeful plan. 

  45. Estimate the order of your algorithms
    Get a feel for how long things are likely to take before you write code. 

  46. Test your estimates
    Mathematical analysis of algorithm doesn't tell you everything, try timing your code in its target environment.

  47. Refactor early, refactor often
    Just as you might weed and rearrange garden, rewrite, rework, and re-acrchitect code when it needs it. Fix the root of the problem.

  48. Design to test
    Start thinking about testing before you write a line of code.

  49. Test your software, or users will
    It's the best way to gain insight into how the system will really be used.

  50. Don't use wizard code you don't understand
    Wizards can generate reams of code. Make sure you understand all of it before you incorporate it into your project. 

  51. Don't gather requirements-Dig for them
    Requirements rarely lie on the surface. They are buried deep beneath layers of assumptions, misconceptions, and politics.

  52. Work with the user to think like s user
    It's the best way to gain insight into how the system will really be used.

  53. Abstraction lives longer than details
    Invest in the abstraction, not in the implementation. Abstractions can survive the barrage of changes from different implementations and new technologies. 

  54. Use a project glossary
    Create and maintain a single source of all the specific terms and vocabulary for a project. 

  55. Don't think outside the box, find the box
    When faced with an impossible problem, identify the real constraints. Ask yourself: "Does it have to be done this way? Does it have to be done at all?"

  56. Start when you are ready
    You have been building experience all your life. Do not ignore niggling doubts. 

  57. Some things are better done than described
    Do not fall into the specification spiral -- at some point, you need to start coding. 

  58. Don't be a  slave to formal methods
    Don't blindly adopt any technique without putting it into the context of your development practices and capabilities.

  59. Costly tools don't produce better designs
    Beware of vendor hype, industry domain, and the aura of the price tag. Judge tools on their merits.

  60. Organize teams around functionality
    Do not separate designers from coders, testers from data modelers. Build the team the way you build code. 

  61. Don't use manual procedures
    A shell script or batch file will execute the same instructions, in the same order, time after time. 

  62. Test early, test often, test automatically
    Tests that run with every build are much more effective than test plans that sit on a shelf. 

  63. Coding ain't run till all the test done
    You can not claim that the code is usable until it passes all of the available tests.

  64. Use saboteurs to test your testing
    Introduce bugs on purpose in a separate copy of the source to verify that testing will catch them.

  65. Test state coverage, not code coverage
    Identify and test significant program states. Just testing lines of code is not enough.

  66. Find bugs once
    Once a human tester finds a bug. It should be the last time a human tester finds that bug. Automatic tests should check for it from them on.

  67. English is just a programming language
    Write documents as you would write code: honor the DRY principle, use metadata, MVC, automatic generation, and so on. 

  68. Build documentation in, don't bolt it on
    Documentation created separately from code is less likely to be correct and up to date.

  69. Gently exceed your users' expectations
    Come to understand your user's expectations, then deliver just that little bit more. 

  70. Sign your work
    Craftsmen of an earlier age were proud to sign their work. You should be, too. 




Wednesday, October 2, 2019

It's not just a hackathon

"The Algorithm Is Female" hackathon was produced by Hemper together with Code Rush and supervised by Ironhack with a slogan of "tech has no boundaries, age and gender". Getting selected as top 30 was overwhelming for me. TAIF hackathon was different from any other hackathon. Usually in hackathon people go with pre mindset. They have their own team, ideas and pre selected languages but not in TAIF hackathon

Day 1

A sketch on TWFN board
At 8:00 A.M., I entered the venue: softwarica college, there was a list of names along with the team. I was on team 3 (5 members: Dipti, me, Prerana, Sumi, Upasana). Instructors were assigned to each team. The hackathon started with the javascript warm up. After that we were said to write down the communities we had around and select two best. We got a list of at least 10 communities and selected two best communities "Street vendors" and "Harassment Survivors". The best part was we had to go to those communities and actually find out what they were doing and what were their problems and returned back till 2:30 P.M. So quickly we divided ourselves into two teams and went to those communities. I showed interest of going to harassment survivors communities. We had two options: "Maiti Nepal" and "The Women's Foundation Nepal".
Scarfs on TWFN

For "Maiti Nepal" we had to have pre-appointment. We sent mail but it wasnot responded and we could not wait long. So we moved to "The Women's Foundation Nepal". There we could see all the girls busy washing raw clothes, ironing, weaving and so on. We wanted to talk to the girls but the authority said "the girls are not comfortable with talking to people". So we talked with the authority. They gave us the insight of the organization and women working there. We could see numbers of scarfs and dhaka stuffs piled up in the store. As we had very limited time, we returned back. The problems of metropolitan police and season were seen  on our other community-street vendors. We were asked to choose one community. We chose harassment survivor because we could connect to the topic more being a women. Then asked to list all the problems we found and choose one problem we wanted to solve."Lack of platform to sell their products" was selected.

Day2 

The Survivor's Hub
We  were asked to find all the possible solutions for that specific problem. Then asked to pick one that we can solve with technology. So we thought of a solution which not only create a platform for them but it would be a home for them. We decided to build a virtual community hub and named it "The Survivor's Hub". The survivor's hub is not only online buying and selling platform, it provides the educational materials, story sharing, collaborations, donations and so on. We, all of us on team had different technical background so it was hard for us to select one language for coding. But as php was familiar to all of us, we chose php. We first started prototyping then coding. We had to submit prototype by 5:00 PM. By 10:00 PM, we had completed coding. And what remained was to wait for next day, the final day.

Day 3

Cheers to best team work
It was a final presentation day. First we had to present in front of organizing team. We had to prepare 10 min presentation. Then we had to present final presentation of 5 min for the guests. All two presentations went well. The result was on the basis of all 3 days performance. We got very good feedback as the survivor's hub had social and technical impact. At last our team got awarded with "Best Teamwork". But sadly I could not make to top five.

Whatever the result is, it was great experience for me.Thanks to Jyaasa Technologies for unconditional support. I really appreciate Astha Sharma from code rush for her regular support and mentorship. Thanks to Gloria Gubians, Marta Aguilar and Ricardo Boluda. Learned a lot from all of you.

Finally, it turned out not just a hackathon for me but a self realization. Addressing many communities and problems left me questioning myself "Am I doing enough?" 
 


 

Saturday, July 20, 2019

Getting Real- Book Review

Getting Real is the book suggested to me at my boot camp. It is a book by 37 signals (a web application company) revealing the secret towards its success and growth. As I dig into the pages, I find out how useful it is to new beginners:- designers, programmers and businessmen.

The book starts with the meaning of getting real.  Let me remind you again, getting real is written by 37 signals so the examples, story and plots mostly tilt towards the company procedures and IT sectors. But the main gist of the book is applicable to everyone in real world.

The book mainly focus on how to extract more from less. It justifies the point "Less is more" throughout. Start with whatever you have, not waiting for client to pay. Fund yourself. The book gives an example of "The Three Musketeers" :- developer, designer and a sweeper (someone who can roam between both worlds). A good software requires enthusiastic people willing to give their best, whose action speak more than words.

It's not necessary to have the perfect CSS, necessary features should be focused first. If any feature is already available, just integrate it in the system. Do not waste much time. Designs and specification does not give clear view to client so working software is preferred. Build it soon and optimize accordingly.

Meetings and discussions are boring. Team members can have get-together, short chats, enjoy on drive and with coffee. Most of the celebrations are done on the completion of project but it's necessary to celebrate small victories. Just target on a simple process and celebrate on its completion. Do not wait long.  Developer should have alone time to code perfectly.

In design, paper sketch but prefer html sketch or use wire-frame. Design the main core of the product. Do not worry about header and footer. Always look for regular(when client are using it with data entry), blank(when no data is entered) and error(when data is entered but error appears) state solutions. In case of errors, get defensive about product. You need not be consistent but whatever you do on that time, do it fruitful. Be intelligent. Be fast.

Code lesser lines. Use less software. Use the tools which are interesting to use, which brings happiness to the programmers and excites them.  Listen to your codes. They are always locating where the errors are. The client should always be able to use the software to check if the requirement is met or not even in preliminary phase

 Do not write documents neither build a wire-frames if it is not turning real. If ask, just give simple brief of what it does, do not dive into technical explanations directly. During the system testing use the words what the user uses. Fill the form as like the users. Using real values help to find out the inadequacy on software. Treat your product as a person.

Suppose you are a singer and making an album, drop a song for free. Similarly give the user some free features. The registration and sign-out form should be as short and simple. Never try to make extra charge for preexisting users. Always deliver the unpleasant and uncertain messages without demotivating developers.

Promote in holy wood style: teaser, preview and launch. Make a interactive promo site like blog. Tell what's happening. Start early. Share your knowledge which make people always wanting to see the final product. Track the viewers, make lists and respond to them. Catchy name are preferred over technical terms for the project.

Responsive product is preferred with less manuals and training to use. Create a forum for the users where they can share and talk to each-other about the products, Appear on the forum whenever it is necessary.

Admit the problem yourself even if the customers are unaware of it. Track what people say about the product after launch. Always appreciate the writers and comment back even if negative. Do not release the beta version. It destroys the trust of users toward original release. Prioritize the bugs. All bugs are not to be treated. One that destroys the database should be treated first. Always be prepared for the storm. Go with the flow. Do not panic.

As the book ends, I realize what we can do with what we have, how less is enough, how being honest work and how a successful company is build. I really want to thank 37 signals for this amazing book. It will really help me in my career. And I want to suggest all the beginners to read this book once to know how things work.




Thursday, June 27, 2019

Prime Minister Employment Program (E-recruitment System)


PMEP(Prime Minister Employment Program) is a program launched by Nepal government in order to create and offer employment opportunities for the unemployed and economically active chunks of population in the country which guarantees income security. This. in other words, is the extension of social protection policy in Nepal and is an integral part of the Social Protection Floor (SPF) which aims to address the situation of working age people who are unemployed, as mentioned above, or are not receiving social benefits. For this program, the first phase is the recruitment of Officer and Nayab Subba. Under the Recruitment of Officer and Nayab Subba, first the online applications and then the exam was to be held. Then the selected officers and Nasu have to collect the data of unemployed people and ensure their employment.

For this purpose a website was hosted under www.pmep.gov.np. The whole website and e-recruitment system was developed on php/CI.
www.pmep.gov.np(home page)


About PMEP e-recruitment system
PMEP e-recruitment system consists of online application and exam system.
Both of the system are build using:
php using CI
mysql for database
javascript and css for designing


Online application

+2 and Bachelor was the minimum criteria for Nasu and Officers respectively. So people who have the required educational qualification could apply for the post.

Shorlisting criteria:
70% of secured marks in minimum educational qualification, 20 for higher educational qualification and 10 for experience.




summary for phase 2 

Exam System


The shortlisted candidates had to appear multiple choice questions. They had to answer 25 questions and each questions hold 2 marks. Each candidates were given 30 minutes to complete the questions. The candidates could see the time remaining at their screen along with the questions they had attempted.

The exam was scheduled for 2 days on ICTC Pulchwok. First day it was for the officers of 4 province. Next day it was of remaining provinces officers along with nasu. The examof province 1 which was cancelled on day 1 was also held next day.

Expected number of candidates did not pass the exam. The e-recruitment system was re-held to fulfill the vacant seats. So the whole recruitment system was of phase-1 and phase-2.

People crowd at ICTC during first day of exam
Technological difficulties

1.The website was hosted on C-panel.
A huge number of people tried for online application even on first few days resulting slow connection. So the online application was stopped for a while and switched it to virtual hosting with unlimited space. After that there was no problem on both phase-1 and phase-2 online applications.

2.At the first day of exam in phase-1 due to slow server connection, the exam of province 1 was shifted and scheduled for next day. The other schedule remained as it was, with no difficulties.

As a developer I feel proud to be engaged in pmep erecruitment. Pmep itself is a big project going on in the country and this e-recruitment is a big initiation for it.

My special thanks to Oxford Policy Management Family
Milan Karki-Project Co-ordinator
Suresh Man Joshi-Developer
Sanima Shrestha-Developer

I am really thankful to all the officers of Prime Minister Employment Program who stayed with us
during the development of software and its implementation. Thank you for your support.

PMEP is a good step taken by the government of Nepal. I really wish no  Nepali go to sleep with hungry stomach and no roof to hide head on from now. I wish PMEP for a long run creating greater Nepal and a better home.

Thank you