Two Plus Two Publishing LLC
Two Plus Two Publishing LLC
 

Go Back   Two Plus Two Poker Forums > >

Notices

Programming Discussions about computer programming

Reply
 
Thread Tools Display Modes
Old 07-30-2018, 10:50 AM   #34076
:::grimReaper:::
veteran
 
:::grimReaper:::'s Avatar
 
Join Date: Jul 2010
Posts: 2,607
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by Craggoo View Post
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.
:::grimReaper::: is offline   Reply With Quote
Old 07-30-2018, 12:14 PM   #34077
PJo336
THRILLHOUSE!
 
PJo336's Avatar
 
Join Date: Mar 2007
Posts: 21,946
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

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
PJo336 is offline   Reply With Quote
Old 07-30-2018, 12:18 PM   #34078
Grue
Pooh-Bah
 
Grue's Avatar
 
Join Date: Mar 2004
Location: It is pitch black.
Posts: 5,654
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

lol documents
Grue is offline   Reply With Quote
Old 07-30-2018, 12:24 PM   #34079
Larry Legend
Celtic Pride
 
Larry Legend's Avatar
 
Join Date: Jul 2009
Location: Kyrie's earth
Posts: 42,763
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by candybar View Post
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.
Larry Legend is offline   Reply With Quote
Old 07-30-2018, 01:30 PM   #34080
_dave_
_Pooh_Bah_
 
Join Date: Feb 2005
Location: UK (or what remains of it)
Posts: 13,006
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by Grue View Post
lol documents
A+
_dave_ is offline   Reply With Quote
Old 07-30-2018, 02:15 PM   #34081
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 93,296
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by PJo336 View Post
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.
suzzer99 is offline   Reply With Quote
Old 07-30-2018, 03:31 PM   #34082
Victor
Carpal \'Tunnel
 
Victor's Avatar
 
Join Date: Jul 2003
Posts: 61,529
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by PJo336 View Post
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.
Victor is offline   Reply With Quote
Old 07-30-2018, 03:52 PM   #34083
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 93,296
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

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.
suzzer99 is offline   Reply With Quote
Old 07-30-2018, 04:22 PM   #34084
RustyBrooks
Carpal \'Tunnel
 
RustyBrooks's Avatar
 
Join Date: Feb 2006
Location: Austin, TX
Posts: 24,485
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by PJo336 View Post
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.
RustyBrooks is offline   Reply With Quote
Old 07-30-2018, 04:25 PM   #34085
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 93,296
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Half-correct documentation is absolutely worse than none.

At my last company devs learned to read the README's - after some prodding.
suzzer99 is offline   Reply With Quote
Old 07-30-2018, 06:28 PM   #34086
PJo336
THRILLHOUSE!
 
PJo336's Avatar
 
Join Date: Mar 2007
Posts: 21,946
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

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
PJo336 is offline   Reply With Quote
Old 07-30-2018, 06:31 PM   #34087
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 93,296
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

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).
suzzer99 is offline   Reply With Quote
Old 07-30-2018, 06:39 PM   #34088
OmgGlutten!
Pooh-Bah
 
OmgGlutten!'s Avatar
 
Join Date: Aug 2016
Posts: 5,144
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

that ruby code was fairly brutal, especially without any comments. wtf.
OmgGlutten! is offline   Reply With Quote
Old 07-30-2018, 07:22 PM   #34089
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 93,296
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

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.
suzzer99 is offline   Reply With Quote
Old 07-30-2018, 08:05 PM   #34090
candybar
veteran
 
Join Date: Aug 2011
Posts: 2,064
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by Larry Legend View Post
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.
candybar is offline   Reply With Quote
Old 07-30-2018, 09:09 PM   #34091
goofyballer
Carpal \'Tunnel
 
goofyballer's Avatar
 
Join Date: Jun 2005
Posts: 66,954
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by river_tilt View Post
^

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 View Post
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 View Post
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.
goofyballer is offline   Reply With Quote
Old 07-30-2018, 10:30 PM   #34092
jmakin
 
jmakin's Avatar
 
Join Date: Jan 2008
Location: Streaming
Posts: 28,692
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Grim, you’re a total toxic moron.
jmakin is offline   Reply With Quote
Old 07-30-2018, 10:33 PM   #34093
jmakin
 
jmakin's Avatar
 
Join Date: Jan 2008
Location: Streaming
Posts: 28,692
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by Craggoo View Post
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.
jmakin is offline   Reply With Quote
Old 07-30-2018, 10:49 PM   #34094
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 93,296
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by jmakin View Post
Grim, you’re a total toxic moron.
I think that's a little harsh. If nothing else he spawned some interesting conversation.
suzzer99 is offline   Reply With Quote
Old 07-30-2018, 10:52 PM   #34095
jmakin
 
jmakin's Avatar
 
Join Date: Jan 2008
Location: Streaming
Posts: 28,692
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

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.
jmakin is offline   Reply With Quote
Old 07-30-2018, 10:52 PM   #34096
Larry Legend
Celtic Pride
 
Larry Legend's Avatar
 
Join Date: Jul 2009
Location: Kyrie's earth
Posts: 42,763
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by candybar View Post
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.
Larry Legend is offline   Reply With Quote
Old 07-30-2018, 11:04 PM   #34097
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 93,296
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

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.
suzzer99 is offline   Reply With Quote
Old 07-30-2018, 11:05 PM   #34098
Craggoo
culled
 
Craggoo's Avatar
 
Join Date: Sep 2006
Location: R.I.P. ItzPenzoo 12-09-11
Posts: 12,533
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by :::grimReaper::: View Post
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!
Craggoo is offline   Reply With Quote
Old 07-30-2018, 11:26 PM   #34099
:::grimReaper:::
veteran
 
:::grimReaper:::'s Avatar
 
Join Date: Jul 2010
Posts: 2,607
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by jmakin View Post
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 View Post
He doesnt have examples he’s just spouting crap he heard in his classes
:::grimReaper::: is offline   Reply With Quote
Old 07-30-2018, 11:28 PM   #34100
:::grimReaper:::
veteran
 
:::grimReaper:::'s Avatar
 
Join Date: Jul 2010
Posts: 2,607
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by Craggoo View Post
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)?
:::grimReaper::: is offline   Reply With Quote

Reply
      

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Forum Jump


All times are GMT -4. The time now is 03:36 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright © 2008-2017, Two Plus Two Interactive
 
 
Poker Players - Streaming Live Online