Quote of the Week
Aug 12
"We build our computer (systems) the way we build our cities: over time, without a plan, on top of ruins." - Ellen Ullman
Aug 12
posted by Scott Rogers in
Coldfusion, Development, Quotes of the Weeks
| 0 Comments
"We build our computer (systems) the way we build our cities: over time, without a plan, on top of ruins." - Ellen Ullman
This entry was posted on August 12, 2019 at 9:25 AM and has received 1540 views. There are currently 0 comments. Print this entry.
Jul 8
posted by Scott Rogers in
Coldfusion, Development, Quotes of the Weeks
| 0 Comments
Remember rule #6
This entry was posted on July 8, 2019 at 9:38 AM and has received 712 views. There are currently 0 comments. Print this entry.
Jul 1
posted by Scott Rogers in
Coldfusion, Development, Quotes of the Weeks
| 0 Comments
"Always implement things when you actually need them, never when you just forsee that you need them." - Ron Jeffries
This quote reminds us to be mindful of what we are trying to accomplish. For example, don't write a switch statement when you only have one condition to check. Trust that when the time comes to add conditions the next developer knows when a switch will be beneficial. If you can't, your team has bigger problems.
This entry was posted on July 1, 2019 at 9:04 AM and has received 730 views. There are currently 0 comments. Print this entry.
Jun 20
posted by Scott Rogers in
Coldfusion, Development, Quotes of the Weeks
| 0 Comments
"No code is faster than no code." - Merb Motto
This entry was posted on June 20, 2019 at 9:41 AM and has received 841 views. There are currently 0 comments. Print this entry.
Jun 10
posted by Scott Rogers in
Coldfusion, Development, Quotes of the Weeks
| 0 Comments
"Refactored code either dies a hero or lives long enough to see itself become the legacy". - Mathieu Ferment
This entry was posted on June 10, 2019 at 1:31 PM and has received 694 views. There are currently 0 comments. Print this entry.
Yesterday I came upon this interesting read on the Anti-If pattern. It has some good tips on how to remove if-statements from your code. As I primarily work with ColdFusion, I thought it would be good to document a trick I learned to eliminate if-statements.
This entry was posted on June 28, 2018 at 6:51 PM and has received 972 views. There are currently 0 comments. Print this entry.
Jul 13
posted by Scott Rogers in
Coldfusion, Development
| 0 Comments
It's been forever since I've written anything here. I know, I'm such a slacker and I have no excuse. But after discovering the ColdFusion solution I'm about to share, I knew I had to write about it.
Yesterday as quick test I attempted to create a solution for the following: Given 2 lists of names, create a 3rd, sorted list that contains ONLY those names that appear in both lists.
Pretty straightfoward, right? Before I show my first attempt I think it is important to understand that I always strive to answer "yes" to 3 questions when creating a solution:
My straightforward solution became:
In essence, loop through all the names in list "one". If the name also appears in list "two", add it to "common". If one of the lists was shorter (as "two" is)
I think my solution checks all those boxes. But looking at it I just knew there was a better approach. I played around with map but it didn't feel better, just more difficult to read. Then I unearthed array.retainAll(). As a ColdFusion developer I had never heard of it. It's not a method included in the documentation at CFDocs Array Functions.
Dear reader, retainAll() is a JAVA method, called in the format array1.retainAll(array2), that retains only common array elements of array1 and array2. Exactly what I wanted to do!
I changed my code to:
This code accomplishes the goal and is mostly easy to understand. 2 of my 3 requirements for an acceptable solution.The use of retainAll() may not be clear for any CF developer with no java experience (like myself). But this can be mitigated by adding a comment, so I don't consider it a bad thing.
But how about the third question? How does it perform? Better than the original!
The average run-time over 10,000,000 iterations: Loop-based solution: 0.006364ms RetainAll-based solution: 0.0044926ms
It would be premature optimization to choose the retainAll-based solution based solely on the runt-time numbers, though. At that speed, the difference is really negligible. For me, the retainAll-based solution is the better choice because the code is more concise and easier to debug/maintain.
This entry was posted on July 13, 2017 at 2:17 PM and has received 1071 views. There are currently 0 comments. Print this entry.
Aug 18
posted by Scott Rogers in
Coldfusion, Development
| 0 Comments
I was reading this article earlier and found this quote interesting: "You are a wizard harry. Programming is basically magic. Think about it - we study hard and pore over our books of lore (the computer + internet), to make spells (programs). Wizards can teach other wizards how to cast their magic. We can make things happen in the world spontaneously, and create wonderous devices anyone can use. (Like the internet and mobile phones). These devices can do things that would be impossible without our skills."
Yeah! Programming is just like that!
This entry was posted on August 18, 2014 at 10:41 AM and has received 1894 views. There are currently 0 comments. Print this entry.
The one piece of custom code I added to the blogCFC engine that I wanted back was the ability to customize the keywords on an individual entry. I wrote that code 3 years ago and certainly don't recall what I did. However, it was easy to add back in.
I wrote a blog post about it! It was quite surreal to read my own blog post on how to update blogCFC to do what I wanted. But, it took 5 mins and boom, it was back in place!
This entry was posted on July 20, 2014 at 4:08 PM and has received 3200 views. There are currently 1 comments. Print this entry.
I had been using Dreamweaver for development as long as I can remember; 10 years at least. When I started my new job 6 months ago I was told that nearly all the ColdFusion developers used it and it was no big deal to get a license. However, not too much later I got the itch to try a new editor. I saw some tweets concerning Package Control – once you have this installed, you have a resource within ST2 to install and manage a vast array of plugins.
From with the package manager I installed: ColdFusion for CF syntax functionality.
Automatic Backups. This is awesome. When you save a file, a backup will be saved to a local folder. It's almost like having a built in versioning system. This works great for me at work because all our development files are stored on the network. Recently a snafu occurred and an important folder was deleted. Backups were restored from the night before, but because of automatic backups I had a backup of all my work from up to a few minutes ago.
BracketHighlighter can be good for keeping your sanity. When you highlight an opening brace, bracket or parenthesis, it will highlight the closing match for it. If you do work in javascript or jquery, I would consider this a must have!
TrailingSpaces is something small with a big impact, for me. All it does is highlight any time a line ends in a space. This may seem like nothing, but we have a standard that specifically addresses this. If a line of code ends with a space, you will fail your code review. So this is a great frustation saver.
If you are frustrated with your current IDE/editor or just looking for something different give Sublime Text 2 a shot. I don't think you will be disappointed.
This entry was posted on January 3, 2013 at 1:39 PM and has received 2353 views. There are currently 0 comments. Print this entry.
<< February 2023 >> | ||||||
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 |
The surreal world
Scott said: Also surreal, seeing the name of someone I currently work with in the blogCFC code. I didn't know he...
[More]
Custom Keywords for Entries in BlogCFC - Part 1
Spook SEO said: Keyword are the important for the website, they help the search engine to find your website in searc...
[More]
Custom Keywords for Entries in BlogCFC - Part 1
Steph Riggs said: Keywords are considered the base of SEO and bloggers know very well that after choosing the niche, t...
[More]
CFImage - Decoder cannot decode input
Laurie said: Thanks! This saved me a pile of time today.
[More]
Beef Tips and Noodles
Nancy Rogers said: wow!! sounds great. maybe I will try it your way.
[More]