When i started with go in my company I had big wtf moments with that err != nil. After a year of creating a desktop app and rest apis with go I think that error handling is the best feature of this language.
A common complaint is that it leads to a lot of boilerplate, like "I might as well keybind something to write if err != nil" etc, but the important thing with this design choice is that error handling is more or less forced to happen right after the error happens, which is great for readability. In general, I think Go is great for readability and I don't care if there's a million lines of code instead of 100K if they are way easier to read, which I think is the case with a lot of Go (compared to Rust for example this becomes obvious)
The answer exceeds the range of i64, so the Go version should be wrong and the Python version should be correct due to Python's built-in BigDecimal support.
Its definitely very hard to get off python when it comes to data science/AI. The closest thing ive seen Go be able to do in order to tackle this is extend the python interpreter by using Pygolo (gitlab.com/pygolo/py). Something that would be sweet is if the Go community used CGO to use the underlying C libraries that Python uses
@@SoftwareWithShawn it's easy like python and fast like c. Mostly used for maths, AI ML , deep learning. But it has potential for everything that python can do and much better
When i started with go in my company I had big wtf moments with that err != nil. After a year of creating a desktop app and rest apis with go I think that error handling is the best feature of this language.
I had this thought today, Its really growing on me. Errors as a value is kind of sweet
A common complaint is that it leads to a lot of boilerplate, like "I might as well keybind something to write if err != nil" etc, but the important thing with this design choice is that error handling is more or less forced to happen right after the error happens, which is great for readability. In general, I think Go is great for readability and I don't care if there's a million lines of code instead of 100K if they are way easier to read, which I think is the case with a lot of Go (compared to Rust for example this becomes obvious)
As someone who has written a few small apps that do the same thing in both languages, I don't like handling errors in Python.
It is way better than try catch, but you should see Rust's Result type. I think you would love it.
What stack are you using for creating desktop apps? 👀
Good video.
Have you heard of Goravel???
using go run also compiles the binary on the fly (to make it psuedo interpreted), so in your example it would be even faster than "79x" that you saw.
@@Grahamaan27 is there an advantage to using “go run” vs “go build” then executing the binary directly?
@@SoftwareWithShawn if your program takes a time to compile go run would be slower than go build
Is it possible to compile a single file via stdin and specifying go.mod,go.som through arguments?
Java is compiled to bytecode, and that bytecode executes in a JVM just in time, at runtime.
Did anyone notice that the output sum of squares is different from the two programs
Which one do you think is more accurate? 🤔
The answer exceeds the range of i64, so the Go version should be wrong and the Python version should be correct due to Python's built-in BigDecimal support.
Can confirm, Java projects rarely build under a minute and often it's a few. Haven't used C++ in years but I think it's even slower.
Yes but that's not because of Java, you might be using some framework like spring boot etc which uses lot of classes etc to handle autoconfiguration
pandas and numpy and torch and a lot more
it’s impossible to ditch python
Its definitely very hard to get off python when it comes to data science/AI. The closest thing ive seen Go be able to do in order to tackle this is extend the python interpreter by using Pygolo (gitlab.com/pygolo/py).
Something that would be sweet is if the Go community used CGO to use the underlying C libraries that Python uses
@@SoftwareWithShawn if the c extensions can be used without python, no one ever will use python again. its like apple computers with linux
@@basilalharbi3293 you bring up a valid point my friend…
I mean we have pytorch library in c++, however I think c++ is way harder than python, and would take longer to production.
Next video julia lang vs python
havent heard much about Julia in some time. Will have to take a look
@@SoftwareWithShawn it's easy like python and fast like c. Mostly used for maths, AI ML , deep learning. But it has potential for everything that python can do and much better
That's absurd