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 10-18-2017, 12:55 AM   #30201
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 ChrisV View Post
I would buy that, but does it really matter? If the issue is really important, there should be a voice call. If it's not, does it matter if they contribute less? If they have something actually important to say, they'll say it.

That's my problem with the post, that most of the accusations he levels at non touch typists either don't matter much or are flat out misguided. Whenever I see someone complain that other programmers don't comment code enough, I pretty much ignore everything else they have to say. Good code should usually only need sparse commenting, and people that insist on heavy commenting are the enemies of productivity and maintainability. The bit about them not formatting code also made me lol. Does this guy use an IDE? I mean the post is 2008, so maybe that has something to do with it, but it reads like it's from 1998.
This is the same old nonesense:

Quote:
Code should be self-documenting
This is bs. As far as I'm concerned, anybody who says this is just trying to justify being lazy. Would you rather work in a code base that is heavily documented such that you know where you need to make your updates or your "self-documenting" code base? The non-documented code base assumes that whoever worked on it did a good job. That is a very generous assumption.

Last edited by Craggoo; 10-18-2017 at 01:05 AM.
Craggoo is offline   Reply With Quote
Old 10-18-2017, 01:04 AM   #30202
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 **

For those of you that use vue/vuex, I have a few questions for you:

1) Thoughts on asyc store actions?
2) Thoughts on one mutation per one store action?
3) Thoughts on multiple mutations per single store action?

My thoughts on 2/3... if you have a store action that is triggering multiple mutations you will inevitably run into a many-to-many relationship between store actions/mutations. It's going to make it much harder to debug who is really triggering the mutation when its in > 1 place (and in a large app, that could realistically be many places). If you keep it in a 1:1 relationship (one store action will only mutate one state value) it makes it far easier to debug even in a large app.
Craggoo is offline   Reply With Quote
Old 10-18-2017, 07:29 AM   #30203
Wolfram
Carpal \'Tunnel
 
Wolfram's Avatar
 
Join Date: Jan 2006
Location: You can be my wingman any time
Posts: 14,733
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by Craggoo View Post
This is bs. As far as I'm concerned, anybody who says this is just trying to justify being lazy. Would you rather work in a code base that is heavily documented such that you know where you need to make your updates or your "self-documenting" code base? The non-documented code base assumes that whoever worked on it did a good job. That is a very generous assumption.
I think too many comments can be worse than no comments.

It's a tricky thing to master. Your code should be as readable as possible without comments, but then you should also sprinkle some comments in the code to understand the logic better, explain business logic, background information, etc.

The main problem with comments imo is that they need to be maintained with your code. This gets exponentially harder when the volume of comments goes up.

Last edited by Wolfram; 10-18-2017 at 07:56 AM.
Wolfram is offline   Reply With Quote
Old 10-18-2017, 07:47 AM   #30204
RustyBrooks
Carpal \'Tunnel
 
RustyBrooks's Avatar
 
Join Date: Feb 2006
Location: Austin, TX
Posts: 24,289
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by iversonian View Post
506/101 with 2 mistakes

but i'm a jet lag zombie right now and typing with my laptop on my chest. will try again tomorrow to go after goofy.
You come at the king, you best not miss

Where are y'all taking this typing test btw, I must have missed it?
RustyBrooks is offline   Reply With Quote
Old 10-18-2017, 08:12 AM   #30205
saw7988
Carpal \'Tunnel
 
saw7988's Avatar
 
Join Date: Jul 2005
Posts: 11,460
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I installed Windows Subsystem for Linux and Ubuntu for my Windows 10 home laptop last night. It's pretty cool. I now seem to have the GOAT computer where I have windows when I want/need and also a Linux terminal. What super powers does this actually do for me though? I feel like I'm probably never going to use it. I do all my programming (Java, C#, and Python) in IDEs...
saw7988 is offline   Reply With Quote
Old 10-18-2017, 11:29 AM   #30206
Grue
Pooh-Bah
 
Grue's Avatar
 
Join Date: Mar 2004
Location: It is pitch black.
Posts: 5,630
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Imo it's not that great if you already just use git bash on windows.
Grue is offline   Reply With Quote
Old 10-18-2017, 11:59 AM   #30207
kerowo
lolcat
 
kerowo's Avatar
 
Join Date: Nov 2005
Posts: 37,138
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by Wolfram View Post
I think too many comments can be worse than no comments.

It's a tricky thing to master. Your code should be as readable as possible without comments, but then you should also sprinkle some comments in the code to understand the logic better, explain business logic, background information, etc.

The main problem with comments imo is that they need to be maintained with your code. This gets exponentially harder when the volume of comments goes up.
The problem I had with self documented code or the whole “the code IS the documentation dummy” view is that the can only tell you what is going on, not why.
kerowo is offline   Reply With Quote
Old 10-18-2017, 12:04 PM   #30208
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 91,956
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by Wolfram View Post
I think too many comments can be worse than no comments.

It's a tricky thing to master. Your code should be as readable as possible without comments, but then you should also sprinkle some comments in the code to understand the logic better, explain business logic, background information, etc.

The main problem with comments imo is that they need to be maintained with your code. This gets exponentially harder when the volume of comments goes up.
There's no 'can be' about it. Too many comments is terrible. I can't think of one top notch dev I know who doesn't feel the same way.

Ideally code should read like a script. Do this, then do that. If this, do that. Etc. In a world of > 8 char variable and function names - you don't need comments for that. I generally only make comments when I do something that feels a little awkward or counter-intuitive - and then only after thinking long and hard if there's a less awkward way to do whatever I'm doing.

My standard is if I think myself coming back in 6 months will be confused, I might make a brief comment.

Even if I am writing a framework, I will generally make a one-line comment over each method definition. I've never met anyone who actually uses js-docs, and the comments are brittle and take up a ton of space.
suzzer99 is offline   Reply With Quote
Old 10-18-2017, 12:04 PM   #30209
Wolfram
Carpal \'Tunnel
 
Wolfram's Avatar
 
Join Date: Jan 2006
Location: You can be my wingman any time
Posts: 14,733
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by kerowo View Post
The problem I had with self documented code or the whole “the code IS the documentation dummy” view is that the can only tell you what is going on, not why.
Exactly. A concise "Process <stuff> in <some_way> to accomplish <some_business_goal>" can be invaluable.

Last edited by Wolfram; 10-18-2017 at 12:10 PM.
Wolfram is offline   Reply With Quote
Old 10-18-2017, 12:06 PM   #30210
saw7988
Carpal \'Tunnel
 
saw7988's Avatar
 
Join Date: Jul 2005
Posts: 11,460
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by Grue View Post
Imo it's not that great if you already just use git bash on windows.
Yea it probably wouldn't help much for just your one off commands, but it seems powerful in that it's like a full blown environment. Like you can apt-get install new software to the Linux subsystem and use it like a full blown computer. You can bring up graphical windows as well. That said though, as I probably implied before, I'm not much of a Linux fanboy, Windows suits 99% of my needs, so I'm not sure how much that stuff does for me.
saw7988 is offline   Reply With Quote
Old 10-18-2017, 12:06 PM   #30211
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 91,956
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by kerowo View Post
The problem I had with self documented code or the whole “the code IS the documentation dummy” view is that the can only tell you what is going on, not why.
In modular programming - "what" is the method names and variable names, "why" is the module names. Generally. Method names can also express why.
suzzer99 is offline   Reply With Quote
Old 10-18-2017, 12:09 PM   #30212
gaming_mouse
Carpal \'Tunnel
 
gaming_mouse's Avatar
 
Join Date: Oct 2004
Location: taking notes on u (see profile)
Posts: 13,782
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by Wolfram View Post
It's a tricky thing to master. Your code should be as readable as possible without comments, but then you should also sprinkle some comments in the code to understand the logic better, explain business logic, background information, etc.
I don't think it's that tricky, actually. If you need comments to explain what specific code is doing, the code needs to be rewritten.

Comments are appropriate for high-level concerns like explaining architecture, the reason module X was chosen, or the history behind some oddly chosen name.

As a rule of thumb, comments are the kind of thing you'd say to someone before you opened up a tex editor: "Oh, before we get into this, let me tell you X....". So good comments typically wind up in README files or at the top of a file. With occasional exceptions for things like naming oddities within the code:

Code:
// some fool misnamed the database column and refactoring will
// take too long because it's scattered everywhere in the code base now
ExpirationDate = model.DateCreated
gaming_mouse is offline   Reply With Quote
Old 10-18-2017, 12:09 PM   #30213
kerowo
lolcat
 
kerowo's Avatar
 
Join Date: Nov 2005
Posts: 37,138
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by suzzer99 View Post
In modular programming - "what" is the method names and variable names, "why" is the module names. Generally.
To be fair, the last production code I wrote more fancy than batch files or Nginx confit files was in COBOL so naming standards where closer to Hungarian than anything else...
kerowo is offline   Reply With Quote
Old 10-18-2017, 01:18 PM   #30214
candybar
old hand
 
Join Date: Aug 2011
Posts: 1,955
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by kerowo View Post
The problem I had with self documented code or the whole “the code IS the documentation dummy” view is that the can only tell you what is going on, not why.
I'll add that comments aren also not documentation in this sense - you'd want a design document and some kind of spec that explains how the whole thing is organized and why, not a bunch of inline comments scattered around the code base.
candybar is offline   Reply With Quote
Old 10-18-2017, 01:31 PM   #30215
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 91,956
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

If your app can't be described in a README, your app is probably too complicated and should be broken up. Design doc and spec are fine to tell devs how to built the app, but then should immediately be thrown away - as they're instantly out of date and will inevitably lead to confusion.

suzzer99 is offline   Reply With Quote
Old 10-18-2017, 01:37 PM   #30216
kerowo
lolcat
 
kerowo's Avatar
 
Join Date: Nov 2005
Posts: 37,138
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Yeah, github readme’s are a great solution to giving context to a program. Getting people to write them still a problem for teams with no process.
kerowo is offline   Reply With Quote
Old 10-18-2017, 01:44 PM   #30217
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 91,956
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Right - but it's infinitely easier to get devs to write a readme than getting them to write a spec in Word or something, then store them off somewhere, and keep them up to date. With a readme the lead dev is a lot more likely to keep it up to date imo because it's right there with the code. The dev doesn't want to look stupid, nor get constantly bugged because things in the readme don't line up with current code.

But mostly you know where the README lives. A dev that's new to the project should never have to go on a scavenger hunt to find documentation. There isn't always someone to tell them where the docs are, and over time everyone forgets. At least it always winds up that way at most places I've worked.
suzzer99 is offline   Reply With Quote
Old 10-18-2017, 01:57 PM   #30218
candybar
old hand
 
Join Date: Aug 2011
Posts: 1,955
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by suzzer99 View Post
If your app can't be described in a README, your app is probably too complicated and should be broken up. Design doc and spec are fine to tell devs how to built the app, but then should immediately be thrown away - as they're instantly out of date and will inevitably lead to confusion.
Sure but README != inline comments. And breaking up a monolith into separate apps or repos doesn't remove the complexity - someone still has to understand how the apps interact. If anything, having multiple apps and repos is more likely to require documentation outside of repos, since it's unclear where the interaction between apps should be documented.
candybar is offline   Reply With Quote
Old 10-18-2017, 02:01 PM   #30219
candybar
old hand
 
Join Date: Aug 2011
Posts: 1,955
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by suzzer99 View Post
Right - but it's infinitely easier to get devs to write a readme than getting them to write a spec in Word
Markdown vs Word is orthogonal to README vs design doc/spec which is also orthogonal to in-repo vs out-of-repo storing of documentation.
candybar is offline   Reply With Quote
Old 10-18-2017, 02:10 PM   #30220
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 91,956
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

If I use a node util that uses 10 other first-level sub-packages, it doesn't have to explain to me how it uses all those sub-packages. I can go to the readmes of those packages if needed.

I know OS is different with a big internal app. But if you modularize well, it gets close to that ideal.
suzzer99 is offline   Reply With Quote
Old 10-18-2017, 02:28 PM   #30221
candybar
old hand
 
Join Date: Aug 2011
Posts: 1,955
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by suzzer99 View Post
If I use a node util that uses 10 other first-level sub-packages, it doesn't have to explain to me how it uses all those sub-packages. I can go to the readmes of those packages if needed.
This isn't typically how a large system is structured though - if you have 100 UI apps and 100 microservices, it may or may not obvious how they are working together and which are the important apps that are coordinating the other apps and which are apps and services are features and so on. Package management dependencies are easy to manage (well for some definition of easy), but service and data dependencies are unlikely to managed this way. You're also assuming that everyone is using node - the larger the system gets and the more it embraces the microservice culture/architecture, the more unlikely it is that you'd be familiar enough with the dependency management system used by every single component in your system. Often you have applications that are collaborating and communicating in fairly intricate ways - consider all the components in a complex machine learning data pipeline - that are not obvious when you're looking at the pieces in isolation.

Another issue is that the larger the system and the more complex the domain, the greater the likelihood that you'd need to collaborate with domain experts on documentation, where external systems like wikis or issue-tracking systems easily win over markdown stored in repos.

I personally favor mono-repo and having all technical design doc in that repo so that code changes and documentation changes can be reviewed together but what typically happens when you have lots of repos, lots of applications, which also means lots of different teams doing their own thing without anyone else knowing, is that things leak outside of repos as people build and use their own documentation solutions and are no longer aware of how other teams are doing things.
candybar is offline   Reply With Quote
Old 10-18-2017, 02:33 PM   #30222
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 91,956
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

My company is too big. We had 100s of monoliths before microservices were even a term. We have endless useless wikis and competing forms of documentation, all of which are instantly out of date. It's hell. At smaller large corps I've worked for it's a milder version of the same hell.

I have zero faith a large, non-tech-high flyer company can ever make over-arching documentation work for anything other than aiding communication during active development. Or something like a cookbook for a microservice platform - which by necessity must work and be kept up to date as long as the platform is being maintained.

So I just try to push the stuff I think will actually work for the longest % of the product lifespan.

Last edited by suzzer99; 10-18-2017 at 02:46 PM.
suzzer99 is offline   Reply With Quote
Old 10-18-2017, 02:34 PM   #30223
gaming_mouse
Carpal \'Tunnel
 
gaming_mouse's Avatar
 
Join Date: Oct 2004
Location: taking notes on u (see profile)
Posts: 13,782
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by candybar View Post
This isn't typically how a large system is structured though - if you have 100 UI apps and 100 microservices, it may or may not obvious how they are working together and which are the important apps that are coordinating the other apps and which are apps and services are features and so on. Package management dependencies are easy to manage (well for some definition of easy), but service and data dependencies are unlikely to managed this way. You're also assuming that everyone is using node - the larger the system gets and the more it embraces the microservice culture/architecture, the more unlikely it is that you'd be familiar enough with the dependency management system used by every single component in your system. Often you have applications that are collaborating and communicating in fairly intricate ways - consider all the components in a complex machine learning data pipeline - that are not obvious when you're looking at the pieces in isolation.

Another issue is that the larger the system and the more complex the domain, the greater the likelihood that you'd need to collaborate with domain experts on documentation, where external systems like wikis or issue-tracking systems easily win over markdown stored in repos.

I personally favor mono-repo and having all technical design doc in that repo so that code changes and documentation changes can be reviewed together but what typically happens when you have lots of repos, lots of applications, which also means lots of different teams doing their own thing without anyone else knowing, is that things leak outside of repos as people build and use their own documentation solutions and are no longer aware of how other teams are doing things.
I think Jeff Bezos famous amazon mandate is relevant here, and is a counterpoint to your last paragraph.

Quote:
Originally Posted by Bezos
1. All teams will henceforth expose their data and functionality through service interfaces.
2. Teams must communicate with each other through these interfaces.
3. There will be no other form of interprocess communication allowed: no direct linking, no direct reads of another team’s data store, no shared-memory model, no back-doors whatsoever. The only communication allowed is via service interface calls over the network.
... etc
gaming_mouse is offline   Reply With Quote
Old 10-18-2017, 02:58 PM   #30224
candybar
old hand
 
Join Date: Aug 2011
Posts: 1,955
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by gaming_mouse View Post
I think Jeff Bezos famous amazon mandate is relevant here, and is a counterpoint to your last paragraph.
Counter-counterpoint: Google & Facebook

Also, 1) lots of companies are actually smaller than an Amazon team. 2) monorepo does not dictate anything about the run-time architecture of your system.
candybar is offline   Reply With Quote
Old 10-18-2017, 03:05 PM   #30225
candybar
old hand
 
Join Date: Aug 2011
Posts: 1,955
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by suzzer99 View Post
I have zero faith a large, non-tech-high flyer company can ever make over-arching documentation work for anything other than aiding communication during active development.
Me neither but my point wasn't that you need this, merely that in situations where you need actual documentation, it's generally unlikely that inline comments sprinkled here and there will suffice. It's a counterpoint to the argument that coders complaining about useless comments are just lazy bums who are refusing to document stuff. The critical flaw there is conflating comments with documentation to inflate the importance of comments.
candybar 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 05:46 AM.


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