3 ms·
BTW, I think Python really did a great job here. As a developer, I am not a big fan of Python. This is a personal opinion and you can disagree. However, what i
by GuB-42 6y ago
BTW, I think Python really did a great job here.
As a developer, I am not a big fan of Python. This is a personal opinion and you can disagree. However, what is great about Python is that it is hard to write code that is completely messed up. The most obvious is that code is always indented correctly, but more generally, the philosophy is that there is one "pythonic" way of doing things. It is not always the "best" way, but when you are not an expert, it is better to have something good enough and consistent than to mess things up with tools you have trouble using properly.
Python is also a high level language with good libraries for the tasks where performance typically matter most.
I'm saying that because I've seen code written in C++ by scientists that's absolutely terrible. I don't blame them, C++ is incredibly complex, requiring both low level (pointers, memory management, ...) and high level (objects, generics, ...) skills. Scientists are not software engineers, they have science to do first. Python code written at the same level of skill, by comparison, looks quite decent.
As for the basics of "git, testing, review and CI", yeah, why not, but I don't think that's the right approach. It is not up to scientists to adopt a developer mindset, it is up to developers to provide the right tools to scientists (like Python did, IMHO). Git, IMHO, is a bit too developer centric. I love it, but I am a developer. There are other VCS, and they are often preferred by non-developer when given the chance. I am not deep into the scientific world but testing and review processes is something scientists should be particularly good at, so if anything, maybe we have to learn from them more than they have to learn from us. CI sounds like overkill.
- sofixa 6y agoI heavily disagree here. Python is a very flexible language that allows you to do all sorts of things, even if there's a preferred, pythonic way. Reading it can be very hard depending on who wrote it ( it's even worse if the person is very good with Python, because then they'd take non-obvious shortcuts ) Case in point, Golang. One of its raison d'être is because Python was too complex to control and make readable, hence a language that doesn't give you much choice and enforces good practices ( refusing to compile when you have unused variables or imports for instance).
- GuB-42 6y ago> it's even worse if the person is very good with Python, because then they'd take non-obvious shortcuts Yes, I noticed that, and that's one of the reasons I am not a big fan of Python as a developer, but I still think it is good for less experienced developers. I didn't do Go, but it doesn't seem to serve the same purpose. My understanding is that Go is for developers, and big, maintained projects, especially in corporate environments (particularly Google) where consistency is important. Scientific code tends to be much smaller in scale.
- InfinityByTen 6y agoDeveloper? Which developer? Who developer? A lot of graduate students write their own code and how did they learn to write code? Anything that works from University courses. I was taught C in university as a mechanical engineer. That's why all my python and C++ code was dreadful. I wrote them like I'd write C. I don't want a test coverage because I want them to write some fancy industry level code. You can look my Master thesis code up on github (hint, it's the same user name) and it's in Python. Hit me up and we can both sit and roast "me from 4 years ago". Scientists who write code as the basis of what they are claiming... computational scientists, statisticians, physicists, chemists and all those people for whom getting the results are because it showed up on their computer screen and they made graphs for them to testify their claim should know how to deliver code that can be read, understood and reviewed. It should not fail on edge cases and give basic results that keep getting verified each time their work goes from "something is working" to a full fledged beast that's going to claim something. PS: I found (and of course fixed) bugs in my code in both publications on my name before I submitted. I'll be surprised if I was the only one in history to have been through that.