Jump to content
Science Forums

Basic: Programming Language or Corrupting Influence


Recommended Posts

What's wrong with COBOL? It's still in use, in many places.

I actually have a copy of Fujitsu Cobol for Windows. It let's you use the VB GUI for designing the user interface and Cobol for the backend coding. :circle:

Link to comment
Share on other sites

Yeah, I disagree with Buffy on this. Say, Buf, while it is possible to do anything without goto if you're dogmatic and find it blasphemous, this doesn't mean that it's always better to do so.
I apparently need to use the :edevil:'s advocate smilie more often! Even C and Pascal have a goto in them, although lots of implementations have dropped it in order to bow to the followers of Uncle Edsger....

 

I think it has a lot to do with how you learn. Personally, I find the code fragments above just show that there are different ways of doing things. You do save a line or two, but saying one is harder to understand is purely personal preference. I *can* tell you that if you're parsing code to do code analysis or optimization, that the structured code is much easier to disambiguate and rearrange since the reentry points are not arbitrary and code blocks are overlapping. Compiler writers actually hate gotos!

 

Cheers,

Buffy

Link to comment
Share on other sites

because stuff like this:<way ugly code deleted/>is not possible in python?
Nah, you can program anything in anything if you're any good! You may have to write a lot more code in some cases, but usually only for very bizarre language features (see Lisp, Snobol, Ada, or my favorite APL)!
Dont get me wrong, I probram in PHP, and know some Perl, but they were not designed to teach how to program, PHP is more Ok with its synthax, but its limited to its uses....
Sorry I was being facetious! I definitely agree that Python is a "real" programming language, but its uh, "terse" and I kinda think the more traditional "learning" languages like Pascal are better for learning (see next comment)...
In python you have to write clean code because the language is whitespace sensitive.
There ya go. It not as bad as programming the Whitespace lanugage (look it up if you're not familiar with it! Its a blast!). "Learning" languages need to be structured enough to warn you about stuff like this without tying themselves in knots. OTOH, at Berkeley we just got thrown in the water with C, and you learned the rest on your own as prep for compiler class. That wasn't that bad...they still taught Pascal to the liberal arts majors though.
First of all HACKING IS GOOD,
Preachin' to the choir here alexander! Been an official hacker since before you were born! :circle: OTOH, I can tell you that properly designed and implemented program architectures get majorly munged by constant hacking. I'd argue that actually that IS the major problem with Windows: it has been hacked to death. There's a really good argument that you need to have formal design reviews and code walkthroughs and enforce coding practices in order to avoid unmaintainable systems, so hacking will only take you so far.
If you are saying that python lacks complexity you know nothing of it. It is not a procedural language, its not linear in its syntax, it has an awesome Object model, the code is only as hard as programmers make it...
No, I absolutely agree with you that Python is a great language, and I've been fiddling with it for about a year now, and I definitely like its bells and whistles. I'm just not convinced its a "learning" language yet!
... but i utterly, to the depth of my heart, hate Java. Talking about a language that makes for bad programming practices Java is so in the lead... Plus I've heard it many times now from quite a few people ... Python programmers write much better Java code than Java programmers, thats why so many companies are starting to requite some Python programming experience for their java programmers, even Sun, i believe.

Tee hee! Don't say that at a job interview at BEA!!!! I know their chief architect and he is rabid about how much less time it takes to write Java code than C++ because there are so many fewer bugs! Python is definitely coming on strong, but its going to suffer because so much code is being written in Java, and while you can certainly plug-n-play multiple languages (much more easily in the Java world than in MSVisStudio!), most development managers hate it because you end up having to have programmers in both languages which causes all kinds of havoc with managing teams. It took some time for the C/C++/Java progression to happen, so I don't discount Python at all, but people who program in both Java and Python are going to be much more hireable than those who insist that Python is better and don't bother to become proficient in Java....

the only comparison you can make there is C, not much else, Python is not that weakly typed...Python is very much dynamically typed, has modules, classes, exceptions. Its easy to write modules for, both in Python and C/C++, I'd say that no other language is quite like it really, oh and it is as platform independent as Java, actually if not more, so...
OOOooff! You way misunderstood me! I was literally talking about hitting keys! Typing more characters! Using "begin" "end" in pascal versus optional "{ }"...

As an old time C hacker, I sure like being able to pass doubles as longs and cast different typedefs on the same block of memory! Also, be sure to distinguish strong/weak typing from early/late binding which are completely different issues. I've learned to like strong typing, but late binding is sure a time saver!

 

Happy hacking!

Buffy

Link to comment
Share on other sites

Nah, you can program anything in anything if you're any good! You may have to write a lot more code in some cases, but usually only for very bizarre language features

its hard to write code like the <ugly code deleted> in python, no matter how good you are, its close to impossible to obfuscate...

...Python is better and don't bother to become proficient in Java

noone ever said that you should not be profficient in Java if you are applying for a job as a java programmer, but its like this though, who is more likely to get hired, a guy who's been programming in Java for 10 years, or a guy who is profficient in both Java and Python, been programming for only 5?

You way misunderstood me!
as always i thought you were a little missleading, especially about hacking, i know that you are a very good programmer, its just this line:
On the other hand, if all you're gonna do is hack web pages, maybe I'll agree with you...

and by the way, what does hacking webpages have to do with anything? you are better off hacking webpages in PHP than Python :)

MSVisStudio

<*shivers and runs away from the screen screaming*>

if there is anything more I hate than the black box of Java, that would be the black hole of MS...

Dont get me wrong, i LOVE Sun, they are awesome, and java isnt half bad, it just needs open-sourcing...

Link to comment
Share on other sites

Heh, heh! I knew I'd get some good stuff out of you on this thread alexander! Honest, I'm getting to like Python, I just can't use it much yet! I've learned to live with Java simply because its got lots of platform and libarary and infrastructure support (esp. EJB app server stuff). I still miss multiple inheritance and the few syntax changes that trip me up from too many years with C/C++...but I'm happy to pay money for "proprietary" stuff (and as we discussed some time ago, I don't think that those last few bits of Java there are hurt it at all), as long as it works well....

 

Cheers,

Buffy

Link to comment
Share on other sites

Heh, heh! I knew I'd get some good stuff out of you on this thread alexander! Honest, I'm getting to like Python, I just can't use it much yet! I've learned to live with Java simply because its got lots of platform and libarary and infrastructure support (esp. EJB app server stuff). I still miss multiple inheritance and the few syntax changes that trip me up from too many years with C/C++...but I'm happy to pay money for "proprietary" stuff (and as we discussed some time ago, I don't think that those last few bits of Java there are hurt it at all), as long as it works well....

 

Cheers,

Buffy

 

I've recently (well, in the past 4 years at least) done most work in java, there are things that are annoying about it (no templates, no type safe enumeration) but they have added these things in version 1.5, so I'm pretty happy with it, I still try to get any work in C or C++ that I can though. Recently I had a contract to convert a bunch of huge PL/I programs using DB2 on mainframes to C (no, not C++, just plain old C) on unix using oracle. I don't know why they wanted to convert from a great grandfather language to a grandfather language, but I was just happy to get to do some real programming work again. You know, having to write your own data structures algorithms and things like that.

Link to comment
Share on other sites

You do save a line or two, but saying one is harder to understand is purely personal preference.

void proc(){
type a, b, c.....;
bool bFlag = true;
 //stuff
 if(bungalow){
    //more_stuff
    if(pteranosaurus){
       //even_more_stuff
       while(ice_cubes){
          //still_more_stuff
          if(hockey_stick){
             //yet_more_stuff
             for(i=0; i<99999; i++){
                //gettin'_there
                if(viper's_tongue){
                   bFlag = false;
                   break;
                }
             }
             if(bFlag){
                //more_ghastly_stuff
                do{
                   //still_at_it
                   if(relief){
                      //might_make_it
                   }
                   //some_day
                }while(hockey_puck);
                //even_ghastlier_stuff
             }
          }
          if(bFlag)break;
          //still_sweatin'
       }
       if(bFlag){
          //gettin'_by
       }
    }
    if(bFlag){
       //groan...
       for(another_few_years){
          //keep_at_it
          if(you're_still_alive){
             //is_it_worth_it?
          }else{
             //life's_hard
             while(we're_at_it){
                //life's_tough
             }
             //killing_yourself_to_live
          }
          //light_at_the_end_of_the_tunnel
       }
       //OMG
    }
 }else{
    //another_little_algorithm
 }
 //here_we_are
 while(down_hill){
    //phew!!!
    if(chocolate_cake){
       //yum
    }
    //at_least_that_wasn't_bad!
 }
 //und_so_wieder
}

Where do you have to go if viper's_tongue?

 

Suppose, now, that if viper's_tongue you must goto another_little_algorithm and work out how the code would have to be, without repetition. :)

 

I can understand if compiler writers actually hate gotos, especially as variables may be declared inside blocks, but if you're paid to do a job and you'd like to leave part of it up to who you're doing it for, they might want to pay you a bit less. I don't find trouble wit optimizing, goto can be even good for it.

 

OTOH, I can tell you that properly designed and implemented program architectures get majorly munged by constant hacking. I'd argue that actually that IS the major problem with Windows: it has been hacked to death. There's a really good argument that you need to have formal design reviews and code walkthroughs and enforce coding practices in order to avoid unmaintainable systems, so hacking will only take you so far.
That depends on the meaning of the word 'hacking'. If it means programming with lack of criteria then you're right, but usually hacker means a more deft programmer. When doing serious stuff, a good hacker does it well.

 

and while you can certainly plug-n-play multiple languages (much more easily in the Java world than in MSVisStudio!)
I've tried JNI to see how to use it. I'm glad it's there but it's horrendous! It isn't even object oriented and the Gurus dissapprove of it being used for anything but API type stuff. When I tried JNI's invocation API I only succeded with a 1.1 JVM, with 1.4 I kept getting the return code for UNKOWN_ERROR. CORBA is a totally different thing, it's concieved for remoting and thus has it's overhead.

 

I know their chief architect and he is rabid about how much less time it takes to write Java code than C++ because there are so many fewer bugs!
Apart from libraries, I can only think of built-in reference counting. Laziness! :) And Ra should at least give a bit more control over it.

 

As an old time C hacker, I sure like being able to pass doubles as longs and cast different typedefs on the same block of memory!
&
I still miss multiple inheritance and the few syntax changes that trip me up from too many years with C/C++...
Now you're talking!!! :) There are various things that Ra arrogantly prohibits, where C just gives a warning. Free choice = responsibilty. I agree too about enums and other things that Coffee lacks.

 

I've learned to live with Java simply because its got lots of platform and libarary and infrastructure support (esp. EJB app server stuff).
This is an advantage but it isn't the actual language, just like the availability of many other stuff offered for re-use. JDK is certainly handier than Win32 and MFC but it does have it's own shortcomings.
Link to comment
Share on other sites

platform and libarary and infrastructure support

but can you include C libraries within Java programs?

Seriously though, dont get me wrong, there are fewer things that i hate about Java than before 1.5, but its still a black box, there are still a few things related to not keeping all standards as they should, and i still think that if you code something in Java, you are better off coding it in C++ and using gcc based compilers on any system to get your program running on every platform (gcc - linux, sun, mac, unix..., dev-c++ - windows). If they open-sourced it though, hackers will fix up a few things, here and there, and then i think it could be a very very decent language :)

I still miss multiple inheritance and the few syntax changes that trip me up from too many years with C/C++

I am waiting for the first scripting language to actually do this...

Link to comment
Share on other sites

I usually use C++ for any little programs that I write and only use Java when I am told that I have to by management. I am a lot happier with java since 1.5, but for me to be totally happy they would need to add the ability to deallocate memory on demand and have the ability to build native executables. I'm sure that neither of these will ever be implemented though and probably should not be implemented either. I don't think sun is too far away from open-sourcing java either.

Link to comment
Share on other sites

Does gcc include a cross-platform library for GUIs and the rest Alex?

 

I've worked with JDK 1.4, I have yet to touch 1.5, in any case Coffee is HEAVY. They say, compensate with faster proc, server-side load dist and the like. Run a Swing GUI app that does a bit of processing and there will always be those relapses when you can say oh, well, time for coffee break, must be the reason they chose the name. When using a sophisticated IDE it often happens just when you're anxious to try the nth idea that might finally be the answer to the hitch.

 

Rocky, many IDEs give a handy command to compile your code to true machine code but the calls to the JDK or any libs imported will still be going to them through JNI. Ergo speed doesn't always improve much, you can still get that garbageman going for a walk and so on...

 

In a C++ class member function you can write delete this!!! :xx: Don't use non-static members after it gets executed.

 

More choice in declarations, more expressions have l-value...

Link to comment
Share on other sites

... and have the ability to build native executables. I'm sure that neither of these will ever be implemented though and probably should not be implemented either. I don't think sun is too far away from open-sourcing java either.

 

Well, one of the main reasons that i really love scripting languages is because it makes you share the code with whoever you send the program to. I rarely ever run someone elses programs without at least glimpsing through their code to make sure that they are not trying to pull a fast one on me, even when i execute obfuscated code projects...

 

Sun has had a major movement to open-source lately, I really admire them for it, maybe it is because they have realised that they need to appeal to open-source community so when the big eneterprises run spark servers, they do not switch the OS (since linux runs better (faster and more efficiently) on Spark then Solaris does), and if they need to can customise or fix up Solaris for whatever application they need themselves... maybe not only that, but i think that it could be one of the reasons, hope so anyways...

 

I've worked with JDK 1.4

I prefer Blackdown Java over Suns for now and i recomend you to switch too, its open...

Link to comment
Share on other sites

Does gcc include a cross-platform library for GUIs and the rest Alex?

basic system libraries have been standardized (iostream, fstream, math, vector, socket etc...) but the more system OS oriented ones have not, mainly because of the differences in OpenGL and DirectX as well as X window servers. What you can do is check for the OS and depending on that create a similar GUI either via WTL (windows template lib, its up to what 7.1, shared source lisencing, probably the way to go) or GTK2 (this one is extremely cool, thought through and powerful, a lot of tutorials on how to use it, as well as mods for perl, python, ruby and just about any other language in Linux (maybe with exclusion of Lisp)). (thats the only thing that i can think of doing when it comes to GUIs, well you can actually pass DirectX or OpenGL calls, but thats pretty complicated)

Link to comment
Share on other sites

Well, "delete this" has it's uses, such as cleaning up memory used by a singleton when you don't need it anymore.
Also when a reference count decrements to 0, such as in the typical implementation of COM's IUnknown::release().
Link to comment
Share on other sites

is that the PDA software developer that created Palm OS?
As well as on Palm OS, if I remember correctly, it can be used on a few other embedded platforms. It was more than a year ago I started a brief evaluation for a customer project but then I was assigned other stuff. Perhaps Waba was done by them, I remember SuperWaba being done by some Brazilian folk.
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...