Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
aadowns21 Absent Member.
Absent Member.
468 views

.Net, Managed, or Native

Is it worth learning native cobol or should i jump right into .net or managed?  Thoughts?

0 Likes
4 Replies
hleerobinson Trusted Contributor.
Trusted Contributor.

RE: .Net, Managed, or Native

It depends on your situation. I have many native COBOL programs I maintain that were written over several decades. These I am keeping in native COBOL because I can simply recompile the NetExpress code using the Visual COBOL compiler and they run. However, all new programs I write will be in managed COBOL because they can take full advantage of the Windows environment within which I work. I have one managed COBOL program that serves as a menu to run native COBOL programs. They can coexist. If you are just learning COBOL, I don't see any advantage to learning native. It is, from my limited perspective, a subset of managed COBOL.
aadowns21 Absent Member.
Absent Member.

RE: .Net, Managed, or Native

Thanks for your opinion. I learned Cobol in 1985 when I was in college. I am now a .net, C#, VB, Typescript, Angular programmer. I wanted to relearn Cobol to add to my existing knowledge. I was unsure whether to pursue it from the native standpoint or .net/managed.
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: .Net, Managed, or Native

The terms native and managed in Micro Focus terminology actually refer to the code generated by the compiler and really has little to do with the syntax of the programs you are writing.

Native code projects in Visual COBOL will generate .obj code for a particular platform that can then be linked into executables such as .exe or .dlls on Windows or Unix/Linux executables or shared objects (.so).

Managed code projects in Visual COBOL will generate either .NET assemblies which also have the extension .exe or .dll if you are using the Visual Studio flavor (use ilgen directive) or as Java byte code which have the extension .class if you are using the Eclipse flavor (use jvmgen directive).

Both types of projects are capable of compiling legacy procedural COBOL programs.
Managed code projects also support the new Object-Oriented syntax allowing you to create classes and methods that integrate tightly with either .NET or Java.
Native code projects also support Object-Oriented syntax but this is an older variety used to create native classes that integrate with a proprietary class library written in Micro Focus COBOL.

If you are familiar with C# then OO-COBOL will be very familiar to you. You can freely mix procedural programs and OO features within a single program or class. You can CALL a procedural program from within a class or you can INVOKE a method from within a procedural program. You can also call C# from COBOL and COBOL from C# and debug seamlessly from one into another.

If you wish to hook your COBOL programs up to a GUI such as Windows Forms or WPF then managed code would be what you want to take a look at.
andrewv1 Absent Member.
Absent Member.

RE: .Net, Managed, or Native

It depends. Micro Focus COBOL already is a managed language. It can interoperate with other languages.

showbox

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.