Jump to content
Science Forums

Developer Woes: Quirks of Programming Languages


saidevo

Recommended Posts

To display a simple message box, I need to use the terms MsgBox in VB, MessageBox in VC++, alert in JavaScript, showMessgeDialog in Java... No wonder, I have started losing hair as a developer!

 

Why not use a single name, say MessageBox, which is much akin to plain English, whatever the language you're using for development? The capabilities might differ across languages, but at least let the names remain the same. Common names could help the cause of the much-talked-about RAD. Let the competition be among the capabilities, not names. The aim should be to build a united world, not create another Tower of Babel.

 

Today, several programming, script and database languages are in active use for different tasks in application development. Developers are required to be proficient in a good number of them, and fine-tune their ability to combine and integrate them within the framework of an application. It's time a Consortium on the lines of the W3C, is formed to impose standards for names, specially methods, functions and procedures, across programming and scripting languages.

 

Until such time as it happens, can somebody develop wrapper methods with a single name across languages that call the relevant methods internally?

 

saidevo

Link to comment
Share on other sites

I like the idea, but how would you deal with all the existing languages? Would all the code behind the existing laguages need to be rewritten to recognize the new codewords? Would all the existing software need to be rewritten using the new language?

 

Perhaps there is an opportunity here for you to create a solution. Write a development environment that acts as a front end for multiple languages. The user would write code in the "common tongue" and it would be translated into whatever native code they chose. It would be a challenge, but if done successfully it would provide a huge leap in simplifying software development.

 

Bill

Link to comment
Share on other sites

Even .net doesn't get yout there. It has a common set of tools in the framework, but different language for invoking them in the toolset. I can use vb.net, but I am lost on c# or j#, etc. And translation wizards from other languages are hit and miss. I had written a simple calendar program in VB6. It could not translate into .net because the connection type I used to the background DB was not supported in .net, and it used control arrays that are not part of .net.:lol:

 

While .Net is a step in the right direction (IMO) it is not the final destination.

 

Bill

Link to comment
Share on other sites

Another approach to combating the “tower of babble” effect in programming languages is to avoid high level languages, and stick with something like C or C++ without large “foundation” class libraries. Of course, this means you’ll either become bound to the hardware, or, if its present, the operating API (90%+ Win32).

 

My own background in M[uMPS] got me involved in a late 1980s comittee effort to develop a way for the M language to interact with a generic “windowing” environment. This produced something known as MWAPI (M Windows Application Program Interface).

 

MWAPI attempted to make accessing the display syntactically nearly identical to accessing date. Creating a simple message box looks something like

SET ^$WINDOW(“mywindow”,”GADGET”,”mylabel”,”TYPE”)=”LABEL”
SET ^$W(“mywindow”,”G”,”mylabel”,”VALUE”)=”Hello World”

(note: ^$W and ^$WINDOW refer to the same thing), dismissing it

KILL ^$W(“mywindow”)

Nearly all M language implementers in the early 1990s were interested in, and many implemented MWAPI. The development committee put a lot of effort into standardizing a binding to unix’s X windowing scheme, and a couple of implementers bound it to pre-MSWindows 3.1 GUIs. Other than MWAPI bound to X, however, it was hard keeping the various implementation attempts standard, and the whole effort pretty much fell apart.

 

MWAPI never caught on with developers, and when windows 3.1 began gaining popularity, was almost completely abandoned in favor of a wild zoo of windows and X –using client applications. Eventually, a lot of M developers began to favor browser-applications. As HTML 2 failed to progress into HTML 3, and browsers began more playing host to Java, flash, and other embedded scripts and applets, than simply rendering HTML, even these efforts got bogged down in code-generated-by-code complication.

 

I really miss MWAPI, but acknowledge that it was ill-conceived and conceptually flawed from its inception. Incredibly (to non-programmers, at least), the seeming simple mechanics of displaying and receiving data remains a complicated, tail-chasing pursuit.

 

There’s a lot to be said for command line interfaces to simple scrolling terminal applications.

Link to comment
Share on other sites

This was the purpose for .Net - write once, run anywhere. Unfortunately, as we've seen, unless you're writing something remarkably simple, each language has its own nuances that must be observed for your code to work properly.

 

VB6 and VB .Net are not designed to be compatible - Microsoft essentially wrote a new language that was similar on the front end to VB (controls are identical with the addition of a few more) but almost completely different on the back end. MSDN will be your friend on that problem.

 

I've pretty much resigned myself to three languages at this point: C (mostly Linux coding), VB .Net (Windows and some Mono environment stuff) and Java. The problem I have with the nosebleed-high level languages is that they take so much responsibility away from the programmer. I actually prefer to be responsible for the memory I use and then deallocate. I cannot stand errors in my program that point toward a library that I didn't write or implicitly include.

 

I'd love to eventually play with C#, but at the moment, time is not something I've got an abundance of. Perhaps later.

Link to comment
Share on other sites

yeah i stick to a few languages myself, mainly C++, Python and PHP, since i dont do much windows development, i care less about the .net platform, not that it is a good development platform to begin with, i mean it works in theory, but in practice MS did a splendid job of blowing, VB.net has some improvements, but other then that, its mostly pretty useless, in my eyes anyways, wont argue what anyone says though, oh and C# blows, so i stick with C++ for any kind of windows needs i may ever have, language is pretty stable, and all you really need is to learn some libraries, like i am currently learning GStreamer for audio and video needs, and you are golden (luckily most stuff i do is not gui centric, but god, i mean do you know that it takes about 70 lines of code to make a window that doesnt do anything in windows? yeah, very very frustrating it can be, and if you look at the Visual programming code... its like Dreamweaver generated webpage...) anyways...

 

i know what you mean with frustrations, but i think that since you only care about really 3 languages, you should not really have many problems, i mean aside from C++, Python and PHP, i deal with C, Perl, Bash script, Ti C, Delphi, ColdFusion (infact very recently), Java and JavaScript, oh and fvwm config files (which are written in a dead language from another planet) all have extremely different styling and ways they do things, but after a while, you just tend to get used to these things, i think for now its a reality of programming... But, seriously, now looking at something like Ruby, its like, wow i know 90% of it (its kinda like an unannounced, bastard child of Python and Perl :lol:)

 

P.S. if you dont beleive me with fvwm config files here are a few exerpts:

 

Definitions of some keyboard bindings:

Key escape A $[Mod2] EWMH-Toggle Key escape A $[Mod2]
Key l A $[Mod2] All (CurrentPage) Iconify Key l A $[Mod2] EWMH-Toggle

 

Mmm, menu:

# --- /5Graphics ---
*ApplicationPanel: (1x1, Size 22 22, Icon "gimp.png", 
Action (Mouse 1) Menu /5Graphics $[MenuPosition-Below], 
Action (Mouse 3) X gimp)

DestroyMenu /5Graphics
AddToMenu /5Graphics
Test (x blender) + "%blender.png%Blender" X blender
Test (x kpaint) + "%kpaint.png%Kpaint" X kpaint
Test (x oodraw) + "%oodraw.png%OpenOffice.org Draw" X oodraw
Test (x inkscape) + "%gimp.png%Ink Scape" X inkscape
Test (x gimp-2.2) + "%gimp.png%The Gimp" X gimp-2.2
+ "" Nop
Test (x gqview) + "%gqview.png%GQview" X gqview
Test (x kview) + "%kview.png%Kview" X kview

 

...may seem simple, but all kinds of info is scattered in all kinds of places, trust me, those are wicked weird to do anything with...

Link to comment
Share on other sites

Perhaps there is an opportunity here for you to create a solution. Write a development environment that acts as a front end for multiple languages. The user would write code in the "common tongue" and it would be translated into whatever native code they chose. It would be a challenge, but if done successfully it would provide a huge leap in simplifying software development.

Bill

 

Yes, a development environment is what I had in mind. You've put it nicely. And it should be open source and cross-platform. Somebody can start with a handful of most popular languages and more can be added in collaborative development across the Net. We only need generation of the source code in the preferred language from the development environment, and this can be compiled later.

 

In the same way, we should also have a common development environment that uses ANSI standard SQL and translates a query to the required way with multiple database management systems, which have their own quirks and add-ons.

 

saidevo

Link to comment
Share on other sites

And it should be open source and cross-platform. Somebody can start with a handful of most popular languages and more can be added in collaborative development across the Net.

you clearly can not realize the scale of a project such as that, a crossplatform development platform, you would need a decently large team of people knowledgeble in loads of platforms (and i know that you are not the guy who wrote the MySQL base code (a Canadian, who is a friend of a friend of mine, who is the only person i have heard of so far, that can develop on 26 different platorms, and even for him, it would take months and months per language)), you would need to know intricacies of processor architectures as well as a complete knowledge of the OS you are developing on, so you really need a team of developers working for months and months and months to a common goal of getting one language to be completely platform independent, oh and you would need a team of psycologists who are willing wo write a complete description of all the capabilities of the platform, as well as possibly tutorials and whatnot to teach people how to use it, and you would need to modify language instruction sets to accomplish such a task, so there is no confusion on how to use functions or operators or whatever, oh and finally, you would need to cut low level system interaction in languages as well, then you would be essentialy rewriting Java as it was initialy defined, and once you have done that, you also wanted this to be for multiple languages, so, good luck.... dont mean to discourage anyone from doing this, just bringing you the cold, deep down reality...

Link to comment
Share on other sites

Ok, ok, big dog, you can do something like that, basicish, but running on all platforms, but then this comes to mind:

What developer in their right mind would want to use a language that while having compatibility, or ability of running your program on any platform, and i should say at a price of a giant added overhead, when it only provides a basic instruction set.... Who would bother using a language such as that, in the real world where programs need to have graphical menu systems, at least on windows platforms, combined with loads of functionality, databasing, long mathematical computation algorithms, video or audio output, or hardware interaction, hell, object orientation so you can make complex datastructures, who in their right mind would want to use Basic to fulfill real, everyday tasks in the real world, outside of schools, and personal level interests? Because if you cant appeal to the general programming community, what kind of backing are you propposing to have, your walet and the walet of the developers, who, might i add usually like to get paid for their time, especialy developers on the level that your project requires...

Link to comment
Share on other sites

Ok, ok, big dog, you can do something like that, basicish, but running on all platforms, but then this comes to mind:

What developer in their right mind would want to use a language that while having compatibility, or ability of running your program on any platform, and i should say at a price of a giant added overhead, when it only provides a basic instruction set.... Who would bother using a language such as that, in the real world where programs need to have graphical menu systems, at least on windows platforms, combined with loads of functionality, databasing, long mathematical computation algorithms, video or audio output, or hardware interaction, hell, object orientation so you can make complex datastructures, who in their right mind would want to use Basic to fulfill real, everyday tasks in the real world, outside of schools, and personal level interests? Because if you cant appeal to the general programming community, what kind of backing are you propposing to have, your walet and the walet of the developers, who, might i add usually like to get paid for their time, especialy developers on the level that your project requires...

You are right absolutly right. The only point to this would be to dumb down programming so that the layman could do the work of a skilled developer. I am sure that it is eventually going to happen. Probably built by Microsoft. But not until the computers get fast enough that the additional overhead no longer matters. And even in that event you would still need the programmers to build the program that programs for the non programmer. :hyper:

 

There is already some of this to be found in the world of ERP systems where users build workflows and business rules and that hets configured into the objects, data structures and interfaces that build you integrated systems. While not quite all the way there, and requireing technicl experts for the archetctures and hardware, they are moving in the direction of truly being self building without the need for developers. This is being helped by the extablishment of industry standards that must be utilized to prevent core modifications to the objects.

 

Bill

Link to comment
Share on other sites

yeah that is a splendid idea indeed Big Dog, software such as that exists already, look at Dreamweaver or FrontPage, just that there will always be need in code efficiency, loosing potential performance, especially in OSes (talking about real OSes, not windows which seems to be more bloated with every version) will always be counteracted with improvements in code, no matter what kind of processing power you have, some people will always want their efficiency to be approaching 100%....

Link to comment
Share on other sites

I certainly agree that it would be great to have a common, standard object oriented API with an implementation for each OS but with folks like Uncle Bill around it just ain't gonna happen.

 

Java began with the compatibility issue in mind but in the mean time, from JDK 1.1 to the current one, it hasn't completely solved the compatibility issues, not to mention the overhead cost. As much as the young Javadores like to think otherwise, I don't consider it a better language than C++ anyway, it's only easier.

 

Further, to really make things seamless, it would be necessary to re-engineer a lot of stuff for the new API. Without the likes of Tomcat and other products, it wouldn't be used all that much nowadays so the effort wouldn't pay itself.

Link to comment
Share on other sites

What I mostly meant is that it's handier, considering the JDKs, but it also has a few featurs less and bans multiinheritance as well as goto while adding a thing or two, like the scheme of packaging. The platform being OO and with a root class and linkage always being at runtime allows some good features. These can be built in C++ but without making a new language you can't have them being automatic. The Java world definitely makes it easier to develop GUIs and the most sophisticated webapps but the same could have been done with a better new language than Java and I do find the way some things are done in the JAPIs far from optimal. Without Uncle Bill's hinderance it could also be done without that ghastly heavy bytecode thing.

 

I don't consider Java more fully OO. Banning globals doesn't really make it so IMHO, actually without multi-inheritance, operator definition and templates it is somewhat less OO.There are some things for which, for all the analysis you could do, there's really no advantage in making a static member of one class or the other. The choice of banning globals was really just an easy way out for the implementation necessity due to a Java project being a collection of runtime linked component objects. A better way could be to make globals static members of a default class. For making libs having globals, the default class could have the name of the project and there could be a scheme about qualifying identifiers where necessary. :hihi:

Link to comment
Share on other sites

Echo'ing Q's last post:

 

The late linkage is critical for "managed code" environments, which is really C++'s Achille's Heel: its a royal pain in the backside to use the garbage MS has come up with for the dealing with common libraries in VisStudio, but its not entirely their fault. I've been hoping that someone would unhook this part of the C++ standard because its so painful *and* unnecessary. I use Java for mainstream web apps, but if I've got a really complicated model to manipulate, that multiple inheritance *really* makes a difference.

 

There are globals in Java, you just have to build them on the fly: I don't know who Jim G and company were kidding when they came up with this "restriction": it may get the programming students to program better code, but real coders know you need globals, you just need to manage them properly. Making me type an extra "new()" does not make globals go away...

 

Language maven,

Buffy

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...