|
Ithaqua posted:The "why" is (ideally) part of the commit message in source control. I've smacked devs upside the head (metaphorically speaking) for committing a changeset with a description like "removed the foo". Yes, I can look at a diff of the code and see that you removed the foo. Why did you remove the foo? Commit messages are great for historical context, but I shouldn't have to look through every commit that touched a file to determine the intended current behaviour of a procedure. That sort of thing should be in a comment in the source and should be updated if poo poo changes. (Of course half the poo poo I work on uses a revision management system that doesn't have any sort of comment functionality).
|
# ? Aug 14, 2013 06:30 |
|
|
# ? Jun 5, 2024 19:39 |
|
Rocko Bonaparte posted:I've come to the conclusion that having a good logging framework and logging statements to go with them also helps in explaining what is going on. It still doesn't explain why it's being done the way it is, but it does a marginal job of throwing some human language into the picture. OTOH I'm dealing with people that don't even want to declare classes in Python because that takes more keystrokes, so it's a losing battle. I really like doing Python code:
Python code:
You know, until your disk fills up with debug logs.
|
# ? Aug 14, 2013 12:13 |
|
Zombywuf posted:I really like doing (... log messages instead of comments ...) You know, until your disk fills up with debug logs. I used a hack in my logging code once code:
|
# ? Aug 14, 2013 12:50 |
|
Biowarfare posted:Sure they do. Let me share with you the recent commits from a new project here: code:
|
# ? Aug 14, 2013 14:40 |
|
Does not compile? Looks like someone needs a testsuite and presumbit hooks. Seriously, I'd rather someone get mad at my tests and linter that keeps being a dick to them about whitespace and lack of backwards compatibility than rollback and blame for every dumb push.
|
# ? Aug 14, 2013 15:25 |
|
I'm bound to piss people off by saying this, but writing your own logging library is the horror. If you all use stuff like the Apache Logging Services, you can change the verbosity and hierarchy of what you want to log on-the-fly. It can also log to various different formats at once: One big file Similarly-sized files, shoring off the current one when it reaches the target size XML based formats Straight to a SQL database Over TCP or UDP, to something like their Chainsaw log viewer And of course, the console with wonderful colored, blinking text, however you format it, because people love The Shiny. I gave up rewriting logging after I tripped across that. The Apache Foundation doesn't have one for pure Python, but I use Python integrated with .NET at work, so there I use log4net. At home when I do C++ I use log4cxx. Somebody apparently made something like log4py, but I can't vouch for it. But even if that falls through, a perusal of the PyPi will show plenty of logging libraries.
|
# ? Aug 14, 2013 16:02 |
|
The problem with logging frameworks is that they always seem like such complete overkill at the beginning of a project when you can do everything you need in ten lines of code... and then a year later you're up to a few thousand lines of code that reinvents badly 90% of a good logging library.
|
# ? Aug 14, 2013 16:18 |
|
Plorkyeran posted:The problem with logging frameworks is that they always seem like such complete overkill at the beginning of a project when you can do everything you need in ten lines of code... and then a year later you're up to a few thousand lines of code that reinvents badly 90% of a good logging library. This is true of just about every library, not just logging libraries.
|
# ? Aug 14, 2013 17:16 |
|
Plorkyeran posted:The problem with logging frameworks is that they always seem like such complete overkill at the beginning of a project when you can do everything you need in ten lines of code... and then a year later you're up to a few thousand lines of code that reinvents badly 90% of a good logging library. Oh, man isn't this the truth. I still hate using it for some reason, but Python's logging library at least lets you start small and build up as you need more capabilities.
|
# ? Aug 14, 2013 17:17 |
|
Bognar posted:Let me share with you the recent commits from a new project here: Not bullet proof, and YMMV, but code review goes a long way. Around here, there is no way in hell someone would have his/her diff approved with such half-assed commit messages.
|
# ? Aug 14, 2013 17:36 |
|
Thermopyle posted:Oh, man isn't this the truth. Oh that's hilarious. There's miles of Python code at work and they're all making their own logging routines. Take over sys.stdout with your own object that only implements write? Go ahead! Wait, why do we crash when we flush stdout now? Oh yes, and they loath to make them in classes because that's more typing.
|
# ? Aug 14, 2013 17:39 |
|
Rocko Bonaparte posted:The Apache Foundation doesn't have one for pure Python, but I use Python integrated with .NET at work, so there I use log4net. At home when I do C++ I use log4cxx. Somebody apparently made something like log4py, but I can't vouch for it. But even if that falls through, a perusal of the PyPi will show plenty of logging libraries. Or you know, just dump the messages to syslog. Then cry because all implementations of syslog are awful.
|
# ? Aug 14, 2013 17:41 |
|
There are times when I miss Python's "Batteries Included" approach when working with .NET. Some basic logging beyond Debug, a CSV parser that isn't solely in the VB namespace...
|
# ? Aug 14, 2013 17:49 |
|
Zombywuf posted:Or you know, just dump the messages to syslog. Soon there won't be any more implementations of syslog
|
# ? Aug 14, 2013 18:00 |
|
Otto Skorzeny posted:Soon there won't be any more implementations of syslog I'm not sure if that's a joke or some newer development in linux.
|
# ? Aug 14, 2013 18:19 |
|
systemd replaced syslog with the journal and provided an API compatible wrapper. It's awesome.
|
# ? Aug 14, 2013 18:27 |
|
Suspicious Dish posted:systemd replaced syslog with the journal and provided an API compatible wrapper. It's awesome. Is there no end to the heresies that systemd will commit?
|
# ? Aug 14, 2013 18:30 |
|
Bognar posted:Let me share with you the recent commits from a new project here: If you have a team of literal manchildren who don't know how to write good commit messages, then you institute a policy of commit templates, along with a policy of reverting any commit that doesn't have an appropriate commit message, sight unseen. ilikelettuce posted:Not bullet proof, and YMMV, but code review goes a long way. Around here, there is no way in hell someone would have his/her diff approved with such half-assed commit messages. Or this. You should be doing code reviews anyway.
|
# ? Aug 14, 2013 18:31 |
|
Zombywuf posted:Is there no end to the heresies that systemd will commit? I'm sorry that I actually like tagged logs where service names and PIDs are all available.
|
# ? Aug 14, 2013 18:34 |
|
I might actually get off my rear end and attempt to write a small app in my spare time. If I'm looking at forking a git project with no licensing info that itself is a fork of a fork (none of which have any licensing info) what should I do when it comes to licensing? Should I contact everyone up and down the line and see if they're ok with some license I put on a project? Should I completely start over instead (I'd likely do a heavy rewrite anyway)?
|
# ? Aug 14, 2013 18:41 |
|
Dren posted:I might actually get off my rear end and attempt to write a small app in my spare time. If I'm looking at forking a git project with no licensing info that itself is a fork of a fork (none of which have any licensing info) what should I do when it comes to licensing? If you're honestly worried about it, you probably can't use the code. Open an issue and move along.
|
# ? Aug 14, 2013 18:56 |
|
Volmarias posted:If you have a team of literal manchildren who don't know how to write good commit messages, then you institute a policy of commit templates, along with a policy of reverting any commit that doesn't have an appropriate commit message, sight unseen. Are you saying he should wip them into shape?
|
# ? Aug 14, 2013 19:07 |
|
pokeyman posted:If you're honestly worried about it, you probably can't use the code. Open an issue and move along. I just don't want to make something halfway decent, slap an open source license on it, and have someone complain that it's theirs by copyright since they never specified anything at all. If my thing ends up sucking or not existing it's no big deal but it would suck to put a bunch of effort in and have someone give me poo poo because they never were bothered to include licensing info.
|
# ? Aug 14, 2013 19:22 |
|
So don't do that.
|
# ? Aug 14, 2013 19:24 |
|
Volmarias posted:Or this. You should be doing code reviews anyway. I've been pushing for code reviews, and we're slowly starting to do them. However, the plan is to introduce them for the more junior developers first and then move up the chain. The guy who writes 'wip' and 'asdf' is our second most senior developer, so it will be a bit before that is fixed by code reviews.
|
# ? Aug 14, 2013 19:27 |
|
Suspicious Dish posted:I'm sorry that I actually like tagged logs where service names and PIDs are all available. I hate needing dbus in order to boot.
|
# ? Aug 14, 2013 19:28 |
|
Zombywuf posted:I hate needing dbus in order to boot. Well good thing, because systemd has none of that.
|
# ? Aug 14, 2013 19:29 |
|
Rocko Bonaparte posted:Are you saying he should wip them into shape? Nice!
|
# ? Aug 14, 2013 19:29 |
|
Suspicious Dish posted:Well good thing, because systemd has none of that. https://wiki.archlinux.org/index.php/D-Bus
|
# ? Aug 14, 2013 19:32 |
|
DBus refers to both a serialization protocol and a system daemon. systemd uses the serialization protocol internally with UNIX sockets (point-to-point DBus), so it requires the client library. The system daemon part is not needed for early boot.
|
# ? Aug 14, 2013 19:43 |
|
Suspicious Dish posted:systemd uses the serialization protocol internally with UNIX sockets (point-to-point DBus), so it requires the client library. They're also working on removing the dbus library dependency by implementing their own, which while it's another n+1 problem, it makes my life easier, since currently systemd and dbus are mutually build dependent. Dbus needs systemd to be built so it knows where to install the dbus service's unit files. Systemd needs dbus' libraries and headers. Well, that's what it used to need. Now dbus actually needs some of systemd's libraries, so you can't even fake the pkg-config to build dbus independently any more.
|
# ? Aug 14, 2013 20:10 |
|
Fucks sake, get your filthy dbus loving hands off my init.
|
# ? Aug 14, 2013 20:18 |
|
Dren posted:have someone complain that it's theirs by copyright since they never specified anything at all. It is. Just because someone posted it on github doesn't mean it's free for you take and license how you want.
|
# ? Aug 14, 2013 20:55 |
|
Zombywuf posted:Fucks sake, get your filthy dbus loving hands off my init. The daemon is nowhere near your init. But what do you have against dbus?
|
# ? Aug 14, 2013 20:58 |
|
Edison was a dick posted:They're also working on removing the dbus library dependency by implementing their own, which while it's another n+1 problem, it makes my life easier, since currently systemd and dbus are mutually build dependent. Yeah, it's a bit ugly at the moment. What you have to do is build DBus without systemd integration to bootstrap systemd, then build systemd, then build DBus again. This is a very typical problem in OS integration, though, and it's one that's existed since the first distros have ever existed. The systemd people are writing kdbus, but it's going to take some time. They hope to have it deployed by early next year.
|
# ? Aug 14, 2013 21:00 |
|
Dren posted:I just don't want to make something halfway decent, slap an open source license on it, and have someone complain that it's theirs by copyright since they never specified anything at all. The GitHub terms of service allow you to fork the repository, even if it has no license attached, but that's about it. Like I said, if you're worried about it then stay away.
|
# ? Aug 14, 2013 21:04 |
|
pokeyman posted:The GitHub terms of service allow you to fork the repository, even if it has no license attached, but that's about it. Like I said, if you're worried about it then stay away. Thanks, I'll roll my own. I feel like it's kind of a strange culture on github to not require a license to be specified but to explicitly permit forking. It seems like forking something with no license leaves you in kind of a no-man's land. You were allowed to fork but you're not really allowed to use the code for anything because it's implicitly copyrighted. I found this article on the topic, unfortunately it wasn't very helpful except to note the problem I have. http://www.zdnet.com/github-improves-open-source-licensing-polices-7000018213/
|
# ? Aug 15, 2013 00:15 |
|
Dren posted:Thanks, I'll roll my own. I feel like it's kind of a strange culture on github to not require a license to be specified but to explicitly permit forking. It seems like forking something with no license leaves you in kind of a no-man's land. You were allowed to fork but you're not really allowed to use the code for anything because it's implicitly copyrighted. Forking is the entire point of GitHub, so it makes sense for it to be explicitly permitted. I share your pain though, it sucks to come across code with an uncertain or nonexistent license. Open an issue, hope the maintainer updates it, and in the meantime do your best!
|
# ? Aug 15, 2013 00:43 |
|
Spotted at work today in C code for an embedded device:code:
|
# ? Aug 15, 2013 00:46 |
|
|
# ? Jun 5, 2024 19:39 |
|
Aw, i actually preferred the "32^2" version. I don't doubt that's out there at least a couple of times.
|
# ? Aug 15, 2013 00:49 |