|
Rick York wrote: if I want to use it I try to make it readable, at least for me
"at least for me" being the operative bit of that. i know my code isn't as readable as it should be because of how many people tell me my articles lose them.
Real programmers use butterflies
|
|
|
|
|
In the past I have written code that seemed readable at the time but when I came back to it a few months later was unintelligible to me! it worked fine but how I did it, I have no idea!
- I would love to change the world, but they won’t give me the source code.
|
|
|
|
|
� Forogar � wrote: In the past I have written code that seemed readable at the time but when I came back to it a few months later was unintelligible to me! it worked fine but how I did it, I have no idea! My experience is more like
In the past I have written code that seemed readable at the time but when I came back to it a few months later was unintelligible to me! It looks like it has never worked, but how I ever thought it was OK, I have no idea!
|
|
|
|
|
- I would love to change the world, but they won’t give me the source code.
|
|
|
|
|
<OldFartWarStory>
I have inherited a body of code from a guy who retired about 10 years ago and then died. He was a grade A a-hole to work with while he was here. After he left his code bounced from person to person, with none of them making any changes, until it arrived on my desk. I have spent a couple hundred hours over the last year just looking at it in the course of diagnosing issues. I am currently about to make my first change in it due to a hardware obsolescence problem.
This is all C, running on Windows as a command-line app. The code was deliberately written so that A-hole was the only person who could maintain it. Identifiers are of minimal length. There are global values with single lower-case character names. While there are dozens of .C source files, none of them have matching .H files. All external references are explicitly specified everywhere. Function prototypes are not used - anywhere. Magic numbers abound. Pointer arithmetic is used unnecessarily and unwisely. There's more, but I don't want to frighten you children.
He cultivated a mythos surrounding his code, claiming that it was difficult and performance-intensive, and that was why other people couldn't handle it. His management believed it.
I have spent the last two weeks figuring out how to address this obsolescence issue. When I'm done, I will have replaced <100 lines of code with around 40.
</OldFartWarStory>
Writing unreadable code is inexcusable and should be grounds for termination with utmost prejudice.
Software Zen: delete this;
|
|
|
|
|
I've found there are cases where code is bound to be ugly no matter what. Either the interface the code must integrate with is nasty (using the unfortunately undocumented soc/spi_master.h on the ESP-IDF), or the algorithm is horrific (LALR table generation) and there's little choice, plus comments only get you so far because you'd have to explain the entire thing you're coding against (like the LALR algorithm, or you'd have to document the undocumented interface as well as your own code)
So for certain things, I forgive ugly code, as long as it is otherwise well written.
Real programmers use butterflies
|
|
|
|
|
I've been trying with no luck to read data off of a couple of different SPI devices.
It turns out, the documented API for doing SPI with the ESP-IDF is not very capable.
There is a lower level API that both the higher level API and the Arduino framework layer are built on top of. It is undocumented.
Worse, it's Apache licensed, meaning just for me to figure out how it works, I get roped into their licensing scheme because I have to look at their code and make something based on it.
It does me no good if you build layer upon layer of API and then hamstring the top layer and don't document the lower layers.
And now I get to go cave diving. Here there be dragons.
Real programmers use butterflies
|
|
|
|
|
🐉🐲🐉
Does the recent case with Oracle and Google(?) exempt you from this licensing scheme? I thought it was decided that an API couldn't be copyrighted, just its implementation. Regardless, it is bizarre for an API to infect users with an undesirable license.
|
|
|
|
|
It's only if I understand the license properly and because I'm essentially forced to create a derivative work in lieu of documentation. I'm not sure how that court case impacts this.
Real programmers use butterflies
|
|
|
|
|
You can always bit bang the SPI.
|
|
|
|
|
I'm basically resorting to something like that, but for production I need to use the hardware SPI controller w/ DMA for performance reasons. I think I can get there with my current route, even though it's not ideal.
Real programmers use butterflies
|
|
|
|
|
Don't forget about the Orcs and the Uruk-hai.
|
|
|
|
|
One token-ring to rule them all?
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
honey the codewitch wrote: And now I get to go cave diving. Here there be dragons.
Trolls. Dragons are at the edge of the world.
|
|
|
|
|
Fear not!! As a fan of The Hobbit, I know the ogres were turned to stone and Smaug is dead.
Actually, best of luck!
__________________
Lord, grant me the serenity to accept that there are some things I just can’t keep up with, the determination to keep up with the things I must keep up with, and the wisdom to find a good RSS feed from someone who keeps up with what I’d like to, but just don’t have the damn bandwidth to handle right now.
© 2009, Rex Hammock
|
|
|
|
|
"Asdfg". "Hjkl". "Uiop". Do girls love it when you talk Qwerty to them?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
a-ZERTY-nly not!
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
|
Your just ribbon us, right? I mean, that type of humor is expected around here. ROTCT (Roller on the Carriage, Turning !
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
I can't remember the last time I saw a dot-matrix printer, to say nothing of an ASR-33...
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
We don't serve your type here.
|
|
|
|
|
OG - you are a font of wisdom!
If you can't laugh at yourself - ask me and I will do it for you.
|
|
|
|
|
Well it amazed me ...
I'm trying to do Daily Objectives every day (got the 7-in-a-row award yesterday!) but one of today's was "Recruit a member to your MC" and since I have no friend who play computer games I was a bit stuck.
So when at last I asked a random member if he'd mind joining for 30 seconds and he said "Sure! I'll finish this heist prep and get back to you" I was gobsmacked!
And he did - so now I have 8 days in a row! Only 20 to go for the "big reward" but I doubt that'll be possible - at least one is going to require me to buy a submarine or something ...
So it's true: not everyone playing GTA V is a griefer on an Oppressor II!*
* Just most of 'em.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OriginalGriff wrote: since I have no friend who play computer games
If they play computer games, they have no time to be friends.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|