Moving Beyond Anvil (General Discussion)

Yeah!
Have you noticed that when you ask an opinion here, you do get an opinion, and no one downvotes you, like, let’s say, on stackoverflow?
:slight_smile:

4 Likes

I’ll be honest, I’ve never made a post on SO before, and don’t ever plan on it. I’m lucky that I’ve been able to eventually solve every issue I’ve encountered, and after playing with chatGPT over the last few days, my life as a dev is about to become even more efficient

3 Likes

I really appreciate this post.

3 Likes

ChatGPT, thanks for mentioning it. I just signed up and tried it. It’s amazing. I just sunk 3 hours on it.
But here is a little conversation I just had:

me: what are the main differences between python and r?
bot: […] python is a compiled language […] R, on the other hand, is an interpreted language […]
me: what is the difference between python and r?
bot: […] python is an interpreted language while R is a compiled language […]

It can do the right thing (well, kinda) when you ask “write a function that finds the divisors of a number”, but if you again you could end up with the Fibonacci sequence! :slight_smile:

2 Likes

You definitely need to be able to evaluate the answers with all those AI products. I wouldn’t trust something I didn’t already - at least broadly - know the answer to or coundn’t try out without serious consequenses.

(Not tried it yet, but maybe get it to write out its own unit tests first, then the functions? If the function fails you could feed it back into itself as a problem, eg fix this code so it passes this test)

2 Likes

So the thing with ChatGPT is that its either very correct, or very confident that its correct even when its incorrect. This can result in code that on the surface looks very Pythonic and correct, but simply follows conventions. You can ask it an identical prompt multiple times in a row and have wildly differing results. I have had some success though. I asked it Write me code in python, that lets a user select multiple videos files, and then combine them using moviepy. Use tkinter as a UI besides changing the file path var or something, it worked perfectly first try. Python is what it knows best, and has info dating up to 2021 so it doesn’t have all the latest info. Ask it to write you an Anvil app, you’ll be surprised at how well it can put something semi workable together :smile:

To expand a bit, I think the impact this will have will be huge, and just continues to push forward in the great automation of things. The people who will benefit from this are the ones who can effectively utilise it in their work and life. Already its allowing me to do research and troubleshoot better than Googling can, imagine not having to go through the depths of a library’s docs you can ask ChatGPT to provide a summary and code examples in whatever language you require. Also the conversational aspect of it is huge, being able to ask it issues in a very natural and human way feels more useful for a troubleshooting process, as these sorts of problems often aren’t cut and dry in their solution. I had one prompt response that incorrectly labelled the API classes, asked it to correct them and it did. Another, it used %s string formatting, asked it to use f-strings instead and it did. The back and forth is great, get ready for more of this coming very quickly. The last 12 months have felt like a turning point for ML, so many new SOTA models in different fields, and they’re coming out faster and better

Your suggestion at the end is exactly how ChatGPT should be used. If it makes it a mistake, point it out and ask it to fix it. It usually is perfectly capable of doing so, and will gladly provide both a written response and fixed code

I tried it to translate from English to Italian, and it’s about as good as Google Translate.

Considering that Google Translate does understand the grammar and the meaning of what you type, only does translations, and has been trained for years, while ChatGPT has no clue about the meaning, does much more than just translations and just came out, this is really impressive.

Impressive, but highlight on “has no clue about the meaning”.

1 Like

The real trick is to spend some time learning how it responds. Then you can use it as a tool. It’s not magic, even though in some specific circumstanses it might seem like it.

It’s an assistant. And a good one. So long as you recognise its shortcomings.

9 Likes

I asked ChatGPT to create a hangman game in python anvil, and it wrote that for me. I had to drag some widgets onto the form and rename a couple things, but I’m impressed with the initial response.

2 Likes

I am starting to work a C# project (sadly no Python or Anvil in my near future).
I’m a little rusty in C#, so I asked ChatGPT for help.
I asked this and I got a wonderful answer (too long to put here, you can try it yourself).

convert this c# code from functions to linq:
var ids = new ObjectId[objects.Count];
    for (var i = 0; i < objects.Count; i++)
        ids.SetValue(objects[i].ObjectId, i);

It looks very good (I haven’t tested it yet), but I’m definitely going to try it again before googling for this kind of memory refreshers or similar little tasks.

Now let’s start debugging it!

EDIT (while debugging)
Well… I really thought it looked good :frowning:

EDIT 2
Ok, ok, it was actually pretty good. Wasn’t perfect, but the little change required to make it work was very simple to spot.
And it did help me (re)learn something.

4 Likes

Absolutely agree with the assistant take. I have been using it to summarise documentation for libraries and provide examples, and it can be a back and forth as necessary. As I’m working, I might leave a thread open and ask it multiple prompts about totally different libraries. After 5 messages or so, it started referencing solutions to problems it solved in the first prompt, working those into the current solution in a way that would have been natural if I was implementing them together, but I never asked it to do so. The memory aspect is huge, and if you do some reading about GPT-4 (coming Dec-Feb), we’re about to see an explosion in the quality of these models

2 Likes

@kaleb - great post and I want to return to what I believe you stated was the original reason for your post. “My overarching point with this post was basically: at what point am I trading out every feature of Anvil with something else, and by the end nothing of Anvil is left. Do I bother making that transition sooner rather than later, if I’m going to do it anyway?”

As stated by @stefano.menci above, this is a challenge with every Minimal Viable Product (MVP) as it matures into its architecture stack. The great thing about being a solo developer and just focusing on getting it to work as a MVP application, is that you can do what you did. Find the tool that best meets you were you are today, BUT take a pause every now and then to ask yourself “How do I scale to the next level if/when I need to?” The fact that you are asking that question puts you way ahead of the average solo developer. So I congratulate you on that. Here is my advice (take it for what it’s worth).

1 Like

@kaleb - my advice is that as you move from a solo developer to a small team (and based on your post above you are probably going to be there within the next 18 months), you will need to either hire another developer OR subcontract to other developers/designers. With that in mind, you then need to think about what the marketplace offers. If you feel more confident with the “backend” stack (python and DB coding via Anvil and MongoDB) then my advice is that you should stick with that. Push Anvil as far as you can based on real performance data (take some time to calculate the performance of your overall process/architecture today and then speak to the Anvil staff about what performance increase on the backend you can expect as you move up to eventually their enterprise stack. The point is you are a backend Subject Matter Expert (SME) (based on your post - don’t let imposture syndrome set in - based on your questions you are a SME. So stick with what you know but keep an eye toward the next move on the backend. If the Anvil staff can’t prove to you with real metrics what performance boost you can expect based on your use case, then move on to AWS (since you seem to have some experience there and if you get stuck you will find loads of help in the marketplace (paid and free).

1 Like

@kaleb - my advice on the front end (since that is where you say you are weakest) is to pick a framework that has the most uplift in the marketplace right now, because that is where you will find the most help (paid and free) and position your company for long-term maintainability (what is called total cost of ownership of the application). You should not say, what is easiest to learn (because all the good JavaScript frameworks that really will last the test of time are going to require an investment). My advice is to pick react or angular but I will leave that up to you (don’t over think it though - timebox your review at 4 hours and then just make a decision since they are really about 50/50 anyway). You then should make the next hire a frontend person who has experience in the frontend framework you pick. You don’t have to worry about them knowing more than you because that is a given. You are the backend SME and overall architect of the application / workflow and they are your frontend specialist. You have to be okay with that as you grow a dev team beyond 1 developer. You cannot learn it all.

2 Likes

Really love the depth of response here Rick, especially as you’ve correctly recognised various aspects of my scenario. Your first point regarding continuing to wring Anvil dry of performance is a good one. I have so far not had time to profile the performance of anything I’m working on, as frankly that isn’t a consideration at this stage. There are major optimisations that can be made purely on the fact that my knowledge of the language and programming in general is constantly evolving (as a self taught coder of maybe 18 months), so the first step for me would be to simply re-approach a lot of prior work and refactor, which realistically is something I have built into the process anyway. The thought on utilising the Anvil staff is great, they are an amazing resource here on this forum and beyond, and of course are massive Python nerds so will certainly better understand how to approach issues.
In terms of front end, we have a web designer/dev on staff currently who I imagine would be having major input on a project such as designing the front end for our apps. I enjoy being a jack of all trades sort of dev, so dipping my toes into the world of fornt-end isn’t an issue. This allows me to make decisions that have flow on effects, I can correctly predict the effect a backend change has on the front end because I know both. As the team expands this will be less of a necessity, but don’t expect to be at that stage for years. I honestly don’t expect front end design to be a major part of our process, which is why I like leaning on Anvil versus producing a full solution from scratch. I probably need to spend some time making a really great looking theme.css or looking at others, perhaps that’s also something the Anvil devs could look at too :wink:

@kaleb

You mention being relatively new to python - and wondering about scale-up choices.

I know a highly experienced python coder, who works on large scale projects: and as part of his giving-back to the community, he provides mentoring to those at earlier stages in their python journey: pro bono.

If you’d see value in someone like that, taking a code/architecture review with you - let me know.

I use Sql-Server on Azure, if you are interested. Connection conflicts with multiple users where an issue but that was due to my inexperience. Otherwise Azure provides a good service, but of course at a cost. As it is a full blown database, it has much more capabilities than I will ever use. I haven’t really scaled it yet, though. I believe that the uplink-server is the bottleneck here. But I will test this, of course.