Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts
Saturday, November 19, 2016
Monday, October 24, 2016
Thoughts on Refactoring Code
![]() |
| http://www.ben-morris.com/wp-content/library/refactoring-vs-rewriting.gif |
I'm working on my CareerCoach job research tool, and I'm finding it very tricky to refactor the code.
There are too many moving parts, too many variables.
I'm trying to convert blocks of code into functions, which means that I have to turn variables into global variables, and that gets confusing.
I think I need to map out in more detail what I'm trying to achieve and then work on each component separately.
For now, it's time for a break.
Saturday, October 22, 2016
Thoughts on My First Code Retreat
When I turned up at the annual Melbourne Coderetreat, I was nervous and reticent. I am not a professional programmer -- yet -- and I had no illusions of keeping pace with people who do this for a living. Nevertheless, I stuck it out and learned an awful lot. The organisers Tomasz and Ilya did a fine job of running the event, and I appreciate their encouragement.
Conclusions and Ideas:
Conclusions and Ideas:
- Do puzzle programming.
- Make code kata a regular practice.
- Focus on one language, either Python or Ruby and learn programming concepts thoroughly.
- Attend programming meet-ups, preferably for Python or Ruby, and seek out a mentor.
- Attend a DevOps meet-up, at least once.
- Make code dojos and retreats a priority.
- Learn TDD. (Test-driven development)
- Familiarise myself with a testing framework. Using a text editor and the terminal is all well and good when starting out, but using a properly kitted out IDE is essential.
I will return to this post and add more. Feel free to leave suggestions in the comments.
UPDATE: Some useful comments
UPDATE: Some useful comments
- 8: Pick one and get settled: 10 reviews of python ides
- Choose one that supports multiple languages: python, ruby,
- Eventually you'll want to learn emacs or vim, buth these can wait
- Many of these are combinable: 1 + 2 + 3 + 7
Thursday, October 20, 2016
Turning An Array Into A String on PHP
Consider this ugly piece of code:
// Checkbox handlingDoesn't this look better?
$field_33_opts = $_POST['field_33'][0]." ,". $_POST['field_33'][1]." ,". $_POST['field_33'][2]." ,". $_POST['field_33'][3]." ,". $_POST['field_33'][4]." ,". $_POST['field_33'][5]." ,". $_POST['field_33'][6]." ,". $_POST['field_33'][7]." ,". $_POST['field_33'][8]." ,". $_POST['field_33'][9]." ,". $_POST['field_33'][10]." ,". $_POST['field_33'][11];
// Checkbox handling
$field_33_opts = implode(" ," , $_POST['field_33']);
Subscribe to:
Posts (Atom)
1,050 hours
It took me 13 working days to complete my first 100 "work" pomodoros as a Junior Software Tester at Profectus Group. Much of ...
-
I have finished re-writing my text adventure game, Tree House Prince, available here: ( https://github.com/clockworkpc/tree-house-prince...
-
NOTE: My fiancée wishes to stay out of the online limelight, and neither her real name nor her image shall appear in this or future posts. ...
-
It's 03:08 and I am finally starting to make sense of object-oriented programming. It's not that I didn't understand it concep...

