Electronics > Beginners
what is the most relevant programming language for ee?
GregDunn:
--- 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.
Crazy_Pete:
Just an aside, Java (despite the ignorance of those who wrote it) is not an OO language. The level of encapsulation in Java is the Package, not the class. Java was written by a guy who didn't understand the difference the in the first place and that has led to some weird java code.
That doesn't mean Java is a "bad" language or that you shouldn't use it. In fact just as MOST programming is best done procedurally, a whole lot of code on top of that is best written using a package oriented language. OOP really shines in highly complex programs or in very small programs that must be done with a minimum of footprint (like in MCUs.)
Xi Xi
Crazy Pete
FrankBuss:
--- Quote from: Crazy_Pete on November 06, 2018, 05:29:04 am ---Just an aside, Java (despite the ignorance of those who wrote it) is not an OO language. The level of encapsulation in Java is the Package, not the class. Java was written by a guy who didn't understand the difference the in the first place and that has led to some weird java code.
--- End quote ---
Java has classes, which can be derived, have methods and member variables, polymorphism etc., and Java classes encapsulates members and methods if declared private (unless you access them with reflection, but this would be similar in C++ with direct memory access). Why do you say it is not object oriented?
Crazy_Pete:
>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.
In the semantics of Computer Science (with your permission of course, since this is a semantic argument anyway) that makes Java a package oriented language not an object oriented language. Although that is a semantic difference, it makes Java fill a real large niche. There are plenty of problems that are not complex enough to justify an object oriented language but too complex to use a procedural language. The popular term for languages like Java back in the previous century was "Object Based." Object Based languages (like Java) remain hugely popular simply because they are the best solution for a very large problem space. The sad thing is most people aren't educated enough to know the difference between Procedural - Object Based - Object Oriented - Functional Programming and don't know which tool to use.
I am going to get flamed for this so i won't mention any specific libs but if you look at some of the more popular Java GUI frameworks, you will see this "Package Oriented" programming being used in a very powerful way. (In GUI programming it is easier to simply give related window frames access to each other's internals rather than writing messenger / collaborator classes to transfer that information the way you would in an OO language.)
Thanks All
Crazy Pete
Nusa:
--- Quote from: Crazy_Pete on November 06, 2018, 05:02:57 am ---THIS is exactly why you should learn C++ and not learn C. If you learn C you will find it impossible to learn C++ and waste time complaining about those who can. If you learn C++ first you will not only have a more agile and open mind, but you will also be a better C programmer.
--- End quote ---
You're entitled to your opinion, but I don't agree that there's only one best path to follow. Best for you, perhaps, but not best for everyone.
My own path shows my age. I was actively using assembly, Fortran, Pascal and some others before C existed, I learned C before C++ existed, and yet I had no trouble grasping the fundamentals of C++. Perhaps it's because the last 30 years of bloat hadn't been added yet, and I could deal with that as it happened rather than being overwhelmed with it all at once.
As for editors, learn at least the basics of "vi". Simply because the editor is going to exist on nearly any non-windows system you walk up to, which means you can function on that system.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version