6 ms·
Grant helped out with this MIT course last fall: https://computationalthinking.mit.edu/Fall20/lecture26/ https://computationalthinking.mit.edu/Fall20/lecture26
by melling 6y ago
Grant helped out with this MIT course last fall:
https://computationalthinking.mit.edu/Fall20/lecture26/ https://computationalthinking.mit.edu/Fall20/lecture26/
I believe he was going to do some of the visualizations
- sitkack 6y agoThis video linked from the course is excellent, https://www.youtube.com/watch?v=g8RkArhtCc4 https://www.youtube.com/watch?v=g8RkArhtCc4
- tptacek 6y agoThis video is bananas awesome. I'd start writing Julia right now if it wasn't for the 1-indexing.
- willhslade 6y agoCome over to VBA! We do both! Option base 1/0
- jpfr 6y agoTough luck. Using 0-indexing would have lost Matlab users to the Julia community. So they consciously decided to rather lose you. :-) I got used to switching between 0/1-indexing. The only place it actually hurts is when using modulo to remain within some range. And this is needed much much less in Julia than in C and C-like.
- contravariant 6y agoI'll accept using modulo as an argument when CPU manufacturers finally do the sane thing and make sure that x mod n is always a non-negative integer.
- tptacek 6y agoIt's funny, from the votes on my comment it seems like I came across as seriously criticizing Julia (a language I admire) rather than just being hyped about that video (which is excellent).
- vcxy 6y agoJulia has the function mod1 which is just mod + 1, just in case that's ever useful for you :)
- conistonwater 6y agoCan't you just use mod(x, 1:n)? Or mod(i, eachindex(vals))?
- shele 6y agoLol, this is so nice. It is literally what OP asked for: " modulo to remain within some range" is just mod(myvalue, myrange)
- polytely 6y agoHonest question, is it that hard to just adjust to 1-indexing? I switch languages all the time and they all have their different quirks and I find it really hard to understand why people cannot deal with for example 1-indexing. From the outside looking in it seems like one of the easier things to adjust to?
- Asooka 6y agoYes. It looks wrong and feels wrong. I can adjust to indentation styles, programming styles, etc. but 1-based indexing is an absolute deal-breaker for me. It's one of the few things the programming community has settled on - indexing starts at 0, as it is mathematically the most natural start.
- leephillips 6y agoThe scientific programming community, starting with Fortran, has, on the contrary, settled on 1, because it is mathematically the most natural start.
- sidpatil 6y ago> It's one of the few things the programming community has settled on - indexing starts at 0, as it is mathematically the most natural start. When you're in the supermarket and you're counting how many items are in your shopping cart, do you start from 0?
- Jtsummers 6y agoIt depends on what you think you're doing. If you are counting, 1-based makes a lot of sense. If you're indexing, they're equally valid approaches. However, if you're indexing then you should be able to use an arbitrary range and not be restricted to one or the other (with a mapping function from your actual range to the language's base).
- mcguire 6y agoYou start with an empty cart, right?
- Hasnep 6y agoJulia also supports arbitrary indexing [-1], you can even start from a negative number! [-1] https://docs.julialang.org/en/v1/devdocs/offset-arrays/ https://docs.julialang.org/en/v1/devdocs/offset-arrays/
- mcguire 6y agoDon't you have issues with library calls that want 1-based arrays?
- adgjlsfhk1 6y agoNo. Multiple dispatch means that libraries should just be able to handle it. If you ever run into problems, file a bug report. It should get fixed pretty quickly.
- deleted 6y ago[deleted]
- beforeolives 6y agoThe course is kind of all over the place. There isn't a lot of focus in the content and the quality of the teaching is inconsistent. Grant's videos were the best by far.