Book a Demo

Author Topic: Programming Language for Automation and Scripting  (Read 5296 times)

mehmeteraymuslu

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Programming Language for Automation and Scripting
« on: July 26, 2018, 10:23:31 pm »
Hello,

I am currently using Javascript for scripting EA. I learned SQL to be used on DB side. For automation I am thinking about learning Python. But I am not sure if EA goes well with Python. As far as I can see, most of the forum includes C# help topics. So is there anyone who is using Python and does anyone has a suggestion?

Thank you for taking your time to answer.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13443
  • Karma: +570/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Programming Language for Automation and Scripting
« Reply #1 on: July 26, 2018, 10:40:40 pm »
If you want to create add-ins then you probably want to go with C#.

In theory you could use any programming language that can generate a COM compatible dll, but I think the majority of existing add-ins is written in C#, and a minority in VB.

Geert

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1338
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Programming Language for Automation and Scripting
« Reply #2 on: July 27, 2018, 07:36:22 am »
If you want to create add-ins then you probably want to go with C#.

In theory you could use any programming language that can generate a COM compatible dll, but I think the majority of existing add-ins is written in C#, and a minority in VB.

Geert
I concur with Geert on C#. For the additional reasons;
a) There seems to be more examples and support from C# developers
b) VB looks like its a dying language and finding developers is becoming harder.

You could use Python as its a powerful language but you probably on your own. So if your brave and feel you don't needs support then maybe Python is for you. But I suspect that isn't you as your asking about languages to learn.

JScript is what most of the folk I know use for scripting rather than VB or JavaScript. Reason being a) There are more examples in JScript. b) Is almost the same as JavaScript which is used a lot on web development now.

Hope that helps you come to a decision.
Happy to help
:)

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8087
  • Karma: +118/-20
    • View Profile
Re: Programming Language for Automation and Scripting
« Reply #3 on: July 27, 2018, 08:42:49 am »
Of the scripting languages used in EA, I would recommend Javascript. Mainly because Microsoft no longer supports the script debugger used by EA for the other two.

If you're interested in writing add-ins, any .Net language will probably get you going the fastest. C# is probably the most popular of those.

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1338
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Programming Language for Automation and Scripting
« Reply #4 on: July 27, 2018, 09:48:25 am »
Of the scripting languages used in EA, I would recommend Javascript. Mainly because Microsoft no longer supports the script debugger used by EA for the other two.
...
Good point that I hadn't thought of. Bring to mind two questions.
@Simon
a) Does that mean the example JScripts will be ported to JavaScript in future versions of Sparx EA?
b) Does Sparx Systems recommend a JavaScript Debugger to use with EA?
Happy to help
:)

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8087
  • Karma: +118/-20
    • View Profile
Re: Programming Language for Automation and Scripting
« Reply #5 on: July 27, 2018, 12:27:48 pm »
a) Does that mean the example JScripts will be ported to JavaScript in future versions of Sparx EA?
It doesn't mean that. They could be at some point.

Unless I'm mistaken, the only 'Local Scripts' installed by EA that it matters for are the two 'Model Search' scripts. Converting those should be a matter of replacing ActiveXObject with COMObject. (see the help)

b) Does Sparx Systems recommend a JavaScript Debugger to use with EA?
EA includes a built-in debugger for Javascript that is not dependent on external components.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Programming Language for Automation and Scripting
« Reply #6 on: July 27, 2018, 07:19:22 pm »
Go with Python if you like it (I use it more often recently though I completely dislike its version concept and some of its functional bread crumbs). You have almost full access to EA's API (there are very few things where you need work arounds). However, if you have a need for add-ins you will need compiled code. This "is" possible with Python but honestly it's a PITA.

q.

mehmeteraymuslu

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Programming Language for Automation and Scripting
« Reply #7 on: July 30, 2018, 11:23:56 pm »
I almost completed my Javascript course, so chosing javascript for scripting wasn't a bad decision after all. I guess learning C# would be better choice(C# vs Python), because while learning new language I may need a lot of help. After I complete C# courses and have a certain level of self confidence, I may go for Python as well. My experience with C# may give me a head start while learning Python.

Thanks everyone for sharing precious comments.