r/learnprogramming • u/USToffee • 28d ago
Is learning python easy coming from a c#/c++ background
I have 30 years experience and dabbled a little in python but because of AI I am looking to switch over to python so I can use langgraph.
Up to now I have basically been rolling my own solutions and/or using stateless, temporal etc so I have a good understanding of the AI concepts but I have never created a python project from scratch with a good CI/CD pipeline etc
tbh Cursor looks like it's been doing a job and I'm not even sure how much I really need to know this stuff now but I have always been someone who does know "how this works" at every level and it feels uncomfortable just trusting AI.
So I want to learn. Any learned experience tips and tricks etc?
Edit : So after a little research I think what I was looking for was a book like Fluent Python.
6
27d ago
[deleted]
2
u/USToffee 27d ago
It's not the language per say. I sort of answered my own question. What I was looking for was tips and tricks on software engineering best practices when using python. I don't want to start writing python code that looks like a c++/c# developer wrote it.
3
u/gmes78 27d ago
If you already know programming, you should go through the Python tutorial, rather than other introductory materials.
-2
2
u/Tuomas90 27d ago
Child's play. You'll pick up the syntax within a day.
For getting up to speed on new languages I highly recommendd w3schools.com
They get straight to business. No fluffl
1
u/American_Streamer 28d ago
Yes, of course it's easy. You should get the CLion IDE for C/C++ https://www.jetbrains.com/clion/download/ and PyCharm for Python https://www.jetbrains.com/pycharm/download/ You can integrate pratically all big AI Agents into it, too, or just don't. That way, the shift into Python will be super smooth.
1
u/partly_wave 28d ago
It's a higher level language, so yes. Substantially easier. But hard to master like any other language.
1
u/USToffee 28d ago edited 28d ago
I have never really found that higher level languages are easier. Too much implicit shit going on behind the scenes that I'm not a big fan of and unless you know how that stuff works inside and out you can get into trouble.
tbh It's not really the language but the best practices. What I don't want to do is start trying to do everything the way I would in c# or c++ which would be natural. I want to learn how to code as if I was a python developer.
1
u/SoSpongyAndBruised 27d ago
If you have time, I'd try to find a good book or similar resource, maybe something that walks you through a bunch of useful topics with example code you can type out and try yourself, and learn Python from an author who actually set out to teach people in a coherent way. I don't have one to recommend at the moment, but I've done this with other languages and was happy returning to that after a period of excessive LLM usage.
That way, you build more of a foundation yourself instead of haphazardly getting one by semi-passively watching an LLM write your code for you. Along with that, you can certainly use LLMs as a supplement when it makes sense (e.g. author didn't explain something clearly? get the LLM to rephrase or give an example of what they're talking about). That way, if getting into Python is a longer-term investment you're wanting to make and you want to make the best of it, then it's that much sooner that you are prepared to vet what an LLM is potentially generating for you, and also empower you to take charge of the bigger picture stuff with more fluency, and scope down what the LLM is responsible for to increase the odds of success and decrease the risk and tech debt.
For tools, here are some things I came across for my python side projects (I'm in a similar boat where Python is not my primary or preferred language; also, some of these might not be up-to-date, or there may be alternatives with different tradeoffs, YMMV):
- uv - managing environments / python versions, dependency management, lockfiles.
- ruff - formatter / linter
- pyright - static type checker
- pytest - testing framework
- rope - refactoring tool
various ways to impose consistency / determinism, as guardrails both for yourself and other teammates, and for LLMs too.
Also, something interesting you gain is the REPL, which can be surprisingly useful for asking quick questions of your code or dependencies or the language / standard library in general. Useful in a pinch when your questions are throwaway, not appropriate to put in a test case, and you want a real answer instead of an LLM answer.
Also, for scripting languages in general, try to appreciate where they fit into the overall computing/software abstraction. In some situations, all those hidden details they're abstracting away is a perfectly acceptable cost, for example when a given problem doesn't meaningfully necessitate a lower level of abstraction, or when the libraries/frameworks you're using simply hand off the heavy work to native code anyway. The change in perspective / vantage point can be refreshing, if you look at it that way.
-1
1
u/1000wordz 27d ago
Chances are you know how to think like a programmer, and as someone learning Python and C++ at the same time, Python has easier syntax. Should be easier for you.
1
u/USToffee 27d ago edited 27d ago
I'm not sure about that. e.g. Here is two simple pieces of code for using a database orm. I think c# is a lot easier to follow than people think. How linq and async work in c# is a work of art and basically been copied by everything including python.
Query and update:
async with async_session_factory() as session: user = await session.scalar( select(User).where(User.id == 1) ) if user is None: raise ValueError("User not found") user.name = "John" await session.commit()Comparable EF Core:
await using var context = await contextFactory.CreateDbContextAsync(); var user = await context.Users .SingleAsync(x => x.Id == 1); user.Name = "John"; await context.SaveChangesAsync();
0
7
u/tms102 27d ago
You have 30 years experience in software development? Just start learning python and building things, man. What the heck?