Posts Tagged ‘php’

Life and Tech – Choices, Decisions and Options

A couple of weeks ago Friday, I shared lessons from my life in technology with a team of upcoming software developers, Life in the Tech Lane, and I got a number of follow-up questions like the one below. On reading the questions, it spurred this post as the responses needed to be long form

For that matter I got a number of questions that I would like you to address that I couldn’t easily ask yesterday. These are the questions that I have:

How did you know that software delivery is your thing, amongst all the various options?

My first taste of technology related work was in my S.6 vacation at an email service firm where I helped develop UNIX training materials, setup & troubleshoot modems for email services, and my initial foray into server scripting. I worked on this through my undergraduate course, even when I worked in a civil engineering consultancy it was all software related work. I was hooked, to the problem solving, creation of digital solutions & learning that came along with the work, making my life very interesting.

Over time, I have embraced the challenges of having to develop solutions quickly, train users, support them as products evolve, which has kept me in the line of work.

I also tried management, and found out it was not for me thus came back in the trenches. However I come with a lot more value, I understand the needs of executives in a sector, can put myself in the eyes/place of a user and have a good handle on technology.

Overall it seems like software delievery chose me, I am still engaged 20+ years later, and see a future as an older software developer/engineer by evolving myself and skillsets to maintain relevance

 Why PHP and not the other languages, I mean there is a number of new technologies and spaces being created everyday, why stick to the”old” one PHP?

I started programming in UNIX shell scripting, Turbo Pascal, Visual Basic 6 and Visual Basic for Applications (for Excel), Java 1.1 & 1.2. At the time of Java we were building enterprise web applications, however deployment was a challenge which was how one of the clients introduced us to PHP.

This is a language made for the web, with lots of libraries through PHP Classes, Stack Overflow and other sites. The frameworks, Symfony, Code Igniter, Yii simplified the process of building and maintaining custom web applications. Addoitional solutions, such as CMSes (Joomla, Xoops, WordPress) were the foundation for website development.

I used PHP for over a decade, during which I became familar with the language, quirks (that were reduced in versions 5.6 and the 7.x series), thus it became a familiar tool which I can keep using within the space for my current and future work.

I have also learnt and used Python, Ruby on Rails, Java 8 (which I use in my day job), however I find the PHP language my tool of choice to provide technology solutions as it aligns with how I solve problems. This has been made easier with the Laravel framework, which provides a great eco-system with alot of existing tools & solutions, so I can focus on business problems rather than tech and tooling.

What advice would you give me as a young profession who is in the early days of formal employment in the tech industry. I have a challenge about my career path or direction. I want and I feel more joy when doing data science/analytics work but I have failed to get the opportunity of pursuing that space and it’s for that reason that I have taken on the software development path as these are the opportunities that have been available, it’s not that I don’t enjoy it, I do but my utmost passion is data science. What advice would you give me regarding that?

  1. The best way to predict the future is to create it. A future in technology is easier to create leveraging opensource tools and technologies – thus if you want to do data science, I would suggest picking a problem you are passionate about and spend your personal development time growing it, working on it, writing about it (you need to share your lessons and paths) so that you keep growing
  2. Find opportunities within your current employer for the data science/analytics work – if opportunities do not exist, create them by talking to your colleagues, taking part in meetings/discussions or even starting the discussions on leveraging data science/analytics within your organization
  3. Take time to get better at the role you are hired to do, as that can provide the basis to growth and opportunites being taken on you
  4. Join local meetups and activities around data science/analytics to grow your network
  5. Take courses on your chosen path to ensure you are ready to take up any opportunities that come up
  6. Be persistent in finding opportunities along your chosen, do not give up it may take longer than expected

Voice of the ElePHPant Podcast – PHP, Technology Journey, Opensource, Java

I am excited to have been hosted on the Voices of the Elephant podcast by Cal Evans

https://voicesoftheelephpant.com/2020/06/23/interview-with-stephen-s-musoke/

Talking about my technology journey, opensource, Java, PHP (of course) and what I am doing with it in Uganda and Africa

Uganda Web Developer Workshops: Rotary Style – Idea looking for Partners and Direction

This is an idea that has been growing in my mind, and I seem to finally have a handle on it. I have been a professional PHP web developer for the last 12 years, and have gone through the learning and transition cycles from learning a new language from Visual Basic 6 and MS Access to Java/JSP/Servlets to PHP, and developing in the language from direct database access using mysql_query through a custom developed database class into Zend Framework for 2 years with Doctrine 1 and 2 ORMs.

My biggest challenge has to do with the fact that there are no places to go and talk code, PHP/Javascript/Database in Uganda, along with the experiences and challenges facing web development with “need-to-have” practices like:

  1. Refactoring
  2. MVC design for web applications
  3. Version control – branching, merging, version tagging and management
  4. Testing – unit and functional testing, load testing
  5. API development (okay this is pushing the enveloper)
  6. Continuous integration, code quality metrics – complexity, modular development, cyclomatic complexity
  7. Team Style development – PSR 0 and PSR 1 compatibility
  8. Frameworks – Symfony, Zend Framework, Kohana, JQuery, Twitter Bootstrap
  9. Advanced CSS and HTML 5 – style guides, browser targetting, mobile development

I am also looking at doing this Rotary style, 1 hour developer meetings once in 2 weeks, then later once a week, same night, same location.

The bottom line is that we develop the quality of the available pool of web developers by growing a community, having role models, to also put a brighter face on the industry, improve perceptions and make it clear that this is an area that has professional practices. It is a win-win for all involved

Any ideas who has done this before, what were your challenges and trials, who would like to partner on this?

The Poor Man’s Job Queue

Not all software development projects are treated the same, some have access to modern tech Virtual Private Servers (VPS), Zend Server (http://www.zend.com/products/server/), Memcached, Gearman and all the other goodies I can only dream of. You have a box with LAMP, and you cannot install anything else.

This is an example of how we got around a limitation, using available tools. Problem: I have a list of tasks to execute within my application, however I need to ensure that the tasks are executed and completed, but some are more important than others, and the execution may slow down the performance of the box we are running on. Well in this case we were loading 6 different types of XML files which were FTPed into a location on the box regularly, every 35 minutes and had to be loaded in a specific order. This was further complicated by the fact that we had to reload historical data in case of issues (1 weeks worth of uploads ~ 2100 files) without interrupting the current loading processes.

The approach used the following components:

a) Job Queue – based on the Zend Server Job Queue but simplified for our needs (see data model of tables below)

Job Queue Data Model

Job Queue Data Model

b) Queue Loader Script – loads the jobs into the job queue by scanning the location containing the files to be loaded and adds the files to the queue (since the queue is a database table, duplicates are discarded without errors) This keeps this file simple and honest

c) Job Executor Script – reads a message from a queue, reads the message body which contains the file name to be processed, could be made more complex

d) Queue Loader Cron Job – calls the Queue Loader Script to add new files to the queue

e) Job Executor Cron Job – calls the job executor script. This job has no effect if a lock file exists, and is not expired which means the script is valid and running. However if the lock file is expired, it means that the process crashed, so the lock file is deleted, a new process is started with a lock file. Basically this keeps the job executor script running indefinitely as long as there are messages to process. 

Please feel free to leave a comment on what your experiences are with similar problems. 

Doctrine2 Day 3 – Proxies, Associations, Relationships

Well if you are following this series, then by know you are aware that we have the validators setup, and we are almost ready to go. Well not quite so. I ran into an issue with proxies and class loaders which took a while to resolve, but what I did was:

a) Changed the Zend Framework-Doctrine2 integration to the Bisna integration (https://github.com/guilhermeblanco/ZendFramework1-Doctrine2) – note the additional configurations before

b) Learnt that DO NOT SAVE ANY MODELS IN SESSION OR CACHES due to Proxy auto loading issues

c) Develop unit tests for the model validations and saving as you go along because they will save you as you shift things around . I am currently trying to save an association to the database but due to the tests that I have running I can test out the different association mappings without issues because I track the changes using my unit tests.

Now onto relationships, well what I found was a follows:

  1. I have been having a tough time dealing with relationships from Doctrine 1 which autoloaded relationships, however with with the Doctrine2 data mapper, you have to auto load the associations your self
  2. In Doctrine 2, you cannot define the foreign key column and relationship as this creates problems for the ORM mapper, so since I need to access the foreign key value for example personid, and the related object person, my approach has been as follows:
    • Added a person instance and relationship mapping to the person as per the Doctrine
    • Add a setter setPersonID() which loads the Person from the database using the provided ID and sets it to the person relationship provided
    • Added a getter getPersonID() which obtains the id of the person for use on the screen
  3. As recommended avoid bi-directional relationships where possible, try to keep them as uni-directional as possible.

Next I will be implementing a nested hierarchical structure using the tree nested set implementation at http://www.gediminasm.org/