create account

Major refactoring needed from AI generated code by bala41288

View this thread on: hive.blogpeakd.comecency.com
· @bala41288 ·
$12.81
Major refactoring needed from AI generated code
For the past week, I have been heavily interacting with some AI tools for my coding needs. When I usually need a solution, I reach out to Google, get some ideas from there, and try to implement it on my own. But then I thought, why not interact with Chat GPT or similar AI and get the answers from them? The interaction was excellent, and I was even able to get code samples from the AI.

Initially I started the discussion only as a brain storming session but then later I thought maybe AI it can give me the code so I wanted to give it a try by asking but to my surprise, I was right that AI was able to generate the code and give it to me and it was very close to perfection. I started testing the code and had to make some tweaks here and there and the code was suitable for me. 

![](https://images.ecency.com/DQmQYiVGDJA1RXGQPcMeSkpXVf6DoFmTvJmjSXoFRBVAEgs/image.png)

[Source](https://pixabay.com/illustrations/code-reflection-digital-technology-8779047/)

Now comes the interesting part. I had to do a lot of back-and-forth communication when I wanted some enhancements in the generated code. First, I had problems with linting, and I asked GPT to lint the code and provide me with clean code with no unused variables in the code. Even till here, GPT did the perfect job. But then I found some variable hanging around. When I asked GPT when there was a variable hanging around it said it was for a feature that I requested long back. One thing that I understood was that GPT does not remember exactly what I want and serves me accordingly. It can pretend to act brilliant, but it isn't. 

For multiple feature enhancements, I had to ask multiple questions to GPT and come up with the final code. The exact problem happened here. Just because I asked so many questions about different features, GPT somehow misunderstands that I want a mix of everything. Sometimes I might have asked about a feature, but would have implemented the code with a different logic. GPT confuses both things, and the final output given by GPT usually has some code references that are a mix and match of both requests. This is something that is not very great when it comes to getting answers from GPT. 

For security reasons, it is very important to review the code generated by GPT line by line. That's when we might realize that a major refactoring might be required, both logic-wise or readability-wise. We might see obvious things, but AI makes those changes only if we ask it to. 

---
If you like what I'm doing on Hive, you can vote me as a witness with the links below. 
<center> Vote @balaz as a [Hive Witness](https://vote.hive.uno/@balaz) </center>
<center> Vote @kanibot as a [Hive Engine Witness](https://votify.vercel.app/kanibot) </center>

---

<table>
<tr>
<td>
<center><a href="https://discord.gg/bGmS2tE"><img src="https://images.hive.blog/DQmdthy4q4vyefBYmjMJtx7qHBmLnCfP2btiRPhRyc2U8hP/Indiaunited.png"/></a></center>
</td>
<td>
<center><a href="https://kanibot.com/"><img src="https://images.hive.blog/DQmdm8hKPz9TZL8Gd8bPyeVHm9hfgMqqiHcKL8283RBv2eH/Kanibot.png"/></a></center>
</td>
<td>
<center><a href="https://muterra.in/"><img src="https://images.ecency.com/p/FUkUE5bzkAZT3HzV5tJDiU2ik81PCd4JCyhWnRcDN8XJsVFY3UNB8DCRUuhCDN66wiMnTycF4W5TM6SbQHGDwYmP1FStMmkUvfPEVxYfXyDTCmU2bEwm3fiku8ti6aos9RroLdtDQHPhjEDFeNyzYWy7k1g6WcZGHHGJ.webp"/></a></center>
</td>
</tr>
</table>

---

Posted Using [INLEO](https://inleo.io/@bala41288/major-refactoring-needed-from-ai-generated-code-6jv)
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 166 others
properties (23)
authorbala41288
permlinkmajor-refactoring-needed-from-ai-generated-code-6jv
categoryhive-163521
json_metadata{"app":"leothreads/0.3","format":"markdown","tags":["hive-163521","ai","coding","refactoring","development","neoxian","archon","pob","vyb","hive-engine"],"canonical_url":"https://inleo.io/@bala41288/major-refactoring-needed-from-ai-generated-code-6jv","links":["https://images.ecency.com/DQmQYiVGDJA1RXGQPcMeSkpXVf6DoFmTvJmjSXoFRBVAEgs/image.png)","https://pixabay.com/illustrations/code-reflection-digital-technology-8779047/)","https://vote.hive.uno/@balaz)","https://votify.vercel.app/kanibot)","https://discord.gg/bGmS2tE\"><img","https://images.hive.blog/DQmdthy4q4vyefBYmjMJtx7qHBmLnCfP2btiRPhRyc2U8hP/Indiaunited.png\"/></a></center>","https://kanibot.com/\"><img","https://images.hive.blog/DQmdm8hKPz9TZL8Gd8bPyeVHm9hfgMqqiHcKL8283RBv2eH/Kanibot.png\"/></a></center>","https://muterra.in/\"><img","https://images.ecency.com/p/FUkUE5bzkAZT3HzV5tJDiU2ik81PCd4JCyhWnRcDN8XJsVFY3UNB8DCRUuhCDN66wiMnTycF4W5TM6SbQHGDwYmP1FStMmkUvfPEVxYfXyDTCmU2bEwm3fiku8ti6aos9RroLdtDQHPhjEDFeNyzYWy7k1g6WcZGHHGJ.webp\"/></a></center>","https://inleo.io/@bala41288/major-refactoring-needed-from-ai-generated-code-6jv)"],"images":[],"isPoll":false,"dimensions":{}}
created2025-05-10 18:57:42
last_update2025-05-10 18:57:42
depth0
children6
last_payout2025-05-17 18:57:42
cashout_time1969-12-31 23:59:59
total_payout_value6.418 HBD
curator_payout_value6.390 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length3,487
author_reputation1,507,818,884,218,206
root_title"Major refactoring needed from AI generated code"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id142,649,441
net_rshares34,784,414,526,153
author_curate_reward""
vote details (230)
@davideownzall ·
$0.14
Hmm I'm not sure chatgpt is the best for coding, my colleagues used an other one, i can't remember which one now and it did a very good job without much fix needed 
👍  , ,
properties (23)
authordavideownzall
permlinkre-bala41288-sw2b4m
categoryhive-163521
json_metadata{"tags":["hive-163521"],"app":"peakd/2025.4.6","image":[],"users":[]}
created2025-05-10 20:19:33
last_update2025-05-10 20:19:33
depth1
children1
last_payout2025-05-17 20:19:33
cashout_time1969-12-31 23:59:59
total_payout_value0.068 HBD
curator_payout_value0.069 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length164
author_reputation97,377,990,624,058
root_title"Major refactoring needed from AI generated code"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id142,651,156
net_rshares376,371,346,544
author_curate_reward""
vote details (3)
@bala41288 ·
These days there are multiple such AI tools available. 
👍  
properties (23)
authorbala41288
permlinkre-davideownzall-2025512t0284810z
categoryhive-163521
json_metadata{"type":"comment","tags":["hive-163521"],"app":"ecency/3.3.2-mobile","format":"markdown+html"}
created2025-05-11 18:58:06
last_update2025-05-11 18:58:06
depth2
children0
last_payout2025-05-18 18:58:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length55
author_reputation1,507,818,884,218,206
root_title"Major refactoring needed from AI generated code"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id142,667,449
net_rshares908,538,870
author_curate_reward""
vote details (1)
@djbravo ·
$0.14
It's exactly like that. Many problems are being solved with ChatGPT and people are getting to learn a lot. Both these software are making people's lives easier. 
👍  , , ,
properties (23)
authordjbravo
permlinkre-bala41288-2025511t5451487z
categoryhive-163521
json_metadata{"tags":["hive-163521","ai","coding","refactoring","development","neoxian","archon","pob","vyb","hive-engine"],"app":"ecency/4.0.4-vision","format":"markdown+html"}
created2025-05-11 00:45:03
last_update2025-05-11 00:45:03
depth1
children0
last_payout2025-05-18 00:45:03
cashout_time1969-12-31 23:59:59
total_payout_value0.068 HBD
curator_payout_value0.068 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length161
author_reputation349,669,712,947,758
root_title"Major refactoring needed from AI generated code"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id142,654,555
net_rshares375,664,328,161
author_curate_reward""
vote details (4)
@goshen ·
I was surprised few days ago when I was told that even AI has started to program some code and it is actually getting evident. Every day, we are getting close to it much more than we can expect 
properties (22)
authorgoshen
permlinkre-bala41288-sw3ocs
categoryhive-163521
json_metadata{"tags":["hive-163521"],"app":"peakd/2025.5.3","image":[],"users":[]}
created2025-05-11 14:02:54
last_update2025-05-11 14:02:54
depth1
children0
last_payout2025-05-18 14:02:54
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length194
author_reputation6,778,014,777,242
root_title"Major refactoring needed from AI generated code"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id142,663,239
net_rshares0
@indiaunited ·
$0.07
Indiaunited Curation 1746934597308
This post has been manually curated by @bhattg from Indiaunited community. Join us on our [Discord Server](https://discord.gg/bGmS2tE). 

Do you know that you can earn a passive income by delegating to @indiaunited. We share more than 100 % of the curation rewards with the delegators in the form of IUC tokens. HP delegators and IUC token holders also get upto 20% additional vote weight. 

Here are some handy links for delegations: [100HP](https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=indiaunited&vesting_shares=167487.53586727576%20VESTS), [250HP](https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=indiaunited&vesting_shares=418718.83966818947%20VESTS), [500HP](https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=indiaunited&vesting_shares=837437.6793363789%20VESTS), [1000HP](https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=indiaunited&vesting_shares=1674875.3586727579%20VESTS). 

[![image.png](https://files.peakd.com/file/peakd-hive/bala41288/46eaz12N-image.png)](https://discord.gg/bGmS2tE) 

<sub>**100% of the rewards from this comment goes to the curator for their manual curation efforts. Please encourage the curator @bhattg by upvoting this comment and support the community by voting the posts made by @indiaunited.**</sub>. 

This post received an extra 20.00% vote for delegating HP / holding IUC tokens.
👍  , , ,
properties (23)
authorindiaunited
permlinkindiaunited-1746934597308
categoryhive-163521
json_metadata{"app":"hiveblog/0.1","format":"markdown","tags":["hive-163521","ai","coding","refactoring","development","neoxian","archon","pob","vyb","hive-engine"]}
created2025-05-11 03:36:36
last_update2025-05-11 03:36:36
depth1
children0
last_payout2025-05-18 03:36:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.068 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,412
author_reputation94,899,947,161,560
root_title"Major refactoring needed from AI generated code"
beneficiaries
0.
accountbhattg
weight10,000
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id142,656,355
net_rshares374,927,020,583
author_curate_reward""
vote details (4)
@typebox ·
$0.13
Combining AI assistance with critical human oversight ensures better, safer, and more tailored coding outcomes.
👍  ,
properties (23)
authortypebox
permlinksw4zpn
categoryhive-163521
json_metadata{"app":"hiveblog/0.1"}
created2025-05-12 07:05:48
last_update2025-05-12 07:05:48
depth1
children0
last_payout2025-05-19 07:05:48
cashout_time1969-12-31 23:59:59
total_payout_value0.062 HBD
curator_payout_value0.063 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length111
author_reputation37,362,361,666,321
root_title"Major refactoring needed from AI generated code"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id142,675,549
net_rshares357,121,115,353
author_curate_reward""
vote details (2)