In the last article I wrote about how I moved from "Too many bugs in C code", over "This new programming language is fun" to "I will build a platform where users will build & share features". In this article, I wanna write about a better approach for navigating code and debugging.

Progress

There are two things which have improved software development in the last few decades:

(a) Better programming languages. So we can have fewer bugs, especially "hard to find" bugs. The big question here: is it possible to push it significantly further?

(b) Better IDEs. I believe there is a lot of space for improvements!


There is a new programming language maybe every month, but how often is there a new IDE? Few years? Building IDE is hard. Even that simple idea of that I will show you in this article took me a week to implement.

IDE is a place which brings code, compiler and debugger closer to the user. User experience for writing and understanding the code is super important. It's a place where people like me spend a big part of their lives.

Modern "IDE"

Lately, We have a lot of No/Low code platforms rising up. They call them Productivity tools, but they are basically IDEs(Integrated Development Environments). In a most extreme cases it's simple drag & drop blocks or nodes on canvas. The problem is those platforms restrict you with a few specific tools and places where you can apply them. They are optimized for few use-cases. Compromise and you get easy to use. That's the name of the game.

In the last ~5 years, I did a lot of research and development(many MVPs) in the no-code area and it's definitely possible to make a general programming environment without writing text/code, but doing that you will be slow, very slow.

Text matters

I believe that the most efficient way how to explain to the computer what to do is through text! The learning curve for writing code is crazy. I'm not surprised that so many people give up. There has to be some invisible force, keeping your motivation up enough to continue.

I'm not a big fan of pure text programming. I like IDEs with debuggers, refactoring, REPL, auto-complete, fast code navigation, etc.. I'm a huge believer in low-code, in terms of that everything is code, but you don't have to write all of it. Using the keyboard in all situations doesn't make sense: picking a color is better than writing "120, 64, 80", drawing a rectangle with a mouse is better than writing numbers as parameters.

Learning how to write on a keyboard with all fingers without looking takes 20-40hours, but then you will be way more efficient for decades. In the beginning, it's hard to start coding, but when you "made it", your efficiency will be out of the roof and you'll eat no-code programmers for breakfast.

I get it, text is not sexy. Try to imagine super happy & smiling people in ads, touching the screen ... with code on it ... Ouch. But text works!

Ok, no more theory, let's move to the new stuff.

No jumps

Many say that a code is like a book. You read a book from left to right, top to bottom, another page, another chapter. But with code, it's not like that. It's chaos. You start in main() and then you jump from one place to another, forward and back until a call-stack in your brain is full. Coding is more like the 2nd season of Westworld. Non-linear storytelling. You probably don't like it, unless you really are into solving puzzles.

But what If instead of procedural code, the code would be a stream of lines? You call some function(fill parameters) and the body just shows up below it. So your focus is not disturbed. The advantage is there are no jumps(while reading text), which especially beginners appreciate.

For debugging, there is no need for a call-stack(a list which shows you jump in the code). Normally, setting a break-point is not easy, because the program can visit the line through multiple paths(function can be a call from different places), so you spend time debugging that path to the line. In SkyAlt, you just unfold the particular function call and see the body, so debugging gets much easier.

I'm testing it only for a few days, but reading, creating and editing code feels really good.

Note: The SkyAlt syntax is adjusted for this kind of folding - you can have only one function call on the line. In many other languages, you can have multiple functions calls on one line(as parameters) and then of course is not possible to show all their bodies in linear text space.

SkyAlt build 3(alpha).

Visual REPL

Programmers talk about the accidental complexity of programming languages all the time, but what about the accidental complexity of IDEs. What do you do when you see a bug in GUI? Do you think which class is it? And where will you set the breaking point? Or do you just press alt-key and click into GUI? Because the last option is SkyAlt way. One-click into GUI. Bum. You debugging the line of code, which draws that part.

SkyAlt execution model is ImGui(Immediate mode GUI), so every frame starts by calling Main() function with a clean frame buffer. When you write code, SkyAlt has preview panel which shows you how the app looks on the line which you're working on. Of course, the preview is live so you can click/write into it, but the interpreter will stop when your current line is hit and starts another frame calling Main() again. When you creating code, it's easier to catch bugs than using some reactive model, when something triggers something and so on. Check the video.

Note: I originally think that the alt+click idea was mine, but later I realized that a few years back I saw it in Bret Victor's Inventing on Principle. Although, my implementation is a little more advanced because SkyAlt will show you the whole "call stack". In his video he probably just save line number to pixels, so you don't know from which place the function was called.

SkyAlt build 3(alpha). In the video I alt-clicked on "Show all" button and later on "X" button.

Summary

Making only programming languages is not enough. We need more IDEs. Different approaches how to create and navigate code faster.

If you don't wanna learn how to code, because there is no-code, you will never be as free and efficient as people writing code.

I presented the new way how to create code without jumping through text. This approach nicely fits for live debugging(no call stack) as well. Also If you alt + click to program's GUI, SkyAlt will show the part of the code where that GUI was made. It's a huge time saver.

I really love SkyAlt and I wanna build every new idea I have in it. I don't wanna program in other languages and IDEs anymore.

Milan Suk
26th October, 2020

Thanks for reading, feel free to try SkyAlt, send me an email or follow me on Twitter(@milansuk).

Blog GitHub Twitter E-mail