3 ms·
What really annoys me in text programming is that I have to write constructs again and again, referring to manual for method names constantly. Completions may b
by wruza 9y ago
What really annoys me in text programming is that I have to write constructs again and again, referring to manual for method names constantly. Completions may be smart typewise, but IDEs never assume what I am writing. Let's take a function:
static string defaultFamily = "Sans";
bool
foo(string s, Alignment a, int height)
{
Par_
Okay, it began. What can be done with all the available values? Seems that I'm going to create a paragraph and fill it with some arguments. One of autocompletion suggestions:
bool
foo(string s, Alignment a, int height)
{
Font f(defaultFamily, height);
if (!f.isValid()) return false;
Paragraph p;
p.setAlignment(a);
p.setText(s);
p.setFont(f);
<#rest#>_
return true;
}
How is it obvious? Because Paragraph told the completion system that it needs at least font and text values set. Height goes to font, other arguments go to paragraph. Names are selected from the style around. Since we return a boolean and few objects can be invalid after initialization, it assumes that it is a status. p is local, so there is something to be done with it, and another <?> block is created.
Even better, you could just throw items together and get the result:
// this->points is double[20];
{
frame inset 0.5 red stroke;
add points black stroke;
---
{
Rect r = this.frame();
r.inset(0.5, 0.5);
Painter p;
p.setColor(Color::red());
p.addPath(rect);
p.stroke();
p.clearPath();
for (point in points) {
p.addPoint(point);
}
p.setColor(Color::black());
p.stroke();
But the completion style that we have everywhere just sucks:
int
foo(string s, Alignment a, int height)
{
ParadoxDatabaseProvider_
ParadoxDatabase...
...
Paragraph
ParamsManager
I can't point to good visual programming tool, but our "powerful" text IDEs are simply prehistorik typewriters.
- Too 9y ago> Because Paragraph told the completion system that it needs at least font and text values set. If the class needs at least all those arguments it shouldn't have an empty constructor. It should have those as arguments to the constructor and then most good ide today would be able to help you at least a bit better. Have you tried intellij? Boolean return values without context is also an antipattern, how am I supposed to know whether true means success or fail or something else? There is no way any AI would be able to infer that either without annoyingly amount of false positives.
- wruza 9y agoOkay, "paragraph told that non-default font is often used and empty text is not very useful". These are just examples, I'm not pretending this to be final form. How about non-construction? foo(string s, string p) { fin --- int i = s.find(p); if (i < 0) <#?#>; _ Also, if it appended { on if-line when I press Tab, that would be great. >There is no way Really? I clearly see how to do this without any sort of AI. That's graph path weighting problem based on key words. If it gives you a false positive, just add words (or put more useful hints and >>use case snippets<< if you're library writer). But I got your point, let's walk on the same rakes for life. There was a time when I was amazed by programming, now after two decades I'm tired of it to death (and yes, it seems that I'm "10x" from the feedback around). Programmers create and solve problems that mere mortal cannot even understand and this cool process is far from "cheap". Everyone talks about no-brain easy programming, but no real steps are done in this way. You know, when you're doing something often and for years, you just get used to it, know it all, and see no need for a change, forgetting the learning curve. You can write all of above snippets with closed eyes. The same happens to the entire profession -- you are professional and that's your value. We doomed to raise professionals again and again. In what areas? C++, SQL, etc... But wait, these are no areas! Areas are: medicine, building, etc. I don't want "cee pulse" programmer, I want a guy who understands my area. I'm attributing these "no need for this" attitudes to the simple fact that such a system would be first step to programming without paying a programmer who solves non-existing problems. You simply put words and the system analyzes best practices and use cases from selected github projects or templates to produce a result, and you only need 0.1 of your development forces. Professional experience is bound to a programmer, but this thing would allow to change that. The same friction we seen when computers appeared. People hated them simply because their professions ceased to exist. Lyrics off, software libraries are graphs. And graph is a thing that can be processed, if not in generic, then in specific way. There is algorithm that produces the most wanted result for known specific case.