| Electronics > Beginners |
| what is the most relevant programming language for ee? |
| << < (18/21) > >> |
| hendorog:
--- Quote from: GregDunn on November 06, 2018, 05:21:39 am --- --- Quote from: Crazy_Pete on November 06, 2018, 05:02:57 am ---I didn't say I shouldn't use them, i said you shouldn't use them if you don't like them. The fact that you find it distasteful to maintain code that you never learnt to write in the first place is not an argument for not learning in the first place. --- End quote --- This is why, when we were essentially forced to use Java for our software, I wrote it as though it was C. I spent 16 years working with Java, and every time I declined to use the bloated, spaghetti-like coding style encouraged by Java mavens, I ended up with a simpler, easier to read program that tended to work first time. The main thing wrong with OOP is that the proponents want to write it as though everything has to be an object - and that's not the case. In many (most) cases, this just obfuscates the program and makes it harder to add to or update it. Not to mention dragging in megabytes of libraries whether you need them or not. Slapdash, lazy coding in C++ and Java is a big reason why code tended to get bigger and slower with every generation following C. In the 1980s we wrote a skeleton operating system and three shared memory multiprocessing applications for a radar controller in less than a megabyte of code - running on a 5 MHz 8086. Pretty much every "standalone" Java application I worked with 10 years later was bigger than that, despite it all being boiled down to interpreted byte code instead of compiled machine code. And needed a GHz-class CPU to execute it at a reasonable speed. --- End quote --- I recall working on a C program written by a old and clever fellow who of course knew C was the dogs bollocks and of course I was a complete idiot as I wanted to use more modern stuff. This guy wrote the program and a few of us were given the heady task of typing it in for him. This was a busy Friday night at a decent sized international airport and I had dropped in to drop something off or some very minor thing or other. Anyway I just happened to notice on the UI of the baggage handling controller (this guy wrote) connecting and disconnecting repeatedly to the PLC. This was bad as this program had to respond to the PLC with a destination lateral for the bag to be diverted to, and it had to do it pretty quickly. If the bag didn't get a destination then it went to a manual encode station, and since this was Friday night it was busy and that guy would get swamped pretty quickly. Being young, dumb and ignorant to the ways of the clipboard wielding twats of the world I thought I'd try and fix it. As it happened I had snuck a copy of Boundschecker on the machine and had a brainwave to set a memory breakpoint on the PLC connection byte in the data structure. Shutdown the system - it was already screwed - restarted it under Boundschecker and setup the breakpoint. Sure enough there was a memory overwrite from the prior byte and it was flipping the PLC connection byte on and off. Quickly I found the culprit in the code, fixed it and restarted. PLC connection was holding solid now and life was good. Apart from the sudden storming for the control room by 3 or 4 pissed off baggage handlers asking what the fuck I was doing and demanding to know why I was diverting all of the bags to manual encode. I muttered something about bad data and its working now, and beat a hasty retreat. So yeah, in summary, C might rock your world, but you may change your mind after being reamed by a few large baggage handlers on a Friday night. |
| Crazy_Pete:
You are entitled to your opinion too. Of course EVERY C programmer i have ever met never was able to make the jump to C++, they simply didn't know how to use the language. And everyone of them said the same thing. "Well i am proof that your path is not for everyone because i started out in C and i obviously have no trouble with C++." People who are born blind don't really know what it means to "see". :-) Honestly though i think you are on the right track. For starts the "Everything is an Object" is ridiculous and is why C++ is so powerful, everything is NOT an object. Xi Xi Crazy Pete |
| FrankBuss:
--- Quote from: Crazy_Pete on November 06, 2018, 06:11:32 am --- >Why do you say it is not object oriented? Perhaps because i am an idiot? :-) Honestly the last time i looked at Java was in a previous century. Java may have changed its standard to be an Object Oriented Language after all. The last time i looked at java, the level of encapsulation was at the package, not the class. That is a protected Java member can be seen by OTHER members of it's Package, not just by members of it's Class or it's Descendant Classes. --- End quote --- This hasn't change since the first 1.0 Java Language Specification. There was always classes with private members. I know this, because I wrote a Java book 20 years ago :) You are right, "protected" means other classes in the same package can see it as well: https://docs.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html Note that if you don't write any modifier, it can be seen by other classes in the same package, but not by derived classes. I'm not sure if this is very useful. |
| bd139:
I’ve seen some crazy shit in my time but this thread has gone full slashdot. Java not OO, C# because Microsoft couldn’t write a C++ compiler? :palm: Corrections: 1. Java is and always was OO. 2. Microsoft provide a pretty good C++ compiler. When they kicked off .net it was pretty good too. 3. C# exists because there needed to be a higher level OO language for non systems programming. On the last point, java/c# tend to hold a lot of the non systems programming type industries together and they are the only language platforms that you can scale to the size of problem domain due to the introspection support by IDEs and analysis tools. Also java was written in C :-DD |
| Crazy_Pete:
Er you may find it "Silly" but nothing you say refutes these points in any way. No Java is not an OO language for the reasons i stated. It is an object BASED language. That is actually a strength of the language when used properly. C++ is an object ORIENTED language and that is a strength of the language when used properly. Yes Java was written in C, yes Microsoft gave up on C++ and came out with C# because their C++ compiler was such a POS. These are all facts. Have you anything other than an emotional response to refute it? OK you think it is silly, so do i. Today, 30 years after the fact, Microsoft may write a "pretty good" C++ compiler, i'll never know nor care. They obviously wrote C# because back in 2001 they couldn't even come close to a C++ compiler. As a member of the ISO C++ standards committee said 18 years ago to a microsoft rep: "What you are calling a C++ compiler simply doesn't compile C++". Then they came out with C#. Failing technically and then saying "Oh wait, we MEANT to do that, here it's a new standard" has been Microsoft's MO since day one. Good lord i cannot believe i am getting dragged down into all this simply because i offered to help my Mothers son. (Hatokay) Sheesh :-) Xi Xi Crazy Pete |
| Navigation |
| Message Index |
| Next page |
| Previous page |