|
Yeah but he has a point, or if even if he doesn't have it, there exists the point that if two interfaces happen to use the same names of things, you will have a type misused. The moral is that method names should have namespaces . (Actually this is why sometimes for templated code calling a function, it's handy to make a namespace for the overloaded functions to reside in that implementers of this "concept" have to use.)
|
# ? Jul 19, 2016 03:47 |
|
|
# ? Jun 7, 2024 18:01 |
|
A few pages back, but I can't resist:feedmegin posted:Edit: on Windows, of course, it's not main() but WinMain(), because Microsoft gotta be different! Starting from Win32 (est. 1993), WinMain and main are completely interchangeable and the difference is largely cosmetic. Only 16 bit Windows required WinMain, and had really poor support for UNIX-like C code (no pipes, no terminal emulation, no preemptive multitasking) so you didn't want to use main anyway: command line applications would work much better as DOS applications. UNIX-like C code, i.e. designed around I/O multiplexing, would work like total poo poo on Windows, because back then, Windows multitasking was based on the message queue, and I/O didn't (doesn't!) pump messages (I remember an obscure project to port the UNIX environment to Windows, using pipes based on messaging instead of I/O). In Windows, though, DOS applications ran in virtual machines, so the issue could be elegantly side-stepped (not that DOS had pipes because it was strictly single-task...) feedmegin posted:Nah. You're thinking of the MS-DOS stub at the start of PE/COFF files, which is completely separate and independent from the actual Windows program (and, of course, is running in 16-bit mode). You can't write one program which directly targets both environments or anything. You totally can. Lots of DOS extenders implemented the Win32 API, some to an insane degree (graphics, sound, etc. one hobbyist extender even implemented part of DirectX), so yes, you could literally run the same identical executable under Windows and DOS. The DOS stub loads the Windows executable in memory, and fixes up its imports so that it calls the DOS implementation of Win32 APIs. On Windows, the stub is skipped and the real Win32 is used. It's not perfect, and last time I checked years ago, Windows had checks to ensure some ostensibly Win32 executables ran in DOS instead, due to buggy extenders that (I presume) took liberties in their Win32 implementations comedyblissoption posted:strong typing means stuff i like and weak typing means stuff i dont like Strong typing means pressing your keyboard keys very hard
|
# ? Jul 19, 2016 10:11 |
|
hackbunny posted:You totally can. Lots of DOS extenders implemented the Win32 API, some to an insane degree (graphics, sound, etc. one hobbyist extender even implemented part of DirectX), so yes, you could literally run the same identical executable under Windows and DOS. The DOS stub loads the Windows executable in memory, and fixes up its imports so that it calls the DOS implementation of Win32 APIs. On Windows, the stub is skipped and the real Win32 is used. It's not perfect, and last time I checked years ago, Windows had checks to ensure some ostensibly Win32 executables ran in DOS instead, due to buggy extenders that (I presume) took liberties in their Win32 implementations hackbunny posted:Strong typing means pressing your keyboard keys very hard
|
# ? Jul 19, 2016 10:55 |
|
hackbunny posted:Strong typing means pressing your keyboard keys very hard Would you recommend using the forehead or the chin for super strong typing?
|
# ? Jul 19, 2016 15:17 |
|
ModeSix posted:Would you recommend using the forehead or the chin for super strong typing? Use your heels, get those glutes involved. I recommend using an IBM model M though, the steel backplate ensures it survives the extra load. It also makes everyone in the office aware how strongly you are typing.
|
# ? Jul 19, 2016 15:26 |
|
hackbunny posted:
That reminds me of one of the easier ways I used to make 32bit DOS applications when I only had Borland C++, was to build it as a Win32 executable and then graft on the DOS extender because I couldn't afford Watcom. You had to have different pathways for DOS SVGA and WinG (the predecessor of DirectX) which made debugging interesting, to say the least.
|
# ? Jul 19, 2016 17:25 |
|
One Eye Open posted:That reminds me of one of the easier ways I used to make 32bit DOS applications when I only had Borland C++, was to build it as a Win32 executable and then graft on the DOS extender because I couldn't afford Watcom. You had to have different pathways for DOS SVGA and WinG (the predecessor of DirectX) which made debugging interesting, to say the least. I take it back I guess. This is some poo poo though.
|
# ? Jul 19, 2016 18:56 |
|
hackbunny posted:Coding horrors: Strong typing means pressing your keyboard keys very hard
|
# ? Jul 19, 2016 21:53 |
|
I want to bash my head against a wall right now. We have an API that does the following:
.. this exists in several places. Who on earth thought this was a good idea? Why wasn't whatever that other method doing refactored into a separate method? Who thought this was maintainable?
|
# ? Jul 20, 2016 09:50 |
|
toiletbrush posted:When I first 'got' lambdas/LINQ etc I started writing all my code this way, but had this weird gut feeling that it was wrong. The only thing I've been able to come up with in the last few years is that it sucks to debug when you get an error later on in the chain and want to check an intermediate result. If you're using VS you can evaluate enumerations using the 'watch' window. I've been copy and pasting the expressions, which is a little annoying. There's got to be a better way... Otherwise you can use the 'dissassembly' window and step through it instruction by instruction. I felt the same way, until a total stranger showed me some of their code that used that sort of heavily functional c# style. It was one of the few times I looked at someone elses code and could tell what they doing almost immediately.
|
# ? Jul 20, 2016 10:49 |
|
TZer0 posted:I want to bash my head against a wall right now. Probably no one. It's the type of thing you get when you have several people who refuse to touch anything other people are working on.
|
# ? Jul 20, 2016 12:10 |
|
"Hey, the text in these elements can't be longer than 25 characters or it throws the rest of the page off, can you make it so that this weird overflow thing doesn't happen?" "Kay." JavaScript code:
|
# ? Jul 20, 2016 14:45 |
|
Pollyanna posted:"Hey, the text in these elements can't be longer than 25 characters or it throws the rest of the page off, can you make it so that this weird overflow thing doesn't happen?" Should be (0, 22) + '...'
|
# ? Jul 20, 2016 15:08 |
|
leper khan posted:Should be (0, 22) + '...' Oh, don't get me started. I gave him a little more credit than is due in that post, because he's actually the one that came up with the 25 character limit rather than it being specified in the requirements. Which means that he actually didn't do what he himself said was required, and even hosed that up. I asked him how he came to the 25-character conclusion and he just said that was kind of how it looked to him, and when I pointed out that he's actually returning 28 characters instead he was like "oh yeah uhhh it's supposed to be 28 characters I misspoke". The if !$('.help-button').is(':visible') line is also supposedly meant to check if we are in a mobile view or not. The presence of the help button is completely irrelevant to the viewpoint/window size, and we already have a media query for our mobile view in our stylesheets. There is also absolutely no need for this to be handled via Javascript, at all. I implemented what he was trying to do in four lines of CSS. That sure as poo poo is better than some Javascript that isn't even properly implemented. I am absolutely piss-awful at front-end design and styling, and even I know more than this jackass does, and this is supposedly his expertise.
|
# ? Jul 20, 2016 15:14 |
|
I'm pretty sure everyone doing web design is just cutting and pasting examples from google searches and randomly adjusting values until it looks right. CSS is a cool idea but goddamn if it's not harder than building rockets.. at least a rocket is governed by known formulas.
|
# ? Jul 20, 2016 15:20 |
|
I hate CSS as much as you do, don't get me wrong. But this is a clear case of using the wrong/more inappropriate tool. I feel like this is much, much easier to accomplish via CSS, and there has to be a way to do it somehow. I don't want to prescribe a solution, not at all, but I just feel dirty manipulating HTML instead of adding some kinda style.
|
# ? Jul 20, 2016 15:51 |
|
well yeah you almost certainly just want to set a max width and text-overflow:ellipsis
|
# ? Jul 20, 2016 15:54 |
|
Jabor posted:well yeah you almost certainly just want to set a max width and text-overflow:ellipsis Pretty much, the one thing we're stuck on is how to calculate max-width since it's dependent on some weird poo poo. The person in question was pretty miffed when I questioned their approach and was utterly mystified why I wasn't satisfied with it when it "worked on my machine".
|
# ? Jul 20, 2016 16:05 |
|
Obviously the solution is to render the Web page in pdf format with latex so you can use its robust formatting system.
|
# ? Jul 20, 2016 16:11 |
|
Klades posted:Obviously the solution is to render the Web page in pdf format with latex so you can use its robust formatting system. Or at least it would compute the badness for the overfull hboxes...
|
# ? Jul 20, 2016 16:22 |
|
Pollyanna posted:There is also absolutely no need for this to be handled via Javascript, at all. Today I had to open a defect entitled "Don't modify CSS stylesheet contents dynamically at run time".
|
# ? Jul 20, 2016 16:38 |
|
OddObserver posted:Or at least it would compute the badness for the overfull hboxes... The concept of "badness" gives me a chuckle every time I compile a LaTeX document.
|
# ? Jul 20, 2016 17:08 |
|
Pollyanna posted:I hate CSS as much as you do, don't get me wrong. But this is a clear case of using the wrong/more inappropriate tool. I feel like this is much, much easier to accomplish via CSS, and there has to be a way to do it somehow. I don't want to prescribe a solution, not at all, but I just feel dirty manipulating HTML instead of adding some kinda style. Text-overflow: ellipsis. What drives me insane is the circlejerk about not using tables, but then using divs and separate js library for the divs to have the same height. This coming from our css guys, when: 1) it's doable by using css alone, 2) the js that they are using is so botched together that it extended the rendering of page by 4s. canis minor fucked around with this message at 17:26 on Jul 20, 2016 |
# ? Jul 20, 2016 17:23 |
|
xzzy posted:I'm pretty sure everyone doing web design is just cutting and pasting examples from google searches and randomly adjusting values until it looks right. In a previous job I was doing web scraping and : I would totally believe it.
|
# ? Jul 20, 2016 18:18 |
|
canis minor posted:Text-overflow: ellipsis. That's what I suggested. He seems to disagree and instead wanted to just put span { word-break: break-all; }. This doesn't work if you have text without spaces like "aaaaaaaaaaaaaaaaaaaaaaaaa", so it's technically incorrect, but arguing that point with him is like the last thing I want to do right now so whatever.
|
# ? Jul 20, 2016 19:30 |
|
xzzy posted:CSS is a cool idea but goddamn if it's not harder than building rockets.. at least a rocket is governed by known formulas. There's also the advantage that a rocket that works on one launchpad is typically also going to work on a different launchpad that (supposedly) provides the same facilities, and not explode in a giant fireball the moment the countdown starts. This is not quite so with CSS and different browsers last I checked.
|
# ? Jul 20, 2016 23:55 |
|
xzzy posted:I'm pretty sure everyone doing web design is just cutting and pasting examples from google searches and randomly adjusting values until it looks right. CSS is basically black magic. It's incredibly powerful but at the same time might summon a demon that burns the city down.
|
# ? Jul 21, 2016 00:07 |
|
Visual Studio is dark and full of horrors. As if the Windows API wasn't terrible enough to work with (yeah, in the year 2016, let's keep identifying every single system object as structureless recast void pointers ), I somehow managed to get Intellisense to stop working.
|
# ? Jul 21, 2016 00:08 |
|
ToxicSlurpee posted:CSS is basically black magic. You can just type whatever the gently caress style you want into a web browser's F12 debugger and it'lll show up live, realtime. There's no excuse for being poo poo at CSS.
|
# ? Jul 21, 2016 04:45 |
|
Bruegels Fuckbooks posted:You can just type whatever the gently caress style you want into a web browser's F12 debugger and it'lll show up live, realtime. There's no excuse for being poo poo at CSS. I've never had to look at CSS, so I imagine I'm poo poo at it.
|
# ? Jul 21, 2016 05:09 |
|
leper khan posted:I've never had to look at CSS, so I imagine I'm poo poo at it. CSS is fine.. you're just setting properties on objects to control how they look. Any idiot can grok that. The horrible part comes from all the block/inline relative/absolute positioning interactions. And then throw in browser incompatibilities and clients who insist on a specific layout that isn't technically supported and you'll start considering shooting yourself to ease the pain.
|
# ? Jul 21, 2016 05:17 |
xzzy posted:CSS is fine.. you're just setting properties on objects to control how they look. Any idiot can grok that. I'm almost certain you just said, "CSS is poo poo." You might as well say, "Communism is awesome, it's just the implementations that are bad."
|
|
# ? Jul 21, 2016 05:59 |
|
CSS is fine if you can use flexbox
|
# ? Jul 21, 2016 06:08 |
|
Centripetal Horse posted:You might as well say, "Communism is awesome, it's just the implementations that are bad."
|
# ? Jul 21, 2016 07:55 |
|
CSS for style is relatively sane. "I want to make this thing have a larger font and this background color". CSS layout is where insanity begins. Layout is about the relationships between objects, and CSS's "select one object" approach does not tend to fare well to that.
|
# ? Jul 21, 2016 07:57 |
|
Suspicious Dish posted:CSS for style is relatively sane. "I want to make this thing have a larger font and this background color". You can do BEM, but unfortunately around here we end up with rules like: .button-green or .section > .section_superheader > .section_superheader_title
|
# ? Jul 21, 2016 08:45 |
|
TZer0 posted:I want to bash my head against a wall right now. That's a monolithic microservice architecture if you ask me.
|
# ? Jul 21, 2016 09:20 |
|
Absurd Alhazred posted:Visual Studio is dark and full of horrors. As if the Windows API wasn't terrible enough to work with (yeah, in the year 2016, let's keep identifying every single system object as structureless recast void pointers ), I somehow managed to get Intellisense to stop working. This is totally normal, and happens with great frequency when you're constantly compiling and editing. Eventually intellisense just crashes silently while trying to constantly to get definitions until you restart VS. Super fun.
|
# ? Jul 21, 2016 10:38 |
|
Suspicious Dish posted:CSS for style is relatively sane. "I want to make this thing have a larger font and this background color". Another fun design-by-programmer horror is the collection of built-in layout managers in Java's Swing library. I remember a friend of mine trying to make a fairly simple resizable GUI using GridBagLayout and he just gave up in despair after two solid days of fighting it. You'd honestly have a tough time purposefully making something worse. Thankfully he discovered MigLayout, which has the grid model combined with CSS-a-like styling - one of those rare miracles where programmers with design skills actually released something that wasn't a videogame.
|
# ? Jul 21, 2016 20:20 |
|
|
# ? Jun 7, 2024 18:01 |
|
Found an amazing horror at work a few weeks back. IAR embedded workbench for ARM, a compiler and IDE package which is the stinking living embodiment of pure poo poo, doesn't warn you when a declared function signature doesn't match its actual usage at the point of call. This means incorrect code generation, overwritten/undefined parameters and all around serious business. And it just so happened that it affected the core state machine dispatch function which is burned into ROM and cannot be patched. By pure luck it works, because by chance one of the missing parameters is placed in the same CPU register after another function is done and nothing overwrites at an inopportune time. There's no guarantee that some ill-timed interrupt won't break it though. You never know. Thank god it wasn't life critical.
|
# ? Jul 21, 2016 20:45 |