|
I have been at my first ever real grown up job for 6 weeks now and I'm really enjoying it. They do generally do things "the right way" (version control etc etc) and are a pretty good company to work for. Right now I'm writing some really bad code with their blessing, though. Basically we are building a system for managing the data held by another organisation, which they publish periodically in paper volumes. Up until now they have basically just edited the PDF documents containing the data in a desktop publishing application, and occasionally just sent those files to the printers. Now the data is going to be kept in a source-control-like system and will have to conform to a schema - potentially a quite complicated schema and one that will permit a lot of special-case behaviour, because that's the nature of the data we are working with, but still a schema. Right now though, the data we have is in the form of XML dumped from the desktop publishing application. I'm writing code to take that "messy" data, try to make sense of it, and spit out properly structured data. I took over a file of C# code that was written by someone else that was a few hundred lines and that kind of handled maybe 85% of what was there but broke on the special cases. And, uh, I started adding special cases. It's now about 2,300 lines and most of the added stuff is along the lines of code:
When I started I didn't appreciate quite how much massaging the data would need in order to be made sensible, or I might have tried to do it in a more systematic and readable way. But hey, it ultimately has to run just once, and then it can be thrown away. Well, it will stay in the company's source control for ever, but I put a comment at the top recommending politely that no-one read it... So there you are, I'm writing code that I know is shocking, with the company's approval. Thankfully, this bit is nearly done, and I should shortly be able to go back to writing code that works with the already-imported data and that needs to be (and is) done properly.
|
# ? Jun 28, 2014 13:24 |
|
|
# ? May 17, 2024 15:29 |
|
I had been given a similar task of cramming some existing data into an editor of ours. The problem was that our tool was put together so badly, it was just a string of hacks. I really had no way to do something properly in the timeframe, the only way to do it was to add more crappy code onto the pile. I explained that I really wasn't happy doing it, but nobody really cared. It actually made me sick. I had to take a week off
|
# ? Jun 28, 2014 13:39 |
|
Zopotantor posted:[1] Currently on 4.1 since we're still using RHEL 5. Our customers are very, very conservative and need serious arm-twisting to agree to OS updates. Feel lucky. We still have customers running RHEL 4. On a Pentium III.
|
# ? Jun 28, 2014 20:19 |
|
vOv posted:What is up with people using CSS classes for things that there will only ever be one instance of? There is no difference between using CSS class selectors and CSS ID selectors other than the attribute matched.
|
# ? Jun 29, 2014 00:32 |
|
Suspicious Dish posted:There is no difference between using CSS class selectors and CSS ID selectors other than the attribute matched. Id is higher specificity.
|
# ? Jun 29, 2014 00:38 |
|
Suspicious Dish posted:There is no difference between using CSS class selectors and CSS ID selectors other than the attribute matched. In addition to ID being more 'specific' (what Plorkyeran said), it's cleaner semantically.
|
# ? Jun 29, 2014 01:25 |
|
The high specificity of IDs can become an enormous pain in the rear end. Overuse of IDs in selectors often leads to developers taking shortcuts like !important or inlining styles, because the burden of determining whether it's safe to reduce specificity on a competing selector is too great.
|
# ? Jun 29, 2014 02:12 |
|
Object-oriented CSS in most people's minds is stuff like class="red big button" instead of id="submit-order", but that's terrible, non-semantic HTML. Use id="submit-order" and #submit-order { @extend .red; ... } or your favorite preprocessor's equivalent. In addition to separating content from presentation, IDs are also a lot faster to render and all that stuff.
|
# ? Jun 29, 2014 06:57 |
|
xtal posted:Object-oriented CSS in most people's minds is stuff like class="red big button" Woah, the horror is coming from inside the thread!!! I think you meant class="big red button"
|
# ? Jun 29, 2014 08:59 |
|
xtal posted:Object-oriented CSS in most people's minds is stuff like class="red big button" instead of id="submit-order", but that's terrible, non-semantic HTML. Use id="submit-order" and #submit-order { @extend .red; ... } or your favorite preprocessor's equivalent. In addition to separating content from presentation, IDs are also a lot faster to render and all that stuff. Non-semantic CSS is one of my pet peeves and I had a small meltdown when a friend linked me the basscss with its helpful and semantic examples such as: code:
code:
It almost feels like we are taking huge steps backwards with HTML+CSS. The above examples are nothing but inlined styles. There is practically no difference there from a usability or a development standpoint between code:
code:
|
# ? Jun 29, 2014 09:16 |
|
Suspicious Dish posted:There is no difference between using CSS class selectors and CSS ID selectors other than the attribute matched. And the fact that ID selectors match with = rather than ~=. code:
ID selectors are also higher specificity than their attribute-selector equivalent, whereas class selectors really are just shorthand for [class~=value].
|
# ? Jun 29, 2014 14:12 |
|
Suspicious Dish posted:There is no difference between using CSS class selectors and CSS ID selectors other than the attribute matched. ID selectors are significantly faster than class selectors: http://jsperf.com/id-versus-class/2 edit: Weird... that test case doesn't exist anymore and I can't seem to add anything to jsperf anymore. The test was simple code:
code:
code:
necrotic fucked around with this message at 23:43 on Jun 29, 2014 |
# ? Jun 29, 2014 15:40 |
|
Subjunctive posted:And the fact that ID selectors match with = rather than ~=. They both use =, but the ID attribute is just a string and the class attribute is a a space-separated list of strings. Not to be supremely pedantic, it's very different from substring matching.
|
# ? Jun 29, 2014 22:45 |
|
xtal posted:They both use =, but the ID attribute is just a string and the class attribute is a a space-separated list of strings. Not to be supremely pedantic, it's very different from substring matching. Be as pedantic as you'd like, but class uses ~=, which is matching on presence of a match in a set of whitespace-tokenized substrings. w3c posted:[att~=val] http://www.w3.org/TR/selectors/#class-html (*=, not ~=, is substring match.)
|
# ? Jun 30, 2014 01:23 |
|
code:
|
# ? Jun 30, 2014 18:23 |
|
This is in the right thread, but I'm not sure why you didn't post the whole spec.
|
# ? Jun 30, 2014 18:57 |
|
Fixing something a contractor did before disappearing and came across this:code:
beuges fucked around with this message at 21:51 on Jun 30, 2014 |
# ? Jun 30, 2014 21:47 |
|
Are there misspellings in your code base? It is statisitically likely. I fixed a method today that parses an "interger", but I'm pretty sure I've at least typed that one myself before. (yes I can see it is bad for other reasons)
|
# ? Jun 30, 2014 22:34 |
|
Hammerite posted:Are there misspellings in your code base? It is statisitically likely heh
|
# ? Jun 30, 2014 22:38 |
|
I'm working on a project with a lot of "campaigns", and it's really loving easy to type "campaing." Why do I even call them "campaigns" internality?
|
# ? Jul 1, 2014 01:57 |
|
http://pythong.org/
|
# ? Jul 1, 2014 02:00 |
|
The only reason I spell unsinged correctly is because it causes a compiler error.
|
# ? Jul 1, 2014 02:16 |
|
I have, on multiple occasions, refactored to avoid variable names containing words that I misspell a lot.
|
# ? Jul 1, 2014 02:20 |
|
The important part is to not end up with another "referer".
|
# ? Jul 1, 2014 02:38 |
|
OddObserver posted:The important part is to not end up with another "referer". Or my favorite codebase discovery, referfer.
|
# ? Jul 1, 2014 03:35 |
|
At work the consultant's php classes/interfaces all have __destructor methods. http://www.php.net/manual/en/language.oop5.decon.php#language.oop5.decon.destructor
|
# ? Jul 1, 2014 04:04 |
|
Maybe not really a horror but it did make me laugh/cry for a few minutes. Being somewhat new to day-to-day Javascript, coming from C#, I always terminate my statements with semicolons. Obviously Javascript doesn't require this but it hasn't really bitten me until the other day when my mind decided to do a strange line termination mainly for style.code:
I debugged it for a couple of minutes wondering why the condition wasn't evaluating to true when it clearly should be.. of course my mistake is that Javascript was returning out of the function immediately without even evaluating the expression.. Normally would use, and refactored to: code:
|
# ? Jul 1, 2014 05:00 |
|
Hammerite posted:Are there misspellings in your code base? It is statisitically likely. Most people working on our code are not native English speakers (me neither). So we get grammatical errors as a bonus.
|
# ? Jul 1, 2014 05:27 |
|
https://github.com/search?l=javascript&q=lenght&ref=cmdform&type=Code
|
# ? Jul 1, 2014 06:27 |
|
There's one particular place in our codebase that drives me up the wall. It's someone being pretentious and deciding to pluralize status as statii. If you're going to be clever with pluralizations, first the sense that the word's being used in is fourth declension, not second declension. Second, even if it were second declension, statius isn't a word. Third, the plural of status is status, just the emphasis is on the second syllable when you pronounce it. Fourth, I took four loving years of Latin and even then I don't waste peoples' time with that bullshit.
|
# ? Jul 1, 2014 06:40 |
|
Except just this one time
|
# ? Jul 1, 2014 06:45 |
|
Point taken
|
# ? Jul 1, 2014 06:47 |
|
1337JiveTurkey posted:There's one particular place in our codebase that drives me up the wall. It's someone being pretentious and deciding to pluralize status as statii. If you're going to be clever with pluralizations, first the sense that the word's being used in is fourth declension, not second declension. Second, even if it were second declension, statius isn't a word. Third, the plural of status is status, just the emphasis is on the second syllable when you pronounce it. Fourth, I took four loving years of Latin and even then I don't waste peoples' time with that bullshit. Every time someone calls the Winklevoss twins the "Winklevii" I want to punch them right in the face.
|
# ? Jul 1, 2014 06:53 |
|
1337JiveTurkey posted:...If you're going to be clever with pluralizations, first the sense that the word's being used in is fourth declension, not second declension. Second, even if it were second declension, statius isn't a word. Third, the plural of status is status, just the emphasis is on the second syllable when you pronounce it. Fourth, I took four loving years of Latin and even then I don't waste peoples' time with that bullshit. Add this as a comment in the code please.
|
# ? Jul 1, 2014 06:54 |
|
vOv posted:Every time someone calls the Winklevoss twins the "Winklevii" I want to punch them right in the face. its a joke, based on how ridiculous saying such a thing would be
|
# ? Jul 1, 2014 07:11 |
|
Voted Worst Mom posted:its a joke, based on how ridiculous saying such a thing would be Also, I understand from people who knew them that it really pissed them off, which is reason enough. "Virii, on the other hand, is an abomination before man and god.
|
# ? Jul 1, 2014 07:13 |
|
vOv posted:Every time someone calls the Winklevoss twins the "Winklevii" I want to punch them right in the face. The correct plural is Winklesvoss.
|
# ? Jul 1, 2014 08:23 |
|
1337JiveTurkey posted:There's one particular place in our codebase that drives me up the wall. It's someone being pretentious and deciding to pluralize status as statii. If you're going to be clever with pluralizations, first the sense that the word's being used in is fourth declension, not second declension. Second, even if it were second declension, statius isn't a word. Third, the plural of status is status, just the emphasis is on the second syllable when you pronounce it. Fourth, I took four loving years of Latin and even then I don't waste peoples' time with that bullshit.
|
# ? Jul 1, 2014 08:52 |
|
I refer to a group of walrus as walrii, come at me vOv
|
# ? Jul 1, 2014 15:17 |
|
|
# ? May 17, 2024 15:29 |
|
code:
edit: .orange-arrow isn't orange. canis minor fucked around with this message at 17:53 on Jul 1, 2014 |
# ? Jul 1, 2014 17:16 |