More Julia/VS Code

Really enjoying Julia. Although geared towards scientific, data science and numerical computing, it’s also, I’ve read, a great general purpose language. I’m not a data scientist so my intent lies more in line with general programming. Doing things I might have used Python for.

Thing’s I like!

  • Very Python like!!!
  • Integrates very well with a also recently discovered “almost IDE”…Visual Studio Code (see below)
  • A very cool shell called the REPL, [Read/Evaluate/Print/Loop]. Kinda like Python’s IDLE.
  • Almost as fast as C! A scripting type language almost as fast as C? That’s what they say!
    It is said the developers wanted a language that would be great for prototyping and yet still fast.
    They referred to the old two program method of perhaps prototyping in Python then undertaking a potentially lengthy rewrite in C for speed. (see below)
    *Julia joins C, C++, and FORTRAN as high-level languages in which petaFLOPS computations have been written.
  • *Designed for parallel and distributed computing
  • *Efficient support for Unicode, including but not limited to UTF-8
  • Can use Python’s libraries!
  • No forced indentation!
    Yes…I know, proper indentation is a good habit.
  • Slices like Python except better IMHO (see below)

* Wikipedia reference

Now I’ve accomplished a lot with Python, and think it’s a great language, but I guess because I don’t use it every day I frequently have to rewrap my head around how Python handles slices. Julia…to my tiny brain makes more sense. Here is what I wrote elsewhere, as you can see my rant about Python slicing took many lines where as my thoughts on Julia slicing took 3 lines!

Python vs Julia slicing


The  P Y T H O N  way .  .  .
Python slicing FREQUENTLY messes with my brain!
I guess because I don’t code Python everyday it’s often a hangup
I accept that some computer genius long ago decided that the 1st position
in an array is zero…even if it doesn’t make sense
I mean really, if a line of people in a bank are waiting for the next available Teller
Is the 1st person in line, the zeroth person? You can’t even say it where it sounds right
Nooooo…The 1st person in line is the 1st person or person number one
However the second position in Python slicing convolutes “relative to zero” ALL TO HELL!!!

Givin’ a string ABCDEF
IF a[0]= A AND a[5]= F which it is in Python
I’d expect that a[0:5] would be ‘ABCDEF’
But…NOOOOOOOOOOO!
a[0:5]= ABCDE

HOW DOES THIS MAKE SENSE???

Remember in a Python slice [x:y]


x is relative to zero…AND
y is relative to zero minus one

Yeah… That makes sense…NOT!!!

Sorta like “I before E except after C”…except worse. Relative to zero except when the second slice is used in Python…which is relative to zero minus one.

The  J U L I A  way  .  .  .

IF a=”ABCDEFGHIJKLMNOPQRSTUVWXYZ”
And a[1]=A AND a[6]= F which it is in Julia
Then a[1:6] unlike Python…is as it should be ABCDEF

I know…I know. It’s just the languages syntax. Thousand’s perhaps millions of people write Python everyday without problem with this, because they remember the syntax. Maybe it’s just me? At any rate it doesn’t take any effort on my tiny brain to make sense of Julia’s slice handling.

Speed
I randomly looked at a few articles Julia vs [Python, Matlab, R, etc.] and results for Julia weren’t always so superior. To be fair most of the comparisons dealt with a pre version one language, being that it just turned v1.0. Also I’m no data scientist or numerical computing expert.

No forced indentation!
Yes proper indentation is a good habit. My problem isn’t indentation per say. It’s probably more of a problem because of my habit of sometimes using spaces and sometimes using tabs! I prefer tabs usually but sometimes a tab seems too big. Once again I know…that can be adjusted!
I mentioned it before…it doesn’t look OOPish!! (Although that will probably change when they decide to make it “Better”).

Visual Studio Code

I must take a moment to comment further on Visual Studio Code or VS Code by Microsoft…yes Microsoft! I never would have believed I’d run a MS product on my Linux computer, however it deserves a mention.

VS Code can be used for many languages. I guess I have to give it serious consideration, seems very nice, free and open-source. I was considering another highly touted editor…Sublime Text 3. But they want $80 for it. $80? That seems more inline with 1980s pricing relatively speaking. F that! I might have considered $30. In a short amount of time VS Code, has become very popular, more so than Sublime Text…competition is good. Greed is bad…$80 for a text editor…HA! Stackoverflow Developer Survey Results 2018 ranked Visual Studio Code #1 in Development Environments and Tools, Sublime Text ranked #4…ha ha, try and compete with Microsoft you greedy bastards! I’m not against a small company charging a “reasonable” amount for a quality product. Reasonable of course is subjective, but $80 for an editor? With the introduction of VS Code, there’s a good chance I’ll never buy Sublime Text even if they reduced the price. I know…they’re not loosing any sleep over loosing a cheap bastard like me!  With Microsoft behind VS Code, it will probably quickly get much better. I have to hand it to MS, they always had good developer tools…IMHO.

Now I was totally against, and it angered me when MS created the MS Explorer browser which they also gave away for free thereby sinking the Netscape browser which was not free. However I believe the situation was different. The Internet was getting hot and Netscape realizing this, offered a reasonably priced…IMHO, way for everyone to access it. Keyword “everyone” not a small segment like software developers. Up until that point what major piece of software did MS give away for free? And I submit, in the early days of the Internet a browser was a major piece of software. Before the Internet mostly only businesses and hobbyist had/used computers. Even today if you take away the average persons browser and email program, few people IMHO would have use for a computer.