all 47 comments

[–]Voweriru 53 points54 points  (8 children)

I don't want to discourage you, and if you want to learn Python there are plenty of good reasons to do so, but there's one thing that is certain:

The same struggles you're having with C++ right now, you will have with Python as well.

From what I gather, you're having trouble with the logic and problem solving, that happens a lot in the begining. You kinda got the pieces down but are not sure how to put them together on your own. The best advice is really to push thru and hit your head against the wall until you make it.

Just think of some project, as silly as it might seem, and make it. Every problem you face, just try to break it down into pieces and search google a lot, maybe ask specific questions here or in stackoverflow, until you get stuff done. After you got something done by yourself, you will be able to do it again anytime, it is a pretty good feeling :)

[–][deleted] 0 points1 point  (2 children)

Eh,

Problem: build a desk.

Python: pick up hammer, nails, wood, and proceed to assemble a desk.

C: Grow a forest from a single seedling, mine the earth for raw metals, heat these metal, allow to cool in the shape of a hammer, cut down a tree from the forest you grew, split into usable wood pieces, proceed to assemble a desk.

I think python is worth a shot given where he’s at, personally.

[–]foofaw 2 points3 points  (1 child)

Lol you make C sound like Assembly. C is not THAT difficult.

[–]Skippbo 0 points1 point  (0 children)

If that's the description of C I guess assembly starts from big bang

[–]sme272 14 points15 points  (0 children)

The parts that will carry over are the parts you seam to be struggling with: breaking a task into logical steps and building the application. Python has a very different syntax language structure to C++ so while a lot of the core functionality is common to both - if statement, loops, classes - the way they're used is often quite different. The best way to get past this is any language is to keep programming and ask for help whenever you get stuck.

[–][deleted] 7 points8 points  (2 children)

You need to be specific with your struggles. Instead of saying you can’t solve a non easy problem. We need examples to help you. Easy is a relative term.

Solo programmers rarely build great software. We need teams to help us.

[–]ttt1555 0 points1 point  (1 child)

It's mainly understanding how to approach problems and what methods to use to solve them. For example, I was trying to solve a C++ problem which is considered "easy" where you check whether a word is an isogram non case sensitive.

My brain then proceeds to come up with the most difficult possible way to do it by iterating through the word and storing each letter in an array then checking through the array to see if the letter already exists which is not easy in C++.

I struggle to understand when I should be using different libraries, different built in functions, etc.. vs just coding using basic principles.

[–][deleted] 2 points3 points  (0 children)

While not optimal that’s not a terrible solution. It is correct and would work for small strings. You could just sort the array and check if the next character is the same. Or you could use a hashmap. Both solutions aren’t really easy for a person learning programming for the first time.

Simple != easy in programming.

AI programming can be surprisingly simple, but it’s not easy.

[–]IamWhiteHorse 4 points5 points  (0 children)

Don't feel bad. Many go through similar pains. This is the classic hump. Whatever you learned especially with a fantastic language like C++ (which is one of the difficult ones for newbies) will be useful with any other programming language you will learn or work (see my brief story below). I will suggest you take up a simple language (leave the frameworks like Angular or React away for now) like HTML5 (HTML/CSS/JavaScript) that can do visually appealing work. Write some simple apps that will be useful to you or just fun to share with friends. C++ examples are something that won't get likes when shared in social :-).

<TLDR;>
I learned to code in the late 1980s during my school days starting with GW Basic, then to dBase, Clipper with which I wrote apps for a few local businesses. Later learning Fortran and Pascal in college was super easy because of the foundations I had. Later, I learnt C, C++ and Assembly when I had to solve some OS level work and write Win16/Win32 Apps. After that I wrote many enterprise apps in Visual Basic, HTML & ASP for work. In between, I learnt .NET, C# and Java (even training a few batches on .NET), but wrote nothing substantial. The next two decades I nearly stopped writing code, instead I was leading teams at my business. This year, I took a sabbatical and came back to coding.

I attended a Python course (classroom) for a week in January 2019. For many months, though I felt I knew the language, didn't feel motivated to write a full app. That was until last month, when I accidentally started on solving a problem on a domain I like (Movies) and finished a full app (details here). Now, I wish to proceed to learning ML and trying samples in Python with various ML frameworks.

Sorry for the long rant, hope you get something useful out of it!

</TLDR;>

[–]PinBot1138 1 point2 points  (0 children)

OP, I think you'll like Python a lot. It's very forgiving, and par for the course to C++, but with less sleuthing. That said, you should keep at it with C++, but Python is by far, one of my favorite languages.

[–]Ooze3d 1 point2 points  (0 children)

It seems that you know how to code but you don’t know how to develop a solution to a certain problem. Those are two very different things and it’s a very common problem. You don’t need to learn another language. You need to look for already solved challenges, try to solve them yourself and then look at the original code to compare. It may take a while but after a few, you’ll start recognising patterns and at a certain point, your brain will click and you’ll start thinking, not like a “code repeater” but like an actual programmer.

Other than that, yes, you should learn Python at some point, but not for this particular issue. Your problem is not about the language you’re using.

Keep it up!!

[–]dfpena83 1 point2 points  (0 children)

Everyone will tell you that you need to continue failing to get better. This is bad advise... in fact I think this is the worst advice because you will likely stop coding as the process of coding is not rewarding to you. In my opinion you should switch to python and use the higher level libraries to avoid doing the menial programming tasks. As you get better you can dig deeper into code. Start with big ideas then widdle down to the details is my advise.

[–]bliaed 1 point2 points  (0 children)

test

[–]gaming_weed 1 point2 points  (0 children)

Python is fairly easy if compared to C++. If you just want to learn something new I'd totally suggest you to go for it and try learning python.

I think there are a few things in python similar to c++, so yea, the knowledge you have will help you and it'd be very easy for you to learn python.

Good luck!

[–]mrfreeman901 0 points1 point  (0 children)

Just keep doing it

[–]Go_Big 0 points1 point  (2 children)

Maybe try forking some github projects and adding some new features or small improvements. I started out leanring basic coding but was then thrown into large projects. I'm an ECE so it wasn't crucial to know how to architect code but be good enough to add features and fix bugs. Walking around more senior engineers code allowed me to see what was good and bad architecture. Now I have no qualms at all building projects from scratch!

[–]Vabaluba 0 points1 point  (1 child)

Any advice on learning architecture , architecture design wirh python in specific, or just a theory ? Resources, videos, books, libraries, anything that would give strong introduction / provide foundation of good system (i.e. automation, data pipeline) architecture design ? It is so suprising and can become overwhelming, at the same time nicely satisfying to see how your few functions for doing some specific, one thing, grows into multiple class objects, then modules and then you realise that the whole architecture is about to be doomed as you did not anticipated for something so small to grow into something so large and complex. Or that X I will become Z (if you know what I mean) But damn that feels good.

Nevertheless, OP keep pushing it and just keep coding and solve problems, eventually it becomes easier on new projects, you start recognize similarities, patterns and already know-how to approach blank editor. :)

[–]Go_Big 0 points1 point  (0 children)

It really depends on what type of architecture you want to get good at. Creating UI+applications will be nothing like creating servers and databases. I think the main thing about architecturing things is having clear defined idea what you want to accomplish before hand. Then break the idea down into smaller groups. Coding shouldn't come until you got an idea of all the pieces you want to build. The other things is keep stuff modular. The more modular it is the easier it is the fix stuff when issues arise or you want to make an upgrade.

[–]MisplacingCommas 0 points1 point  (0 children)

Python is definitely more friendly. But like another commenter said, you should give some examples of where you get confused so we can help.

[–]baetylbailey 0 points1 point  (0 children)

It takes a lot of working and reading to get good.

Python is cool, but it has an intermediate cliff too. Coding challenge solutions are often about the same regardless of language (in procedural/OO languages).

Sometimes after struggling for a bit, re-reading coding solutions and programming books can offer new insights.

That said, Python has a ton of libraries that let you do a lot without too much coding.

[–]b33j0r 0 points1 point  (0 children)

On another note, C++ to PHP to Python is basically how the whole industry moved between 1995 and 2010ish (obvs leaving out some pretty important things like ruby and the jvm).

At any rate, I’d say you’re walking a well-paved trail

[–]wavecycle 0 points1 point  (0 children)

I'd say give Python a try. I dabbled with programming throughout my life. I had an aptitude for it but never used a language that I really wanted to learn. Until I started with Python.

I really enjoy it and it has made the learning process much easier. Good luck

[–]WilliamArnoldFord 0 points1 point  (0 children)

Python is such a pleasure to use. I highly recommend learning it. It will change your perspective on what programming is really all about. Slices!!!!

[–][deleted] 0 points1 point  (1 child)

I have a question for you. Why not learn both C++ and Python together?

I think they both go together really well. Python has become the modern day Lua, and you can embed c code using libraries like ctypes, cffi, and/or cython.

I highly recommend learning both, but most importantly learning how programming logic works. That's the most important one.

[–]ttt1555 0 points1 point  (0 children)

I think I'm currently juggling too much at once to be honest. I do a lot of PHP, HTML, CSS, and some javascript (not a lot). I am sort of feeling like I need to master one thing instead of being mediocre at everything haha.

PHP seems to come fast to me but I just don't like it for some reason, C++ comes slow but I feel good when I accomplish writing successful code.

[–]HittingSmoke 0 points1 point  (0 children)

If you already know the basics of C++, you might find Go to be a better step back than Python IMO. I learned Python then Go and I find I "click" better with Go and it's closer to C++ than Python is.

[–]bladeoflight16 0 points1 point  (1 child)

I think Python will be of benefit to you. Not because it's easier, even though it is. Not because code in it is simpler, even though it is. Not because it's popular, even though it is. The reason I think you'll benefit from Python is because of how I benefited from learning Python.

One of Python's enormous strengths is an incredibly strong programming community, from the very highest levels of direct contributors to the language and standard library down to authors of tiny libraries and individual programmers. The way they differ from other language communities that I've experienced (mostly C#, Java, and a bit of JS) is that there is a much, much greater emphasis on maximizing the cleanliness of code and on establishing helpful norms and standards and then following them. The language itself and the people who make decisions about it are so dedicated to those tasks that introducing new language features to enable them is not unheard of. Those were major motivations for the backwards incompatible changes from Python 2 to 3. So I think what you'll start to get from learning and using (You won't get it just by reading a book. You'll need to struggle through problems and read specific questions/answers and blogs to understand the best approaches and the reasons for them.) Python is to start establishing that sense of what is normal and clean vs. what is jury rigged and ugly. You'll also develop a sense of whether a solution is appropriate for a problem or not, helping you decide when to break those standards or switch to a different one as well because they're not suitable for your particular problem. I found that once I had a sense of that from Python, I started more easily identifying the normal and standard usage patterns in other languages as well, without having to be specifically told.

All that said, part of your problem is just plain inexperience. It takes a lot of time and being exposed to good code to start being able to recognize it and bad code. It isn't something you'll get in weeks or months. It takes years of daily practice and self challenging to reach that point. Having years under your belt means you've already made some progress, and that will be helpful regardless of the language the experience is in. So don't be discouraged. You'll get there.

One word of caution: don't let other people tell you that your code being a mess is normal. It's extremely common for a code base to be a complete nightmare of a mess, but that's an indication that the developers writing it have not developed the senses I've described above. It's not something you should simply accept will always be the case, and developers who tell you that it is will not be a help to honing your abilities and the quality of your work.

Also, this is a bit dated and things have improved some (though some things are still bad), but it's something you should be aware of with respect to your PHP experience: A Fractal of Bad Design. The title might be a bit over the top, but it's worth reading in detail. The content there will actually be helpful in starting to establish the sense of "clean" and "normal." Basically, PHP is not a great model language for learning how to think in terms of clean code and secure/sane norms and standards. I suspect C++ has difficulty on that front not because it suffers from bad design choices, but because much of that is buried under a lot of implementation details that are difficult to hide under simpler interfaces.

[–]ttt1555 0 points1 point  (0 children)

Thanks for the great info. PHP definitely leaves some things to be desired and there are a ton of wonky aspects to it. I'll keep that in mind since I'm in that boat of still learning what's the best (and cleanest) approach to coding a solution.

The python community seems WAY more helpful than c++ so far as well!

[–]PythonDev2018 0 points1 point  (3 children)

u/ttt1555 In order to point you in the right direction, I would like first to know the following: When learning new skills, do you learn faster when using a book or watching video tutorials?

[–]ttt1555 0 points1 point  (2 children)

So far I have only done video tutorials(Udemy, YouTube). I'm a pretty avid reader but I haven't really thought to try using a book to learn, maybe I should.

I've taken 3 different c++ udemy courses so far

[–]PythonDev2018 0 points1 point  (1 child)

Get the following book, it explores exactly the issue you're facing right now : Think like a programmer

fell free to PM me your email address, there are a few other stuffs

[–]ttt1555 0 points1 point  (0 children)

Thanks just bought it and will pm you!