40

Been reviewing ALOT of client code and supplier’s lately. I just want to sit in the corner and cry.

Somewhere along the line the education system has failed a generation of software engineers.

I am an embedded c programmer, so I’m pretty low level but I have worked up and down and across the abstractions in the industry. The high level guys I think don’t make these same mistakes due to the stuff they learn in CS courses regarding OOD.. in reference how to properly architect software in a modular way.

I think it may be that too often the embedded software is written by EEs and not CEs, and due to their curriculum they lack good software architecture design.

Too often I will see huge functions with large blocks of copy pasted code with only difference being a variable name. All stuff that can be turned into tables and iterated thru so the function can be less than 20 lines long in the end which is like a 200% improvement when the function started out as 2000 lines because they decided to hard code everything and not let the code and processor do what it’s good at.

Arguments of performance are moot at this point, I’m well aware of constraints and this is not one of them that is affected.

The problem I have is the trying to take their code in and understand what’s its trying todo, and todo that you must scan up and down HUGE sections of the code, even 10k+ of line in one file because their design was not to even use multiple files!

Does their code function yes .. does it work? Yes.. the problem is readability, maintainability. Completely non existent.

I see it soo often I almost begin to second guess my self and think .. am I the crazy one here? No. And it’s not their fault, it’s the education system. They weren’t taught it so they think this is just what programmers do.. hugely mundane copy paste of words and change a little things here and there and done. NO actual software engineers architecture systems and write code in a way so they do it in the most laziest, way possible. Not how these folks do it.. it’s like all they know are if statements and switch statements and everything else is unneeded.. fuck structures and shit just hard code it all... explicitly write everything let’s not be smart about anything.

I know I’ve said it before but with covid and winning so much more buisness did to competition going under I never got around to doing my YouTube channel and web series of how I believe software should be taught across the board.. it’s more than just syntax it’s a way of thinking.. a specific way of architecting any software embedded or high level.

Anyway rant off had to get that off my chest, literally want to sit in the corner and cry this weekend at the horrible code I’m reviewing and it just constantly keeps happening. Over and over and over. The more people I bring on or acquire projects it’s like fuck me wtf is this shit!!! Take some pride in the code you write!

Comments
  • 11
    I've always wondered what embedded land is like.

    I once supported a product where they wanted to give users some scripting ability.

    So we're talking about this new feature at a meeting and the obvious gets asked about what limitations and etc there are.

    They knew nothing... they just copy and pasted a JavaScript VM in and it just ran ... that's it.

    Eat up all the memory "well yeah it will crash"... do anything that makes JS crash ... "well yeah it will crash..."

    :O
  • 9
    For the longest time I thought EE people were optimization conscious and like conscious of performance and program size... where CS people don’t know anything about the low level and just write whatever code..

    Now I believe the CS people are more conscious they are just writing soo much code they need more ram etc

    Where the EE folks, are conscious but lacking knowledge in general. EE hard code everything thinking they are doing the correct things equating cognitive simplicity to program size, vs doing it correctly in less lines.. for some reason either don’t believe it’s smaller, or possible, or think there is some disadvantages.

    EEs need to stay away from code and CE need more CS knowledge.
  • 8
    @QuanticoCEO

    I think you see it in every sort of corner case industry area where the given area is sort of cloistered off on its own. The wheel gets reinvented, albeit slowly, they go down wonky paths and sort of get left behind.

    Nobody else shows up because they're not EE or in that given special embedded ecosystem.

    Then once in a while some folks wander along and are horrified when they find the lost tribe of coding ....
  • 6
    My manager had the misfortune to review C++ low level code from a Romanian firm the company I worked at acquired. Of course nobody had the decency to review it before putting a price on it.

    It was so fucking awful I legit cried laughing. I wish I could legally post it so you guys could see how ungodly this piece of satanic trash is. My colleague called it humanly obfuscated code.
  • 2
    @QuanticoCEO EE is just too vast of a field to be honest. You just become a generalist and are not good in anything unless you get into an university that branches to more specific fields. There is too much shit crammed in a single field.

    Though EE is very useful for high speed embedded design and understanding how the hardware behaves, because you have the knowledge to understand it. Just need more software engineering courses and the need to understand how to test is a must.
  • 1
    @PepeTheFrog I fully understand that but EEs seem to be the ones writing all the embedded code.. there are some CEs in the mix but majority of EE folks.. we need more CS focused folks writing the code at a lower level because CS knows how to architect the systems where EEs and majority of CEs that I’ve worked with like to hardcore everything
  • 3
    Wait until you see physicist code, that's a category of its own. ^^

    But yeah, being EE myself, we didn't have much about SW dev at uni. You have to put serious work into learning that.

    On the other hand, the problem with CS folks is that they lack understanding of real hardware (especially after Java hit the unis), and I don't just mean computer hardware. Systems engineering also involves a lot of control theory and stuff, and EE does deal with that.

    Plus that you need to reign CS folks in sometimes because they have a tendency to go overboard with layers (not the useful ones as in "OSI model") until they abstract reality away. Five years down the road, nobody understands that, and the solution is to slap another layer on it to abstract yesterday's shit away.

    Ideally, you'd have a team of CS and EE folks. That's rare because you introduce additional communication overhead, hence cost, which many companies don't want to pay because tech debt is both hidden and long-term.
  • 0
    Oh, and don't even get me started on what I've seen from Indian CS folks who often don't seem to know that you can have procedures other than void-void type. Copy/paste a function, rename it, change one line, done. What, you could hand over a parameter to control that line?
  • 2
    "And it’s not their fault, it’s the education system. They weren’t taught it so they think this is just what programmers do.. hugely mundane copy paste of words and change a little things here and there and done."

    On this, I strongly disagree. Yes, the education system is failing our profession sadly often, BUT it is also their fault that they haven't learned it.

    I wasn't taught that, and I learned it. I wasn't taught any of this, I learned it on my own. So they could have too. The only thing required was to be interested enough in improving to have the revolutionary thought/question of "Surely there must be a better way...?" and to go and find answer(s) to that question.

    The problem isn't that they weren't taught it.
    The problem is that they weren't taught it, AND they didn't bother to think about it enough to learn it without waiting for/having to being proactively taught it..
  • 1
    I've seen EE people dabble in programming. It's not pretty they know just enough to build some logic that is not in electronics.

    I've also seen some from robotics field and did educate themselves well. That is a world of difference.

    As for performance optimisation by copy paste. Never in a language that supports macros or inline functions. This is like all of them if you need optimisation at that level beyond what a compiler is capable of.

    Nice rant have some 👁️🛢️
  • 0
    You keep mentioning the "education system".

    Are you sure they have been educated? Aren't they a breed of self-taught programmers?
  • 4
    @netikras well I went to college but dropped out, as I wasn’t learning I hadn’t already learned on my own prior to high school, I’ve been writing software since I was 12, mainly embedded stuff I’m in my 30s now.

    These people all have degrees, writing code the way I would write when I was around 16.
  • 1
    I've seen some stuff. It made me think about the same thing.

    There are EE and AE people who do really understand good software architecture. How many CE people there are that have a clue about EE, or even an interest in it?

    For me, learning clean code has been a matter of self-learning and learning while working. I'd like to think that I'm usually not writing the kind of code you're talking about.
  • 1
    @QuanticoCEO At EE school its mostly electronics stuff, not much software. You really have to specialize into that field in order to produce useable stuff. And when its software, its either VHDL, Assembly, or C. High level languages? What are those?
  • 0
    @JFK422 okay for reference I fully understand what EE school entails... my problem is those EEs are writing code, now either that is because they can’t get CEs or CS intrested or is the EEs think they know how to code because they can write some if and switch statements and get something to function.. idk.

    But architecture wise makeing 1000 lines switch statements and nesting ifs within that and all this shit like 10 ifs deep sometimes longer, and so much repeated code they never stop and think hmmm there’s probably a more efficient way of doing this..

    Then I am passed the code to help fix it or improve it and I’m just like wtf...
  • 0
    "I think don’t make these same mistakes due to the stuff they learn in CS courses regarding OOD.. in reference how to properly architect software in a modular way."
    I wish it would be true :)
Add Comment