Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
FlapYoJacks
Feb 12, 2009
I love my job, I really do. Everybody get's along, I am 3~ months in and already have the engineering department on board with me becoming lead architect of the rewrite of our product.
That being said; I am just in a stop gap right now of fixing some very old, very lovely code to the point where we can release it and then move on to the new hotness, and it's during that stop gap that I get to see the sheer volume of obscured code that well, 90% of the time works fine and isn't exactly a horror, but it's still not great, well organized, or designed very well.

There are some legitimate coding horrors in the pile of code I have ran upon, but for the most part it's all been fairly OK.

But hey, at least I have put everybody on MS Project. We tried a bunch of other programs (both web based and desktop based) and Project with Project server is the only one that works for everybody.

Before that they had no project management at all! :unsmith:

Adbot
ADBOT LOVES YOU

FlapYoJacks
Feb 12, 2009

ChickenWing posted:

I acutally was recently upgraded to a 6-core@3.4ghz Xeon machine with 32GB RAM and a 256GB SSD

That was from a much worse machine with like a 4-core@2ghz Xeon with 4gb RAM. I had to expedite the upgrade because I got moved to a new project and the server application wouldn't start due to lack of free memory.

What's up Xeon/32GB/SSD buddy. :smug:

I have the exact same setup except a 500gb ssd. :smug:

FlapYoJacks
Feb 12, 2009
The gigantic project I am working on had no automated test API's. I finally said gently caress it and started writing them. :smithicide:

FlapYoJacks
Feb 12, 2009

Volmarias posted:

I cannot imagine the level of fuckery involved in writing unit tests for embedded C stuff.

I'm a embedded Linux engineer; so it's not that hard. :v:

FlapYoJacks
Feb 12, 2009

Volmarias posted:

I mean more the excitingly unpredictable nature of your compiler, etc

Oh! I haven't had too many issues yet with compilers. Every once in a while I will run into union tom-foolary, but that's usually with TI DSP bullshit.

FlapYoJacks
Feb 12, 2009
What is wrong with gant charts and a simple research -> implementation setup?

Why do companies think they need to reinvent everything?

FlapYoJacks
Feb 12, 2009

Bruegels Fuckbooks posted:

Gantt charts are useless because nobody really knows how long stuff is going to take to implement past a couple of weeks - the chart is also evidence that you don't know what you're talking about because the dates it shows are incorrect. Now if you start calling two weeks periods "sprints" and story points "days", and get rid of the chart, you don't have to move the bars in microsoft project anymore - this saves the project manager time that can be spent doing something more useless like calling useless meetings or drinking.

This makes sense, because I do a lot of project management and I want to call useless meetings WHILE drinking a lot more than I do; however I turn everything into tiny bite sized chunks and make a Gantt chart instead. :smith:

FlapYoJacks
Feb 12, 2009
Now just get into embedded Linux kernel development. :getin:

Once you do you get a free dog collar and nipple clamps!

FlapYoJacks
Feb 12, 2009
I am in charge of a new project that is upgrading our old product + RTOS into a new board + Linux.

The first question I had was "Where are the cad schematics."
The first answer I got was "We don't have those and the people we contracted out to never made them/don't have them."

:negative:

FlapYoJacks
Feb 12, 2009

Ithaqua posted:

This is awful and wrong. Do either of you go to meetings? Do you use the bathroom? Do you take breaks?

Assuming that a developer works on specific assigned tasks for 8 hours out of every day is insane. Put real estimates on tasks, don't try to make everything total 160 hours.

Adding to this: If you think it will take 160 hours, double it.

FlapYoJacks
Feb 12, 2009

Illegal Move posted:

In case anybody is interested, this is the e-mail we get at my office when we haven't logged 8 hours every day:



(this is then followed by a list of the people who didn't log all their hours)

Holy poo poo I would just put "lol" in the missing fields.

Thank god I'm WFH and Salaried. I gently caress off for around 2 hours a day, but am more productive at home than when I am at the office.

FlapYoJacks
Feb 12, 2009

MisterZimbu posted:

I think we need to implement code reviews for the solely so the other developers will spell their class/file names correctly and tab poo poo in consistently.

God drat.

Spelling sure, but why not pump the code through a auto-formatter?

FlapYoJacks
Feb 12, 2009

Infinotize posted:

We have one of these and I cannot comprehend why we want to pay someone vast sums to read wikipedia articles to us.

Seems like we are in the wrong business!

FlapYoJacks
Feb 12, 2009
What in the gently caress? Why aren't they using git like the rest of the same world?

FlapYoJacks
Feb 12, 2009
Awesome stuff I am architecting right now:

I am currently working on the new generation of products for my company, and they will all be running embedded Linux. I was able to convince management to let me take a extra two months to integrate a complete HAL layer into the Linux Kernel pertaining to our hardware that will work in conjunction with our future DTB files. This will allow us to have a single build among all of our new products going into the next generation, and it's going to be awesome.

FlapYoJacks
Feb 12, 2009
Slack is the best solution I have found so far for business chat.

FlapYoJacks
Feb 12, 2009
I am working on a new product and we are using the wandboard as our development platform.

I spend 30+ hours trying to figure out why i2c wasn't working properly.

Their dts file for the imx6 solo variant has:

C code:
compatible = "wand,imx6dl-wandboard", "fsl,imx6dl"; 
instead of

C code:
compatible = "fsl,imx6dl-wandboard", "fsl,imx6dl";
:suicide:

FlapYoJacks
Feb 12, 2009
The sheer amount of programmers that program in C/C++ that have absolutely no idea how memory works is mind loving boggling to me. :psyduck:

FlapYoJacks
Feb 12, 2009

Munkeymon posted:

How do you mean? Like they don't think/care about cache optimization or what?

Like, they don't understand you have to free memory that you allocate. That there are efficient ways to use memory. God help you if you try to mention stack vs heap.

FlapYoJacks
Feb 12, 2009

Rocko Bonaparte posted:

Ahh but do they at least try to initialize or write to it before they read and make decisions off of it? That's progress!

That IS true!

Volmarias posted:

Dehumanize yourself and face towards embedded programming

Even worse; I do embedded Linux programming. :gonk:

FlapYoJacks
Feb 12, 2009

necrobobsledder posted:

Let me take a wild guess - your coworkers are mechanical or electrical engineers originally?

Web programmers. :smith:

FlapYoJacks
Feb 12, 2009

Munkeymon posted:

Oh right - you're the guy in the secfuck thread who talks about trying to make actually secure embedded linux products. Goonspeed

That's me! It's possible; it's just that the entire embedded Linux industry doesn't give a poo poo about security because the entire industry came from RtOS land where they had "security" through obscurity.

Pollyanna posted:

I'm so sorry.

Thank you. :smith:

FlapYoJacks
Feb 12, 2009
My programming career starting out really odd. I was the "Linux guy" to my best friend.

I hadn't used Linux in about 6 years, and my friend was working for a tiny 3 man company that sold engineering services specializing in RtOS development. I had no programming experience nor engineering experience and never applied at his work; however one day he called me out of the blue and said "Hey, we need a Linux guy, we just inherited a project and it runs off of Linux and I don't know anybody! It will be just for a few weeks, can you help?"

Well, I was unemployed and a extra grand was all the money in the world to me. Those "few" weeks turned into 6 years as I was thrown into the land of embedded Linux and kernel code. My former boss who has been doing board layout/coding/electrical engineering for over 30 years decided that I had a knack at programming and decided to mentor me in C/C++ and good programming habits.

For 6 years he taught me as much as he could, and thanks to him I have a career. Even after his business fell apart and I had to move to Michigan, I was able to get him contract work at my new place for board layout/firmware programming, same with my best friend who introduced me to him. It's weird how things turn out in life, and I thank my lucky stars every day at how things fell into place. I basically got paid to have a 1 on 1 education with a highly skilled EE for 6 years.

FlapYoJacks
Feb 12, 2009
libsepol uses <sys/cdefs.h> :suicide:

I sent a patch upstream to fix it, but Jesus Christ, why are they using internal c library headers?

FlapYoJacks
Feb 12, 2009
Replacement for me is at training until next week and I was asked to go back to my old project and work on a importer.

I spent all day yesterday setting poo poo up again to actually work on the old project. Super productive!

FlapYoJacks
Feb 12, 2009
I usually goof off about an hour per day, there have been a lot of studies that show after 35 hours your productivity goes to poo poo.

FlapYoJacks
Feb 12, 2009

Slash posted:

actual requirements

lmbo

FlapYoJacks
Feb 12, 2009

Rocko Bonaparte posted:

Somebody already posted the book, so I'll just post some anecdotes from having to do literally the same thing--refactor lovely EE code--for a living:
1. Get all that stuff in good source control. I say it because EE trash heaps usually aren't, so I assume nothing. Being able to easily create throwaway branches in git will make it less intimidating to mess with it.
2. Also start to get some unit and integration tests in there so you can start to reign in the whack-a-mole game you'll inevitably play.
3. Encapsulate the globals before you try to deal with any objects that are in there. The data flow problem of getting that global state passed around will drive most of your refactoring decisions.
4. It will probably also help to review and revise the entire source layout of the project.
5. If there was any prior source control, try to get all the binaries out of it. I had a 16GB subversion project inflate to 48+GB when migrated to git, and then collapsed to 20MB after rewriting out all the binaries in the history.
6. Consider added a usage statistics agent for marking code paths that actually aren't dead. You might be afraid to flatten some code because something might use it, but you don't have proof. So put a phone-home call in there that goes somewhere that you can find a report of it. Put another line in the normal path. If after some time in the next release, you see the normal path but not the dead path, then you can assume the risk of killing the dead stuff. If you get no usage information, you know that mechanism is not working.
7. The good news is that most of the refactoring is collapsing ten-page-long if/else clauses that have 95% of the same code in them.
8. When people give you poo poo about it, tell them you're "adding functionality by removing code."
9. Rest assured that any incomprehensible math you see was probably done either from iterative guessing and/or poor notions of premature optimization, and listen to the voice in your head. At the least, you can encapsulate the mathematical model and write unit tests against it to verify that a revised model computes the same.
10. If you are second-guessing why they didn't use a function/method native to whatever language they're using, it's because that isn't native to the basic C code they learned in that one semester of C crap they might have gotten in college. They just didn't know about it and it's probably safe to use the library.
11. There's also a good chance that the parts that are very EE-centric and out of your domain of expertise are also poo poo and you shouldn't second-guess yourself with them. Good EE's are fully capable of writing clean code. It took me years to figure out most of the EEs I was working with couldn't even do core EE stuff. Meanwhile, the ones that could write this stuff cleanly are now your best friends at work. So don't paint with a broad brush--like I just did.
12. Watch out for version 2.0 syndrome after you comprehend the code base and know enough to blow it all up and start over. The 2.0 may end up taking far too long and discredit you.

This is all excellent advice.


I have inhereted several messes, and not once has "rebuilding it from scratch" worked.

In addition to doing what he said above, I also have started doing this:

1) Start writing unit tests for EVERYTHING, I mean it, EVER SINGLE THING you can find.

2) Start refactoring code little by little. Eventually it will start to look good.

3) Get a automated test server. I like gitlab runner personally, and use it all the time.

FlapYoJacks
Feb 12, 2009
I spent an entire day trying to figure out why a script I made for customer service for a huge order wasn't working.

I had smashed a )) instead of ) into a config file. :suicide:

FlapYoJacks
Feb 12, 2009

Portland Sucks posted:

Great timing. I've been working on #7 for the last day and its enough to literally give me iterative nightmares. I talked to my boss about doing a lot of this and he told me "you know sometimes it is better to just rush it and get the product out rather than taking the time to do it the right way the first time -- we don't want to miss our window of opportunity. Maybe we can revisit doing it your way once we've got a working product."

I sorta want to cry.

He's not wrong.

FlapYoJacks
Feb 12, 2009

Pollyanna posted:

It's fine if you take some time after it's working to refactor. Unfortunately, companies tend not to do that and instead just pile on more features over and over while ignoring developers' pleas for help and mercy :suicide:
This is true.

ToxicSlurpee posted:

Take a wild guess how soon there will be time found for refactoring. "We'll make it suck less later when we have time" is a leading cause of technical debt.

Very little.

I know it sucks, but at the end of the day, great code is awesome, but it doesn't sell unless its in a sellable product.

FlapYoJacks
Feb 12, 2009
Tomorrow I get to tell management that you can't expect board bringup to happen in less than a month. :allears:

FlapYoJacks
Feb 12, 2009

ratbert90 posted:

Tomorrow I get to tell management that you can't expect board bringup to happen in less than a month. :allears:

The intermittent manager tried to tell me "I'm not allowed to put my foot down." :allears:

Hey guess what? You can't be 2 months late on delivering hardware and then expect me to still get everything done with 2 less months. I have had this poo poo pulled on me in the past, and I refuse to let it happen again. It's nice to be the senior engineer. I don't choose too many hills to fight on, but this one is a big one.

FlapYoJacks
Feb 12, 2009

JawnV6 posted:

Your foot down or not, the project isn't going to make up 2 months of lost time because the itinerant said so. I've been in the situation where manager stack up meetings to understand why delays didn't magically evaporate when something transitioned to a new team, good on you.

Thanks, he's not happy and set up a meeting for next Monday with the higher ups, but I already have every other engineer on this project agreeing with me. The timeline right now is equivalent to "here's a alpha board you have 3 weeks to get it up and running with 7 custom drivers and software that integrates with it, also we have provisioned no time in the event that there are any hardware issues with this 8 layer incredibly complex board. "

Not going to happen bub.

FlapYoJacks fucked around with this message at 21:39 on Aug 16, 2016

FlapYoJacks
Feb 12, 2009

Skandranon posted:

"gently caress it, I'm not fixing that mess, I'm just getting in and out with my bug fix as fast as possible. Hopefully I am no longer here when the whole thing implodes."

This; this is the correct answer.

- Some idiot creates a gigantic class of poo poo.
- Idiot leaves
- New guy gets stuck with gigantic class and BUGS ARE AFFECTING PRODUCTION!!!1!!!
- New guy never gets enough time to actually fix the class.

goto 1

FlapYoJacks fucked around with this message at 21:38 on Aug 26, 2016

FlapYoJacks
Feb 12, 2009
Finally getting around to fixing the git portion of our ancient code base. 4 gigs down to 125 megs. :allears:

With a combination of a tiny python script, git bfg, and git lfs, magic happened here today.

FlapYoJacks
Feb 12, 2009

Vulture Culture posted:

Controversial opinion incoming: everyone should regularly be doing some amount of manual testing.

This isn't controversial at all. There are some tests that can't be done by way of automation.

FlapYoJacks
Feb 12, 2009

baquerd posted:

Depends on the app. A simple, stand-alone RESTful microservice can be 100% automated testing and deployment.

Which wouldn't include some of the tests that can't be done by way of automation? :confused:

FlapYoJacks
Feb 12, 2009
God drat it. I got a PHY to identify itself, but it won't send out network traffic. The TX clock is all hosed up and I'm not sure why. :argh:

Adbot
ADBOT LOVES YOU

FlapYoJacks
Feb 12, 2009
I have a coworker
Who is a good guy
But messages
Me on slack like
This constantly and doesn't
Think to just write a single
Sentence.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply