Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I switch between Python and Julia frequently with Julia being my main language now (formerly Python). It's not as big a problem as people seem to think. If this is your biggest difficulty you're not doing difficult stuff.


Same. I haven't made a mistake on this issue for a long time despite switching languages with conventions frequently.

The only thing I will say is terrible is I believe julia had something you could do to make it a 0 indexed language just for you? That seemed like a terrible idea, haha. I have never seen anyone use it thankfully


You can't make the language 0 based, that would indeed be a terrible idea. Instead, you can make array types which have whatever indexing behaviour you like.

Because of the focus on generic code, these custom array types are basically first class citizens. See for example https://github.com/JuliaArrays/OffsetArrays.jl

Almost every serious julia package is written in such a way that they can handle such arrays correctly.


I think it's less about difficulty, and more about causing bugs when you're having to switch back and forth between indexing styles. It's just a footgun; it's not difficult to not pull the trigger, but if you do it often enough, statistics start to kick in.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: