AI is freaking amazing at coding

So I know anyone who codes is underwhelmed by that post title. Of course it is and we all have known that for some time. But how do I convey that to people who are non-programmers? I found myself a couple weeks ago talking to a person at Cisco and saying that AI tools like ChatGPT are incredible at understanding my intent in code and helping me out, but I felt lacking in making a concrete example that connects to people who don’t live in arrays, lists, and hashes.

Well, today I have an easy low-hanging fruit example to share. I was updating some code on my playoffpredictor.com site where conferences were hard coded in:

$conference = array(

"Air Force" => "G5",
"Akron" => "G5",
"Alabama" => "SEC",
"Appalachian State" => "G5",
"Arizona" => "B12",

I asked Claude.ai to help me pull conference data from a file I have (fbsTeams.json) which has the data in more traditional .json format:

[
 {
"team_name": "Boston College",
"conference": "ACC",
"cbs_sports_icon": "BC",
"cfdb_name": "Boston College",
"pp_id": "1"
 },
 {
"team_name": "Clemson",
"conference": "ACC",
"cbs_sports_icon": "CLEM",
"cfdb_name": "Clemson",
"pp_id": "2"
 },
 {
"team_name": "Duke",
"conference": "ACC",
"cbs_sports_icon": "DUKE",
"cfdb_name": "Duke",
"pp_id": "3"
 },

AI of course wrote the necessary code for me. Here was the prompt I used:

I want to replace the current hard-coded way of defining $conference and instead move it to reading the .json file and populating it from the file. please write the necessary code for me. The file path is /home/neville/cfbPlayoffPredictor/data/2024/fbsTeams.json.

For teams that pull as conference CUSA, Sun Belt, Mountain West, AAC, FBS Independent, I want those all to map to "G5" in the $conference array. I want the logic to be that if the team does not match SEC,B10,B12, or ACC then replace whatever the .json file has with "G5"

And here is the AI code output:

Here is what I mean by intent — no where in the prompt did I say anything about power 5 conferences. But it understands that and wrote the code that way. Stupid tools would just call it ‘filtered_conferences’ or some basic thing like that, but AI is smart enough to understand I want to separate out power 5 conferences and G5 conferences, even though I never used the words power 5.

Of course in 2024 with the destruction of the Pac12 there are now only 4 power conferences, so I edit the code to call it $power4 in my script. But the hard work is done by AI and I just do some fine tuning editing. This is a perfect example of how AI should be helping us in day-to-day mundane coding tasks.

2024 Week 2 playoff predictor ATS results

Week 2 is in the books and for Auburn it is better luck next year. Ouch. Oh well, let’s see what we can learn from the computer model on playoffpredictor.com

The model went .615 (29-18-1) which was tied for 2nd out of 37 computer models for the week. Outstanding! And remember, this is with no preseason data of any kind. Just the results of the games played on week 1. Some of the more predictable results were Oklahoma beating Houston by 4 and Penn State beating Bowling Green by 7, when the spreads were -27.5 and -34 respectively. The computer model said -18 and -10.5, which were significant improvements on Mean Squared Error. Speaking of Mean Squared Error, the model went +142 and Absolute error of 3.3, which were dead last and next to last respectively out of the 37 computers. This is to be expected as other computers use player, team and preseason data. The model predicts no blowouts this early in the season, although we know there will be blowouts in week 1-4.

I don’t like this 12 team playoff. After spending last week updating the logic for 12 teams instead of 4 the computer sees these probabilities for teams making the playoff after 2 weeks of data:

Note the top likelihood is Syracuse, due to an ease of schedule. It wont last. I’d be surprised to see them still on top of the ACC by week 4.

Right now it says SEC gets 3.5 teams, Big10 gets 3 teams, Big 12 gets 1.5 teams, ACC gets 2 teams, and G5 gets 2 teams. I’d expect by season end it will be SEC 4 teams, Big10 3 teams, Big 12 2 teams, ACC 2 teams, and G5 1 team. I think the talk and season end is who is the 12th team, a 8-4 Missouri or a 10-2 Utah. Ugh. Who cares. What a horrible debate to have.