Francis Galiegue · May 20, 2016 go to post

This command worked...

However this does not answer my initial question: how come the install found the instance despite the fact that I completely removed the install directory?

Francis Galiegue · May 2, 2016 go to post

I'm only seeing this post now... Great source of information!

Now I wish I had more practice... But this is close to what I want to do.

Don't you want to contribute to the project? :p

Francis Galiegue · May 1, 2016 go to post

I was not asking about how to name things but about how to make this package accessible to everyone

Francis Galiegue · Apr 30, 2016 go to post

Hmm...

I don't use an %Installer... And in a default Caché installation there is no %ALL namespace.

What would you say is the less intrusive solution, then?

Francis Galiegue · Apr 29, 2016 go to post

Well, I am on it right now but it does not quite answer my question...

Still, it is a useful resource, so I take as many lessons as I deem are useful to me...

Francis Galiegue · Apr 29, 2016 go to post

Side note... While I don't quite understand the need here, this is another case where a table of deprecated classes/methods/keywords would be useful...

Since which version of Caché is this class deprecated? Unfortunately we don't know :(

Francis Galiegue · Apr 27, 2016 go to post

I know of this syntax. However, the "problem" to me here is that all invididual variables declared here are implicitly created :/

If you create a lot of variables this way, this can become very hard to track what the code exactly does...

Francis Galiegue · Apr 27, 2016 go to post

Very nice!

One question: since in this code tStmt seems to be a prepared statement, can I just declare it as a parameter to the class and reuse it when I need it?

Francis Galiegue · Apr 25, 2016 go to post

Hmm, interesting... But does it work recursively? Ie, if I have class C inherits class B inherits class A, is $classMethod("C", "%IsA", "A") true?

Francis Galiegue · Apr 21, 2016 go to post

Useful information, thanks!

I can add a cache-2010.1 tag to that particular namespace change rule I have...

Francis Galiegue · Apr 20, 2016 go to post

Hello!

First things first: /latest/ is a great idea!

Now, on to my personal feedback which is obviously biased: I am primarily a Java developer (with prior experience in C), and am seeking to know ObjectScript better... As such, I find that two things are fundamentally missing:

  • as mentioned in one of my other posts, a reference documentation of changes between the different versions of Caché (introduction of new classes; classes deprecated from n to n+1; changes in classes between n and n+1; or even new keywords): Java has @since, C has manpages and CONFORMING TO, which both give great, useful information... But there is no equivalent in COS documentation;
  • an official guide for coding guidelines.

All in all, this is rather a feedback on the content rather than the form; not sure whether this is what you expected, but here be dragons :p

Francis Galiegue · Apr 19, 2016 go to post

Not an answer per se, but why do you specify both "extends %Persistent" and "ClassType = persistent"? Is it necessary?

Francis Galiegue · Apr 18, 2016 go to post

Good catch!

And while we're at it, it'd be nice if it could also "dedent" preprocessor directives... Except for #dim.

It's quite confusing to see a #if something on the same level as a bona fide statement...

Francis Galiegue · Apr 14, 2016 go to post

I didn't know about ^SYS.MONLBL.

As to why unit testing, it's because unit testing is used along with code coverage: you run unit tests, and you check what parts of your production code is taken/non taken. Timings are indeed irrelevant.

The plan is to run unit tests with coverage activated, scan both the test results and monitoring results and collect the results.

Francis Galiegue · Apr 11, 2016 go to post

Eduard,

I was aware of the new If not setting $TEST.

And again, let me insist: shorter doesn't mean better :p

Francis Galiegue · Apr 11, 2016 go to post

Hello Eduard,

I was not aware of version agnostic URLs. I will use them, thanks for the link! And yes indeed, I know that the documentation is lacking in some areas. And in fact I have a branch dedicated to issue documentation updates... Time to update and merge, I guess :)

As to postconditionals, well, I put myself in the place of someone which is new to the language: his background will more than probably be with languages with all the "classic" branch keywords (if, else, while, do...); making it so that the code is more readable is always a win! And no, shorter isn't better :)

But yes, you can configure what is called quality profiles in which you select which rules you want to activate, and you can also alter their severity to fit your needs. Not only that but you can also expand the help text and change the parameters of rules which have parameters (classic example: complexity).

Oh, and by the way, there _is_ a difference between postconditionals and if (I learned that yesterday): a postconditional won't set $TEST...

If you're at the summit, remember that at 12:30pm today I'll give a short talk :) If you are there I will demonstrate, among other things, how you can set your own quality profiles.

Hope this helps!

Francis Galiegue · Apr 7, 2016 go to post

Hello,

That is not what I mean, sorry. What I meant to ask is whether there is a way to store "primitive" JSON values, not only objects and arrays. For instance, can I:

set xxx = ##class(JsonValue).number(2.3)
set xxx = ##class(JsonValue).null()
// or .true(), .false(), .string("some string constant"), etc
w xxx.getType() // would return either of object, array, number, boolean or null
Francis Galiegue · Apr 7, 2016 go to post

Well, there is something else in fact.

RFC 7159 allows any JSON value as a JSON text; so for instance, false, 2.2 or null are also valid JSON values.

Is there any way to enter and manipulate such values?

Francis Galiegue · Apr 6, 2016 go to post

Just one thing...

I was at a conference back in June in Barcelona where I had the chance to meet with, among other InterSystems people, Jamie Newton...

And I mentioned to him that this JSON was valid:

{ "": false }

(ie, the key of the object member is in fact an empty JSON String)

This was some months ago; does ObjectScript now support such keys?

Francis Galiegue · Apr 6, 2016 go to post

This is my choice.

The goal is, after all, to find issues in ObjectScript code; as such, developer feedback on issues are very important :)

Unless I have misunderstood the goal of this forum completely?

Francis Galiegue · Apr 5, 2016 go to post

Hello,

I don't understand what you mean?

As you may have seen on the main page, there is an email to which you can write so that your code can get analyzed on this very site. Note that this is a compromise: you get the analysis for free, but the code is visible to everyone; which is why open source projects written in COS get the most benefit from it.

Related to that somehow is that from our experience, most such projects still use Studio's export facility which exports to XML; fortunately, we have a solution to turn those exports into plain source files (https://github.com/litesolutions/cache-import). Once Atelier gains wider adoption, things may change, in a good way: no need to massage XML anymore!

Francis Galiegue · Apr 5, 2016 go to post

Hello,

This is precisely why I'm asking for feedback about default severities :) Do I take it that you think the severity is too high? If yes, what do you think it should be?

Note that if you wish to, I can set up an account so that you can modify which rules are active and which are not, along with the default severities (just send me a mail). But you talk about fine tuning, I'd rather the settings were good enough that the amount of fine tuning spent is minimized :)

I am a seasoned Java developer myself and I also disagree with many of the rules of SonarQube's Java plugin. But admittedly, I revere type safety and it somewhat shows in the rules :)

----

As to macros, well, you can write a macro as a statement, sure, but the problem I see is that it is an opaque statement. What does this macro do? Does it exit the method? If a variable is passed as an argument, does it modify this variable? Does it increase the complexity? If yes, by how much? Basically, this is the reason for the rule. Nothing Java related :)

In the future the plugin may expand macros, in fact; right now however this is not supported...

Francis Galiegue · Mar 25, 2016 go to post

Just one thing; one good tool to use on Linux is dstat.

It is not installed by default, but once you have it (apt-get install dstat on Debian and derivates, yum install dstat on RHEL), you can observe the live behavior of your system as a whole with:

dstat -ldcymsn

It gives quite a lot of information!

Francis Galiegue · Mar 25, 2016 go to post

The problem with all such analyses is always the same. They fail to account for the single most important factor for real world applications, and that is memory bandwidth.

Code written for benchmarks has the flaw that it is precisely "written for benchmarks". It is no replacement for real life code which accesses memory in ways that such custom code cannot even begin to emulate.

Consider virtualization for a moment. Let's take the x86 world. Let's take Intel's VT-x, or AMD's AMD-V. If you look at the wikipedia entry for such techniques, the core goal of those technologies is _not_ to make machine code run faster (this is the "easy part"), but to reduce the time it takes for programs in virtualized environments to access memory.

Running code is "easy". Accessing memory is hard... And accessing memory is the key.

----

For completeness, I'll just add this: I am mostly a Java developer, and I know that the most glaring flaw of Java is its poor locality of reference -- accessing any `X` in a `List<X>` is very likely to trigger a page fault/load/TLB update cycle for this particular `X` to be available. As a result, when performance comes into play, I do not look as much into the frequency of the CPU as I look into the L{1,2,3} cache sizes and the memory bus width and speed. In the long run, the latter three are the deciding factors as far as I'm concerned.