Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

07-30-2018 , 10:50 AM
Quote:
Originally Posted by Craggoo
I can't speak to the efficiency of it since I don't know Java but if that is your definition of unreadable code I think you need to redefine unreadable.
Compared to the efficient solution, yes it's unreadable. The efficient solution uses a hash, that's the data structure/flow you would expect to see.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-30-2018 , 12:14 PM
What's everyone's solutions to documentation maintenance? We just keep making new hubs in confluence and everyone knows it'll never be updated, but I don't really have a better solution
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-30-2018 , 12:18 PM
lol documents
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-30-2018 , 12:24 PM
Quote:
Originally Posted by candybar
To be honest, I think this is fairly neutral with respect to readability and more experienced people would prefer the latter anyhow but I don't think there's any performance implication here assuming even a decent compiler, which most browsers have. I'm not sure where you're coming up with 212 bytes but I don't think it's correct. The intermediate value needs to be stored either way and compiler should be able to inline or at least avoid capturing in a closure if it's not referenced elsewhere. Also, stack variables don't stay allocated forever so even if this incurs additional allocation, in a loop, you don't keep incurring the same penalty. Since most people use Babel, which I don't think does anything fancy, there may be like a difference of ~2 bytes in terms of JS payload.
Yea I wasn't very clear here. I thought my example was 2 bytes of extra JS payload. Another code review turned up similar stuff that I added to 212 bytes.

But I am ignorant to V8 and other engine optimizations so I am probably completely wrong.

And I agree that the ladder example is more clear when used once but we were using that 4-5 times in the function and once I see something like that more than a couple times i usually find it much more readable to cast it to a variable at the top level.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-30-2018 , 01:30 PM
Quote:
Originally Posted by Grue
lol documents
A+
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-30-2018 , 02:15 PM
Quote:
Originally Posted by PJo336
What's everyone's solutions to documentation maintenance? We just keep making new hubs in confluence and everyone knows it'll never be updated, but I don't really have a better solution
I try to put everything I can in Readme.md files in the repos - either in the root or in subdirectories. At least it's closer to the source and easier to find. If I have to put it off on a shared spot I link to it from the Readme file. Either way I always make caveats that it could get out of date (as all documentation eventually does) so go to the source or ask someone if in doubt.

Key thing for documentation imo is one single entry point that devs will always know. That way they don't need to learn and remember 10 iinks - just one. The Readme file is ok for that if you're on a monolith with one code base. But for microservices obviously you need a different point of entry.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-30-2018 , 03:31 PM
Quote:
Originally Posted by PJo336
What's everyone's solutions to documentation maintenance? We just keep making new hubs in confluence and everyone knows it'll never be updated, but I don't really have a better solution
we have documents. they are very helpful. they show the proper way to do jasmine tests, analytics, imports, some other stuff. they are very clear and helpful. no one reads them.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-30-2018 , 03:52 PM
The only documentation any dev ever reads is the new developer setup cookbook - because they have to. Everything else isn't worth the time, well except as something to point them to when they bug you about common questions. And that is pretty valuable actually.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-30-2018 , 04:22 PM
Quote:
Originally Posted by PJo336
What's everyone's solutions to documentation maintenance? We just keep making new hubs in confluence and everyone knows it'll never be updated, but I don't really have a better solution
wikis are where information goes to die. I wrote a big document before I left on vacation because I knew otherwise there would be things in this project I'm working on that would be hard to find. I plan to delete it when I get back because some of that information will become wrong almost immediately. Half-correct documentation is probably worse than none.

We do the readme.md thing as much as possible. People mostly don't read those either.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-30-2018 , 04:25 PM
Half-correct documentation is absolutely worse than none.

At my last company devs learned to read the README's - after some prodding.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-30-2018 , 06:28 PM
We did Readme and contributing mds but they decided to migrate everything to confluence. Imo this is the dumbest thing about microservices, there's no way to standardize knowledge sharing across 50 different services. Every just says do your best to update stuff! I can't for the life of me think of a realistic solution though so I status quo it up and add half ass docs to confluence
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-30-2018 , 06:31 PM
I would still put readme's in the microservices and have a dashboard where you can click through to any of them, even better show in a popup (in addition to uptime, swagger, link to repo, whatever else, etc.). Each microservice readme should also have a link to any of the shared libs it uses, and the central microservice framework or generator (if those exist).
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-30-2018 , 06:39 PM
that ruby code was fairly brutal, especially without any comments. wtf.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-30-2018 , 07:22 PM
How do articles get upvoted on HN to the point where they get noticed? Is there some cabal that decides that stuff ahead of time? Seems like almost all the top articles these days are about general curiosity type stuff. I guess the hackers are tired of reading about hacking.

Also big thumbs up to Medium. Soooooo easy to work with and gives you exactly the right amount of options imo. My wordpress blog is about 10x more work to create. Why the hell do I have to upload images to Wordpress first, then insert them in the blog in a cumbersome way? It's painful.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-30-2018 , 08:05 PM
Quote:
Originally Posted by Larry Legend
And I agree that the ladder example is more clear when used once but we were using that 4-5 times in the function and once I see something like that more than a couple times i usually find it much more readable to cast it to a variable at the top level.
Oh wow if it's used more than once, saving it as a variable is better for both performance and readability. Either way, lol that other dude.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-30-2018 , 09:09 PM
Quote:
Originally Posted by river_tilt
^

Quote:
Premature optimisation is the root of all evil.
Knuth.
A wise senior dev at my last job told me this too when I came to him with a question about some code I was writing one day. It's really good advice.

Quote:
Originally Posted by suzzer99
You work on embedded systems right? I always assumed performance trumps everything in that world.
"Performance" is relative. Even embedded systems have pretty fast CPUs and can do a lot of work these days. I think you have to recognize the correct order of magnitude that you're optimizing for - on some systems trimming some important routine down to bare assembly to squeeze every last cycle from the processor might be worthwhile, but in most situations you're wasting your time doing that.

Quote:
Originally Posted by PJo336
What's everyone's solutions to documentation maintenance? We just keep making new hubs in confluence and everyone knows it'll never be updated, but I don't really have a better solution
Whoever can figure this out probably has the next billion dollar startup, we have so many requirements/specifications that live in mystic Google Docs where the link might be on a Confluence page (if you're lucky) or buried in your email/Slack to search through (if you're not), then things change once implementation begins and the people working on it realize some considerations weren't accounted for and no one updates the docs and it's AWFUL. AWFUL.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-30-2018 , 10:30 PM
Grim, you’re a total toxic moron.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-30-2018 , 10:33 PM
Quote:
Originally Posted by Craggoo
I can't speak to the efficiency of it since I don't know Java but if that is your definition of unreadable code I think you need to redefine unreadable.
He’s an idiot. I don’t even hate java. The code example he posted was something I wrote in like 5 mins for a school assignment as an example. Using it as an example of me being a “bad dev” or whatever is just absolutely laughable to me. I have him on ignore but unfortunately he’s being quoted like crazy.

I had this bizarre impression of him as some senior linux C dev or something but then he posted his age and I realized he’s just an inexperienced, opinionated, big headed dev that likes to loftily talk about concepts he doesn’t completely understand.

I really doubt suzzer has to worry about algorithmic efficiency in his day to day work and candybar’s post sums it up nicely.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-30-2018 , 10:49 PM
Quote:
Originally Posted by jmakin
Grim, you’re a total toxic moron.
I think that's a little harsh. If nothing else he spawned some interesting conversation.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-30-2018 , 10:52 PM
The degree to which he's been attacking me here has been out of control for the last month+

I toned back posts about my job to compensate but he'll still nitpick any opportunity possible. About done with this forum - some of the advice I've gotten here is good but at this point, he makes the thread unreadable for me.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-30-2018 , 10:52 PM
Quote:
Originally Posted by candybar
Oh wow if it's used more than once, saving it as a variable is better for both performance and readability. Either way, lol that other dude.
One thing I told a much more senior teammate (backend) was that this dude would say things with equal conviction whether they were 100% correct or 100% incorrect. When this senior dev was in convos with him he would just exclaim stuff like "that can't be, it doesnt make any sense" and it was super beneficial for me.

It made it very hard as someone trying to learn when it was just me and the toxic dude in a convo together.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-30-2018 , 11:04 PM
My all time favorite toxic dev moment was "I know the code works, I looked at it." Well did you run it? "No."

Narrator: the code didn't work.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-30-2018 , 11:05 PM
Quote:
Originally Posted by :::grimReaper:::
Compared to the efficient solution, yes it's unreadable. The efficient solution uses a hash, that's the data structure/flow you would expect to see.
Compared to what I've seen in my companies code base, if that was the most unreadable code snippet I would be god dam overjoyed!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-30-2018 , 11:26 PM
Quote:
Originally Posted by jmakin
The degree to which he's been attacking me here has been out of control for the last month+
Wah wah wah. I haven't talked to you in weeks before you decided troll me with post below. If you can't take the heat, get outta of the kitchen. Plus, you're not open to criticism. If I suggest something or share something that goes beyond your head, you think I'm attacking you.

Quote:
Originally Posted by jmakin
He doesnt have examples he’s just spouting crap he heard in his classes
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-30-2018 , 11:28 PM
Quote:
Originally Posted by Craggoo
Compared to what I've seen in my companies code base, if that was the most unreadable code snippet I would be god dam overjoyed!
You're missing the context. Is it more readable than the efficient/correct/common-sense solution (i.e. the one that uses a hash and doesn't do donky array list remove() and get() etc)?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m