Lex Fridman on switching from C++ to Python
HTML-код
- Опубликовано: 19 окт 2024
- Lex Fridman Podcast full episode: • Guido van Rossum: Pyth...
Please support this podcast by checking out our sponsors:
GiveDirectly: givedirectly.o... to get gift matched up to $1000
Eight Sleep: www.eightsleep... to get special savings
Fundrise: fundrise.com/lex
InsideTracker: insidetracker.... to get 20% off
Athletic Greens: athleticgreens... to get 1 month of fish oil
GUEST BIO:
Guido van Rossum is the creator of Python programming language.
PODCAST INFO:
Podcast website: lexfridman.com...
Apple Podcasts: apple.co/2lwqZIr
Spotify: spoti.fi/2nEwCF8
RSS: lexfridman.com...
Full episodes playlist: • Lex Fridman Podcast
Clips playlist: • Lex Fridman Podcast Clips
SOCIAL:
Twitter: / lexfridman
LinkedIn: / lexfridman
Facebook: / lexfridman
Instagram: / lexfridman
Medium: / lexfridman
Reddit: / lexfridman
Support on Patreon: / lexfridman
Full podcast episode: ruclips.net/video/-DVyjdw4t9I/видео.html
Lex Fridman podcast channel: ruclips.net/user/lexfridman
Guest bio: Guido van Rossum is the creator of Python programming language.
C++ isn't even a good tool for what it was designed for: system-level programming, or most other software, so there's that.
Lex, I GENUINELY feel that you would be a MUCH more effective teacher/medium for absolute novices looking to code. I know you’re not a person who feels like you can express yourself or teach, hence the “I don’t know” response you have…- but it’s irrelevant, WE WILL KNOW, just by listening… hear me out. Your brain is able to convey and untangle very complex ideas in a no bs way while still infusing little bits of absolute BRILLIANT human connection and… anyways bro, I GENUINELY think you would seriously help a ton of young people out just by reminiscing/ranting/interviewing yourself about how you learn(ed) to appreciate coding logic, and why or whatever. Much love Lex, peace✌️and balance sir.
It seems that lex was pretty dogmatic about his use/love of C++. My degree is in CS and we learned early on that It is better to be agnostic and simply use the best tool for the job at that time.
Lex is pretty dogmatic in lots out things.
Didn't c++ make python 🤔🤔
Use the best tool for the job (meaning: use a lot of languages) That's indeed what they always tell you in a school environment, and even later on a job with people molded in that same thinking. When looking back I wasted sooo much time investing in these other more fashionable 'tools', other than C/C++ over the years. Wish I would've just sticked to C/C++, a tool that can be used for anything.
That is a fine opinion, but imagine telling an artist to change his favoite tools because he will be more efficient. Let him just enjoy himself:)
@@dirtyinthebathtub7921 You should really be curious about the person he's talking to.
I am adding c++. As a data scientist I usually use python , modern c++ is much nicer than I remember c++98. I think that you need lots of python in AI but c++ is so much faster doing certain things such as reading and preprocessing data. I think Bjarnes advice is the best, you should know at least 2 languages, preferably 5. So far is enough for me with python/c++.
I saw a news regarding to coming updates for python and I don't know the release date but the new python is gonna be as fast as c++
@@BlueCodesDev Impossible
@@BlueCodesDev Interesting, I didn't know that. Let's hope is true. Could you share a link to that information? Do you happen to know if it is some kind of compilation on time solution?
@@BlueCodesDev it's a joke
@@BlueCodesDev Bullshit. Literally not possible. Unless Python is going to now compile to machine code, that’s not going to ever happen.
I love Python as it was my first deep dive into programming, and then I ventured into lower-level languages like C or C++. I also jumped to Java (although, personally, I wouldn't say I like Java) for a bit because I was working with base code primarily written in Java. In the end, you need to use the right tool for the task, and with programming constantly evolving, the right tool can change every few months. I wish I had studied CS so I would've learned all the basic concepts before starting to code, but logic is logic. Now I'm learning VHDL and Verilog because I want to develop a few FPGA-based projects. Just learn to program; after that, all the language differences are just syntax.
Hello, I commend your programming skills. I am less than a novice in this field as I have an all engineering and finance background. But even these are becoming coding based. I was wondering how or where should someone like me start? Any recommendations to good self-taught ways? I’d like to learn at a fast pace.
Thank you and I await your response.
@@qualifieryt if you’re learning how to speak as an adult, you should stick to just one language and by the time you’re 2 years deep, you should have some cool stuff created.
I agree. But i addition to that i suggest learning how hardware works very very well. And how hardware is created.
“Logic is logic”
Love that
C++ is not low level
In my opinion the best case is to know both of them because it's conviniently to use python for testing hypotheses and learning models but c++ to use for extensions and high-performance production (for example in computer vision)
Rust is easier learn and use with the same performance
@@sososo3906 a lot of libraries are written with c/c++ and also python has c interpretator. That's why this is the best combo
@@hopelesssuprem1867 c functions can be called from rust (if the library/api is popular the job is already done for you) and python functions can be written in rust
@@sososo3906 Why then so many extra gestures?
@@hopelesssuprem1867 gestures? What?
It's rarely very difficult picking a programming choice. The obvious choice is obvious the vast majority of the time. If 2 languages are hard to pick between you usually can't go wrong with either one.
Really love to see how much of an existential question this is for Lex. I myself am really into language design, and play around quite a bit with languages just to get a sense of what they can offer. I have a series of data post-processing algorithms I use as my "hello world" projects, and the relative complexity of trying to implement those algos in a new language shows me a lot, like the community, how easy it is to learn, how close are the paradigms to things I already know.
I'm most comfortable in PHP, and I've stopped beating myself up about that. When I need to quickly prototype something, I whip it up in PHP, and if the POC proves valuable, I think re-write the code into whatever language would make most sense. Certain languages, while not exactly useful for finding a job or getting things done quickly, are absolutely uncontested in terms of altering the way you think about programming.
Haskell, LISP, oCAML, even brainf**k all radically altered the way I think about coding, and practices from those have leaked into my enterprise code as well. To wrap this all up, as much as I love learning languages (and writing them), I still have such a deeply personal connection to PHP, like a first love, of sorts.
PHP was my first love too, and I'm still most comfortable with it by far. Those who know PHP inside and out can be extremely productive with it, and many of the pitfalls of the past are no longer there.
Borland based C was the first programming language I learnt in 1999. But I suggested my niece learn Python so she's ready for the AI generation that is already here, although i really feel working with C programming gives greater appreciation for memory management and all the pointer stuff.
In C I feel invincible lol. Injecting assembly inline, modifying memory directly. The only high-level that it lacks is eva() statements. But I believe if there is an Apocalypse, C will be the one used. Python on a microcontroller? No. C in a post-apocalyptic world? Hell yeah! However I admit Python is a luxury and sweet language to work with for higher-level stuff. You don't feel like you are reinventing the wheel every often. But in C, every time for reusing a lib or reinventing the wheel is an opportunity for a great journey.
@@webspec "In C I feel invincible". What a great line and I totally agree. C is like the grandmother we all rely on.
If you want to study a new topic and want to implement a new algorithm, the fastest way is Python...for example when I was studying path planning algorithms, I implemented most of them in python. However, when I was developing a robotic system, I implemented everything in C++...
i really dont understand what the big issue is here. Its so obvious or perhaps we dont live in the same plane.
Honestly, there is nothing wrong with the C style C++. It only needs a Matlab like IDE with an interactive REPL to become perfect.
Absolutely! Just use what's great about C++, throw out all the garbage and complexity, and you'll end up with a nice language, actually.
@@Elite7555 right, but it is hard to find good examples of C++ programming, specially ones that throw away the OOP.
I'm not sure if C++/C and Python are as antagonistic as some debates make it out to be. CPython (written in C/Py) is the most widely used implementation of the Python language. Moreover, many high-performance Python libraries are based on code in C such as NumPy. You call it in Python but you practically get C performance. If you stay away from abysmal Python, e.g. lots of (nested) loops, most people will be fine. Those who miss C-style performance and syntax in Python could use the Cython library.
Python is shell scripting on steroids written in C and for using with C, I would say C/C++ will coexist with Python
Python is the glue for the C/C++ backbone
@@VV-go4bn yeah, or I have always seen python as yet another type of basic-language.
The problem with Cython is that it's not a library. You have to cythonize code written in a language which is much less documented than C or Python.
numpy is slow though. If something can be done using python list methods it is likely to be 100 times faster than numpy. For example, list.append() and list.extend() vs numpy.concaterate
I’m going through this now throughout my career I use to be big into wordpress and php it was something I was really good at but I felt like I was playing it safe as far as jobs. Then I started getting better and deeper into JavaScript both Frontend with react library and then backend using node js, graphql, and mongo. Now I got an opportunity with a gaming company that makes a well known AAA game. I’m literally switching from web to c++ building for computers and consoles and the more and more I learn it the more and more I enjoy it l,love how things work on the lower level. Love working and learning about memory management. But also I came from the era of action script pretty much dying out and JavaScript wasn’t as powerful like it is now this is definitely jquery days. This is when in the tech community if you wasn’t using a low level language. You weren’t considered a programmer and scripting languages was never acknowledged as a programming languages until now. I’m happy to see how JavaScript has evolved and I can say is one of my favorite languages. C++ I’ve stayed away from because I was intimidated but the language. But with years of programming in JavaScript and going from not understanding how to create a function to understanding the mark and sweep algorithm used to garage collect objects not being referenced. I feel confident on learning a new language.
0:42 I agree that community & culture has an impact on the choice of language. For eg., here in the biz & consulting domain where I work, R is quite popular, with C++ sprinkled in. Coming from Excel land, R just feels easier & more natural to use than Python, & having a community that's into it, helps as well.
Use python in Jupyter lab for a month and you’ll never use R again.
R is mainly built for statistics.. Python has far more statistical metric packages and machine and deep learning packages and is much faster and reads in English.
Not quite understanding how you could think R feels more natural to use lol
This. Adoption drives innovation and builds communities, and this is a salient factor in how "good" a programming language often is. Or how much demand there is in industry for it, as the hiring engineers "prefer" languages they are invested in.
@@vinniehuish3987 I did try Python on Jupyter, & it didn't appeal to me for the reasons of community that I described earlier, & also because of my preference - I just found R code (esp. the Tidyverse) more elegant than Python.
I do agree that libraries for ML & DL show up in Python, before being ported to R, but I don't feel I'm missing much esp. wrt execution speed.
The calculation engines driving those libraries are usually written in C/C++ anyway. So, I don't lose out on speedy execution in R as well.
Alongside, it's easy to parallelize code in R, if I want to. As in Python, I can interface CUDA in R, if I need GPU parallelism. And, I can interface furrr package in R, if I need CPU parallelism.
It's great that you like Python. I wish you the best. But, different strokes for different folks.
@@vinniehuish3987 "Use python in Jupyter lab for a month and you’ll never use R again."
Jupyter Lab/notebooks is terrible.
@@isodoubIet Every credible machine and deep learning engineer uses Jupyter lab.
You just have no idea how to install anything correctly and probably aren’t using anaconda because you’re a novice.
My personal "choose your programming language" flowchart is something like this: 1) List all languages that are commonly used, except Python unless there's no other option. 2) Filter out inappropriate languages for the job, e.g. C++ is not for web. 3) Sort by use-case library support, general language popularity, and add a small weight on "do I want to learn this language".
As a professional C++ developer, I recognize that C++ is a monster that requires it's acolytes to observe strict adherence to it's traditional mystical incantations. Knowing many other languages too, I have kind of a love/hate relationship with C++.
I'm no expert, but I took the time to learn the fundamentals of C++ and after that everything looks easier then C++. My guess is the people who use C++ don't particularly love it, they just accept it for what it is and then go use Rust for everything their actually passionate about.
Python is kind of amazing honestly, I don't even use it as machine learning tool yet. It is just fun to write in. I will for sure get into machine learning and hopefully continue my journey in python development. Its also really cool to see Lex is so informed on so many different topics. He gives the saying "jack of all trades master of none a run for its money", Lex seems to be a master of many.
He’s way far from being a master in most of stuff he talks about
I also think Python is really fun to write with. It reads like plain English, and if it doesn't it's probably more because of you rather than how the language is made. I had a lot of fun making discord bots with Python.
the best thing about python is the huge amount of powerful libraries. you can get everything done with a very small amount of programming time (compared to c).
jack of all trades
and master of none
but oftentimes better
than master of one
that’s the full saying
You should have maybe taken a look at his severely remedial GitHub before you posted this.
I was into C++ years ago, but now it seems Python is everywhere, BUT so much can't really be done with Python - deeper game development, VST/audio programming, etc. I learned Python over a couple weeks and it's pretty cool.
Its not real viable for high power production level stuff. Its intense use in ML is because its just a wrapper for C++ code then.
@@fasterbaiter Pythons only real use, besides quick scripts is being a wrapper for C, otherwise you're just using python wrong
@@fasterbaiter Who cares if it has wrappers? As long as it is fast in the part it needs to be. That what makes it a great general language.
@@codecaine its not fast lol. its just ML where its viable for now (coz its just api for cpp code). cant really look to develop any systems app.
You can use both C++ and python as they can integrate nicely using things such as Pybind11, SIP, shiboken, boost::python, etc.
Lol
I appreciate how he expressed the struggles of trying to pick a language, especially when you want to pick a default language.
This guy has intimate relationships with his tech
Many Robotics researchers have the same question about which program language they should use. In some research areas such as the control theory of robots, the research community uses Python mostly but the industrial community uses C++ because the previous work is based on C++, and C++ may be faster than Python. Other researchers in a different area may have a similar situation likes this.
I was at a point where I was debating whether to leran and use PhP or to use Python for the back-end of my personal website... then I saw the hosting is more expensive to support python so I went with PhP. I expect things would've worked equally well if I had used Python. The differences we see between languages are much more negligible than programmers tend to believe. The path may be different depending on the language you choose, but they can all get you to the same destination 99% of the time.
True for generalized use cases .
The key to this whole debate stems from what Lex says at 0:52. When we move away from objective measures such as performance (the only objective computing measure that I am aware of), it's ultimately a "pick your flavour" discussion. Which is also why Python wins so many of such discussions, since it does so many thinks very well
I wonder why so many feel this way about C++, its incredibly powerful . The python push feels more like culture to me, its always felt like culture.
Outdated. Rust > C++.
@@deistormmods C++ over rust anyday
Different domains have different requirements.
For sure culture always plays a role in technology.
In my humble opinion, why fix what isn't broken. If C++ does everything you require, then why switch. If you just want to try something new then go for it. You can never learn too many languages.
It's particularly subjective also. Without knowing exactly what you're trying to accomplish, it's difficult to say what's best for you.
I hate C/C++ but this video was a bit confusing. C is the Latin of modern programming languages, and you simply cannot go wrong with it. I prefer Python; funny enough, it’s written in C! Python is way more beginner friendly tho, which is why you’ll see that push that it’s getting.
I started programming at 10 on TI-99, then Apple II baisc, Pascal, RPG II/III, Cobol 74/85, DBase IV, SQL, Access Basic, C++, VB, HTML, Javascript, C#, Objective-C, Java/Android, Swift. Yet.....after 3 years of High School Spanish I can still only say Jamon Y Quaso.
cool story, bro
* queso 🧀 😅
14 years into the industry, I've found people spend more time deliberating over which language to use than they do actually writing the tool they wanted to create.
Also: The best tool for the job encompasses more than hardware performance optimizations (scripts I can have running in python for an i/o bound web scraper before I even settle on what standard of C++ I want to use is a massive win, cpython speed or not)
big true
I struggle with choosing languages all time! Glad to hear minds of this caliber go through the same things.
I'm switching to golang
Been seeing this dude as a normal podcaster ... The minute I realised he's been programming for a while.. that was a big shocker just had to subscribe
C++ and Python have different use cases. One does not “switch” from C++ to Python. One might switch from C++ to Rust, or maybe even Swift/Objective-C. But not from C++ to Python. At least not in a universal sense.
Even though it is less complicated than C++ it is gonna be used more because it’s easier and able to teach ai and ahi .
I came up in university using many languages. I did not really face this issue. Like oh, do something distributed/embedded? Naturally gravitate to C/C++. Oh write scripts or work on higher level app backends? Pythons cool. But holy shit - Prolog is a old, unused, but sick programming language - its like you present it a problem, and compiler gives you the solution.
Yes, I agree. It seems that lex was pretty dogmatic about his use/love of C++. My degree is in CS and we learned early on that It is better to be agnostic and use the best tool for the job at that time.
As a lifelong embedded C programmer I finally learned Python strictly because of library support(and easy string parsing for scripts). I still hate the pseudo dynamic typing( which fights you unexpectedly...floats vs doubles) and the pseudo type casting(e.g type hints that don't work the same in every interpreter). And it's horribly slow(partly because of its lack of strict type support). But python lets me quickly parse a webpage using beautiful-soup , where C has nothing comparably to offer.
Trying to do type safety with Python is like trying to drink an entire swimming pool...
And then there are libraries like scipy that straight up give you a middle finger and don't expose their classes to the user, like in the case of the output of scipy.stats.linregress
C++, Python, etc., as computer languages are just another form of abstraction. When we program we use abstractions like objects, functions, classes, etc. One of the highest forms of abstraction in computer science is metalinguistic abstraction. This is an abstraction that is implemented as a kind of language.
For example, when we want to reset our network we say
sudo nmcli networking off
sudo nmcli networking on
What we did was just employ a language (in this case shell language) to instruct what we want the computer to do. In the same way, Python is just another kind of linguistic abstraction. It's the same with C and C++. All are just linguistic abstractions. They are all equal in the sense that they are the best tools for the job they were designed to do. (See, for example, domain specific languages.) If we think of computer languages as simple metalinguistic abstractions defined for some domain then we see that there is no reason to be fanatic about C vs Rust or C++ vs Python. They are just ways of thinking about programs.
Now, having said that, I hate computer language systems where the configuration language is so different from the language it is configuring. CMake and Gradle both come to mind. CMake is supposed to be designed for C or C++. But its configuration language was inspired by the shell. It's the same with Gradle. That tool was designed for Java but the language makes me think of Javascript. Why can't language systems designers create something similar to Clojure where the configuration language itself looks like Clojure?
I think you answered your own question ... Configuration languages are also abstractions for a particular domain.. the build systems domain.
I just finished school learning c++. I decided to start writing an application for a resume. I tried making a basic window in python and c++. Python took about 5 lines and 15 minutes of code with the Tkinter library already installed via python3 to get a basic window. C++ took about 40 lines of code and and a whole annoying day downloading wxWidgets from source then learning how to make it a target with cmake as well as configure my lsp (language server (clangd)) to know how to identify the headers so i dont have error flag pop ups in neovim. Lol I made it all work but still a bit fuzzy on what I actually did. I'm going to try RUST next.
You would love lisp lol
You should try pyqt, it has a designer studio and everything.
You can try using wry in rust
Depends on the API. You can do the same thing in SFML, Raylib, SDL.
Excel VBA, pursuade me I'm wrong.
I will always stick with Python because it is much easier for me to think programmatically in Python than in any other language no matter what I am building.
It a somewhat strange saying. Once you designed your project/app/idea the language simply becomes the implementation tool.
@@dualbladedtvrecords4383that s what i thought too but i starter coing with python got good at it and it became like a second language to me i started thinking on python and it was pretty hard for my brain to switch to java my thinking was kinda slower and less sharp
Python dependency hell is a real thing though.
@@geriatricvicenarian8208 it barely compares to C++ dependency hell. For example, Debug vs Release ABI in VStudio. Additionally, consider switching from gcc7 to gcc11. Might be very very painful.
@@geriatricvicenarian8208 It is but at least it's not npm 😀
We need to remember that almost all ML libraries for Python is implemented in C++. Python is just for using these pre-built libraries.
If you can switch from C++ to Python then you weren't doing anything that required C++.
facts
Well this is a dumb thing to say. He clearly said that he wanted to do machine learning and found C++ not suitable for these high-level things. He wanted to do something new. Not all the things he was already doing.
@@13thxenos You do know machine learning python packages call C++ libraries. If Lex meant that then I misunderstood but it sounded like he switched from python to C++ for general programming.
I went to tech school for programming about 8 years ago. I learned Visual Basic and C++. I found C++ fun but confusing when the program got past a certain complexity. Of course now I've forgotten nearly everything I'd learned and am starting over. I'm thinking of concentrating on both Python and C++. No idea if I can ever get some sort of job with these skills but I have to try. I'm 42 and can't see any other career path out there for me, especially having some physical impairments.
All the Best!
Great points on both sides. I share Lex's opinion. It is important to be right in choosing what direction to go. It's easy to get lost in the digital world when most of it looks like magic.
C++ when performance/size/reliability matters and js when it has to run in a browser, Python for everything else. (PostgreSQL when querying centralized data, SQLite when querying local data).
I admired CPP and its practitioners when I was a youngster, always had a dream to write hard core stuff with like computer graphics.
During my 10 years career, only once I used it, and this has led me to write not less than 7 libraries leveraging everything cpp11 had to offer.
It made me feel that young boy I was, growing into those CPP programmers I admired back then.
I use python, node.js and Java on daily basis. All of those are great for productivity with great community.
None of them rival CPP compilers and features for creating lean compiled and super fast programs. specially, when you combine it with CPP Meta programming, which is a platform on it's own right.
With CPP, every tech you write is an achievement. I always have to warm my engine and explain myself why I used Perfect Forwarding or this and that. It is truely remarkable for speed if you use templates, but productivity wise it is not so great.
You will write godly programs with this language and you wont be able to explain it to most programmers.
my advise for you, Lex, go polyglot if you feel you have the gift to write software, you dont have to get stuck on a single stack. You are probably smart and experienced and with the right amount of passion and dedication and a nice project to motivate them, you can build things in other languages and you will be educated and proud.
Modern C++ 20/23 allows you to express ideas more elegantly than in Python. "Elegance is not a dispensable luxury but a quality that decides between success and failure." (Dijkstra)
It would be interesting that they discuss about python versions and dependencies hell.
A python program generally uses many more dependencies and it can quickly go wrong. Development in python is often a tinkering with things already done and many of these tools are in other languages like c++. In c++ we generally use less dependency but larger one and we pay more attention to their selection.
Reproducing a functional environment in python (env.yml, bash script, etc.) is not really easier than in c++ (cmake, bash script, etc.) and it is like if a python project is not complete without a dockerfile as if conda or venv is not enough.
We add to this the setup problems associated with deep learning and GPU acceleration and depending on the architecture the dockerfile is no longer optional.
I understand Lex love for the c++ language. I tend to recommend the use of c++ library in python (ex: OpenCV) to leave me a way out and in the event that it is only the training of the AI model that is done in python for example.
Exactly. This is what made nodejs the shittiest language almost as soon as it came out. Cultural factors that really aren't the fault of the language.
@@dinobotpwnz Tools like npm and pip encourage the addition of new libraries, but it's not like it's really a pain to add dependencies in c++ under linux or under windows with vcpkg (I don't really use any obscure or poorly supported c++ libraries).
So, maybe it's cultural but it's worsened because there are more 'non-programmers' using these languages for whom programming seems painful and who would rather take the time to search and add another dependency than bother writing few lines of code.
Even when trying to limit the number of dependencies the libs also have more dependencies in python in general and we can't do everything from scratch.
This has pros and cons, it seems to have a solution/package for almost everything.
I personally havent benn using python for a looong time as soon as I switched to C. Literally.
@@Sans274what sort the sorts of programs are you developing?
@@johnbilodeau6296 Oh boy, C++ dependency hell is real and it just exceeds all others combined.
Learn c++ and Python and use them each at the proper time.
I'm just a newbie, but I honestly didn't know how biased people are when it comes to programming languages. I learned the hard way to not mention HTML, I basically got bashed on for it. Or how everyone says Python is the best one to learn first. The learning process is different for everyone.
People are biased, but the ignorant ones don't know/understand why. I'll give you a few more objective pointers (😎):
1. Languages are tools.
2. Not all problems are nails, so you shouldn't say that hammers are the best tool for everything.
3. What is "best" depends on the evaluation criteria you're using. (Is a race car better than a semi-truck? Depends on whether you're hauling cargo or hauling a$$ 😁) The evaluation criteria depends on the problem you're trying to solve and your goals.
4. Pick something mainstream. That way, when you have questions, problems, etc, you have an easierntime finding answers and/or help.
5. Readability is mostly (not completely) dependent on the programmer, not the language. (Most languages have reasonable enough syntax to blame a mess on the code's author and/or poor design.)
6. Pick a language with a good ecosystem (useful libraries, frameworks, etc) and supporting tools for project and dependency management. (Few things are as frustrating and time-wasting than having to deal with a dependency hell, etc.)
Those are a few things to keep in mind. (I'm a CS major w/ ~18yrs as a software engineer.)
PS: HTML is not a programming language, it's a Markup language. That's what the M in HTML literally stands for.
i came from c and c++, php , & java...and dotnet, that switcing to the python programming
but now c and c++ is very useful to my python programming since it can be used to optimized the python programming
When you reach certain point you no longer care about the language. You know the concepts, patterns, techniques + frameworks and then you pick correct language for a task.
Python is cute yet I still code in C++. Rust is hyped and I watch it yet I still code in C++. I was asked at work to help iOS team to meet some deadlines and I easily switched to code in Swift.
With the same success I could jump into Java/Kotlin. So it is mostly never about the language but the understanding how computer works and how to make him do what you want.
Also it is about knowing strengths and weaknesses of the languages/frameworks and picking the correct one for the job.
Him? 👀
What language is your base to enable this switching between back and forth ?
That's my struggle too, to choose a language to learn. Interesting to know even expert programmers have the same issues.
Lot's of people will give you lot's of different answers to this. I think you will fare best if you just pick any and do not try to make "the best" decision here. You really do learn coding by doing. Personally I would pick the one that is widely used in a field you are interested in and learn it. That way you won't just learn the language and then never use it again (and hence forget it again - it's happened to me more than once) but instead have a tool you can use going forward.
@Peter Brown so true!
just pick one. i'm a hobbyist and python just made sense. I went back and forth for a monty while I was researching, but then I got fed up and just started a python course.
Python: language for PhDs and kids. Huge community of kids. Data science, Pytorch. It's a language.
i just graduated studying comp sci, and i think a big thing a lot of us 20 somethins don't realize is how powerful modern Computers/Processors are , so things like Memory Allocation weren't even really taught to us . As a recent computer science grad I can tell you that the world of programming is 10x more confusing and intimidating than I ever imagined . I know that I don't know sh*t , I know that a lot of Languages are children of C language ... Java was what we used most , it's a solid language but again in the modern world every language is pretty damn solid . Funny enough there was 0 javascript/php , and that's what I am learning now because I have to build my 'portfolio' website and pray to god some merciful Recruiter hires me out of pity . I know that the struggle is just beginning lol. Cheers, fellow sufferers . And to those 10% of you natural programmers who can just understand difficult concepts instantly ... take pity on me please , I want to learn but I don't want to be annoying and keep bugging you for help! i will tell funny jokes while you do most the work i guess?
How is it possible that Lex has so much time to do everything he does?
watch his video about his daily routine, it's insane
He does not. He is a programmer hobbyist. He is a professional content creator and journalist. I can tell from his interviews that his knowledge on the subject is very limited, compared to a person who does programming for a living.
@@biomorphicDude, he's doing machine learning at MIT. Change your doctor - this one is clearly cheating on you
@@netpolun-ltd.7267 so what? Still a noob.
@@biomorphic
>MSc in computer science, PhD in electrical & computer engineering
>worked at Google on machine learning
>lecturer at MIT CS machine learning courses
ah yes, massive noob
What is often missed in C++ is that it's what you want it to be. You just have to know where the guard rails are.
I use both. Python was my first after HTML&CSS(I know they don't count, hence why Python is my first). Started on C++ last year, and hope to go from CPython to my own C++Python.
If you go into the software development industry, most of the time, the job will dictate the path on what language you become an expert on, five years down and now you're a go lang programmer
lol!
It's _"Go"._
Nerding out programmer Lex is my favourite Lex
As a computer scientist, I'll say its good to know more than one programming language but you gave to be grounded in one language before exploring others based on your interests
Sorta in the same situation, more comfortable with C++ and Java but people keep suggesting to switch to Python for LC
Too many devs fixate on using the best tool for the job, when really you should just use what you have and see how far you can get. Once you have something flushed out you can go back to polish up the details. What people forget is that facebook, twitter, google, etc. were not built in a day, and they had many flaws, but over time, they were able to spot weaknesses and use their newfound knowledge to make the product better. So my advice to people who want code a startup, start with a stable framework, and build tools around your problems.
You don’t have to “switch” to anything. It’s just adding a new set of semantics to your tool belt. If your abandoning languages you’re doing it wrong.
Say you want to eat lasagna. Do you go to restaurants? Do you buy frozen box? Do you cook, but with boxed tomato sauce? Do you make your own tomato sauce? Do you grow your tomato? Do you breed your tomato to select the sweetest one? Do you make the tools for the above process? Do you renovate your kitchen yourself?
That's basically from LLM prompt engineering -> assembly
The switch to Python is easy if you want to improve your productivity, software development time, code quality and maintenance. Occasionally you might need C or C++ for performance.
My hot take - python is ok for smaller scripts that solve trivial tasks. But for larger projects, in my experience, it just falls apart. Readability is awful due to the fact that all variables are dynamically typed so you never can just glance at the code and see what data its working with. Its the one language where hungarian notation makes sense. The use of indentation for declaring scopes is also just a bad idea. Its also hard to determine dependencies due to the dynamic typing of python, making it hard to understand what change to common code will effect in other parts of the codebase.
I have used python extensively, Ive written tons of python code, Ive exported C/C++ functionality to a python library and Ive embedded python within in a C/C++ program. It never grew on me and I have to really just push through everytime I need to do something that involves python
Currently learning python - great insight for my journey
Python sucks, save yourself while you can
@@123214matt It's just like any other programming language, everyone in these comments are just being super self righteous and up their own ass. The skills are easily transferrable lol
Don't listen to the comments - learn one language well and the others are laughable to learn. Doesn't matter if it's python or C, the skills all transfer.
@@iusegentoobtw Yeah
I know how hard it is to swap between 2 different coding languages or frameworks when you really are destroying everything what you need to create with them. In my case it was going from building my vanilla websites HTML5/ CSS3 and Perfectly written classes and functions to actually making the move to React / NextJS last month.
Learning python 2 years was a real addition to my web development skills and makes the total picture so much better ✌ I really understand that it would be really hard to make the choice going from C to python because I know being a C programmer takes so much more effort to learn the language.
don't overthink, pick which you enjoy more and if it makes you feel more productive.
Python isn’t a language I’m ever going to use for day to day projects, but here and there I’ll use it if I want to throw some script that’s functional together to get the job done
C++20 is much MUCH better than say, C++11. I learned to use C++98 as a kid, then picked it up and wrote a small program in college, then 10 years went by, and I picked up C++ again and built a github and a reasonable big project in C++/latest. Back in college I would have said "use C# or Python or something" but these days if you can use the absolute latest C++ standard and newest tools, I would probably choose C++. If you haven't kept up with the changes, take another look. You might be as impressed as I was. Use Resharper for C++ and enable lots of static analyzers. They pretty much fix every rough corner around C++ except the build system, but even for that, modules can make it faster at least.
And for the future, a number of influential people see that there is a need for a simpler syntax. Because the "zero cost abstractions" that are possible to create in C++ shift the costs onto the programmer and build times. The new language syntax experiments attempt to reduce the cost on the programmer (Carbon, cppfront/cpp2). The syntax change would also improve build times and the difficulty of building a C++ compiler, because it is an absolute nightmare to parse C++. Amusingly, it is not too uncommon to write something that is legal C++ but simply cannot be parsed by VS2019 or even VS2022.
But the additions to the std lib and the new language features do make C++ quite competitive IMO. Check out the cppcon videos here on youtube.
Love lexes main points are more about community and people that motivate a language. The language itself shouldnt matter too much, if you have clean consistent code most of it can be translated to another language easily anyways (might be missing some unneeded semantics but itll do what you want from a higher level)
Interesting to see all good the changes you are making to your computer life!
I am happy your guest supports the free market idea of multiple coded langues.
Game industry C/C++ is your life companion
Great philosophy by Guido. People think too much about such decisions as too tangible. But for sure, with enough passion into the journey, these skills r translatable
One thing I don't like about myself, because of my low self-esteem, is that I'm constantly trying to take heavy or complicated programming languages or tools to appear smarter to the outside world. But in the end I'm the idiot because I'm more concerned with the details of the complicated languages and tools instead of solving real problems.
I've been using both for years now and still a lot to learn and have reflexes
I'm considering adding Rust to my repertoire, next to C++. It seems to serve the same purpose, but without 45 years of legacy and better defaults. It's also getting adopted by new people outside of the C++ crazies, who don't want to put up with the complexity and bad language design of C++. I don't really mind, because I already know how to dodge the footguns, but Rust seems to offer a similar experience to well written modern C++, but without the countless pitfalls. (Ever tried passing a string literal `f("hello")` to an overloaded function set of f(bool) and f(std::string) in C++?)
Java or Go for backend development
C# for game development
Flutter for front-end development
Python for everything else In between
Well C++ got modules, co-routines, ever more easy lambdas and full support of efficient value semantics... It only lacks a modern API that actually uses these features.
Never have a single favorite weapon - Mushashi Kishimoto (Book of 5 rings). This argument applies to programming languages. I personally want to go back in time back to 1993 - 1999 and code with just C, on a desktop computer listening to 90s dance music and playing NFS-2 all day every day.
Every problem can be resolved in C++ but not in Python. You can live with both.
Best answer
I don‘t get why you would switch from a statically typed and aot compiled language to something like python which needs more energy and compute for providing a not needed abstraction.
Python + Flask + JS + Bootstrap CSS + Font Awesome CSS is my current recipe for all web apps.
Can relate, being using Nim for everything, from scripting to fuzzing programs.
I somehow doubt that Lex has even written a single C++ coroutine...
Modern C++ is a lot more than just using a couple of templates, autos and lambdas.
I only have 1 semester left in my masters of science program in Data Analytics Engineering which I came into without any coding background (but with a much deeper statistics, probability, and econometrics background than most of my peers) and I have to say, I really prefer R & RStudio to python. Sue me
Don’t confuse python with pandas library though.
I've seen so many die hard python antagonists in my work life. Guys, it's not a religion. You don't have to sell your first born or kill yourself. You just need to ask yourself what's the right tool for the job you need to do. If someone's dogmatic, they shouldn't be a software developer. Is python the right tool for everything? Most probably not. But it's essential for a good software engineer to work with whatever is most suitable for their job. It's actually shocking to me how conservative most SW engineers are. Shouldn't they be the most adaptive ones?
I hereby confirm that absolutely nothing was said in this entire clip.
Thank you. I was about a third of the way through the video and figured that's where it was headed.
I started in C++, too. When I learned about list comprehension in python, it blew my mind.
🤣🤣🤣🤣🤣🤣
I would have stuck with C++; Python maybe popular, but C++ is superior and more people need to be connecting this with machine learning
I spent years working mostly on C/C++, but for the last years I just code in python, it was just a natural progression for me. I still prefer how C++ code looks like but that's something else.
What’s weird is I outright rejected python as soon as I started using it and I don’t know why. For some reason it feels unnatural for me to write. Combine that with its type system and I just couldn’t be bothered to dive too deeply in it. For a while, I thought c# would replace c++ for me, and I used it for my personal projects. But then I repeated a project in c++ and added my little optimization touch (things that can only be done in c or cpp) to it and it was much faster. Now I just do personal projects in c++ again
@@KayOScode I think I stuck on python mainly because I often switch between macos/windows and linux and I can't be bothered by compiling. And for all IA stuff it's really easy to setup.
these 3 must for systems and embedded hardware on ARM64 or baremetal some Assembly C/C++ then higher end Python for UI and end user interactions.
I hope you see the light of COBOL. The most popular and successful programming language since the invention of the bit. All programming languages are just ways to do comparisons, branching, iteration, input/output, etc. Doesn’t matter what language you use. Like saying English is better than French.
I tried c++, I just couldn't go forward back then in 1997~99... I left the field (robotics); now picking up python + rust.
I was a hardcore C and C++ programmer for most my career. Now I use C# and find it more productive and safer.
If I start to learn programming, where should I start C ++ or python, or even some says C is better for Ai
If there was on rust libraries like pytorch , maybe there is a reason to switch(sorry for bad english)
i dont know why they call Python "new" if it is in fact older than Java
I still don't know whether I should switch to python or not.
When I planned my second web project using web framework and choose python rather than PHP, because I code a lot in python rather than other language that I learn at my university like PHP, JS, and Java. No planning on using PHP native on my second web project after what I experience when I created my first web project in PHP native. I know PHP but only in native because I learn web dynamic at my university using PHP, but I don't know PHP OOP, I even don't know composer, and web framework in general. So I must learned web framework in general and finish the project in less than 1 semester, so I choose python and learn Django for the framework.
Sometimes not everything likely done just in python, like some open source project that I needed (use the library when I can rather than build everything from scrach). There's one in python but not good enough or not maintain anymore, but there's good one in node.js and ruby. So like it or not I must learn node.js and ruby when I need to fix something with the project or deal inside that project, but when I need other thing that no need any change the project, I gonna code in python and connect it with API. At least get the task/job done fast and it works.
Or like when I learn embedded and raspberry pico isn't a thing. There's a micro python but the board is expensive than arduino uno. Maybe today I use arduino with digispark board because digispark less than half the price than rpico for a small embedded project.
Python 4: add type inference, compile to one big beautiful standalone binary, tail recursion...boom! game over
Seems like somebody needs to run some machine learning to determine which language have the most prosperous future
I’m doing this now with an NLP model classifying job postings. 😂
I've used python, php, js, ts, c++ extensively. By far the simplest route I'd recommend is JS/TS for everything. It's not quite as fast as C++ or Rust, but it's still magnitudes faster than Python and it's very easy to prototype with. Your front-ends will be in JS, and your backends can also be in JS with node or bun. Plus the community is massive. What a C++ dev can do in a week I can do in a few hours and it'll feel just as responsive and the code will be reusable on a browser/webapp or in some electron type desktop app. There are some niche uses for python, like AI, because the researchers often have an easier time learning python. And from there, a lot of libraries are written in C++ for python to use but it becomes a constant struggle to figure out what parts of the code are native (slow) and which are actually efficient. IE when computations are turned from regular loops to NumPy methods.
Agree with everything you said. I went from Python to JS, and I guess its a matter of taste, but everything felt so much easier and more logical in JS than Python. And not to mention that for example I used python on a raspberry pi before, and it was eating up a lot of memory and cpu. I switched to nodejs, and it was like I had a raspberry pi on steroids in comparsion. If I want a nice gui? I use html/css + javascript. I want 3d graphics? threejs.. I want to use usb communication, or serial? webserial.. or websockets.. etc. just imagination setting limits. and with es5 and forward, we have got so many nice functions in javascript that I love. I still do a little C++ / C when programming, but not much.
“Or in some electron type desktop app.” The end users spend thousands to buy new hardware so devs can write in bloody JS.
How the fuck is it acceptable for code editors and web chats to be heavier than some entire OSes?
@@wanderingthewastes6159 If you're referring to vscode and discord, aren't they some of The most popular and enjoyed apps people use? This isn't 1998, we don't need to code everything in assembly anymore for a single core pentium 3. Didn't say electron was the reason why you would code in JS, I said you could reuse your code with electron if you happen to be using electron, and a lot of people do. I don't know if you've done GUI's in python, but it's pretty pathetic and cpu heavy. As an aside, there's new electron-ish codebases coming out that are way faster and less heavy. There's one in Rust for example.
@@laztheripper I know about Tauri, but that still doesn’t answer my question. Modern OSes have magnitudes more responsibilities and deal with much more critical tasks, yet they are the ones with the no-nonsense attitude towards language choice even in parts low level functionality is completely unnecessary. Meanwhile we have the modern high level dev writing as-basic-as-it-gets programs over an entire imbedded browser base. Hardware people work year after year to pull out miracles no industry in history had the right to dream about, with system devs, though not perfect, at least being mindful of their fortune. And then we have the high end come, look at the performance of their apps, and tell to our face it is perfectly reasonable that they gauge enough resources that most people out there can’t have more than 3 of them open at a time. Sorry, but it’s difficult to look at this and not see a severe competence drop.
I like C++ but when it come to ease of use over structure, python rules, especially on a Pi4b