|
I have this same problem too and what really helps is getting out a pencil and paper and drawing (the minimal) system You'll start out really abstract and with iterative re-drawing you should start to get a feeling of how the boxes should be broken apart into sub-boxes and with experience you should be able to get an idea of how they should be coded. It's not unreasonable to spend several hours doing this until you get your head in the right place imo
|
# ? Oct 7, 2017 01:27 |
|
|
# ? Jun 5, 2024 06:11 |
|
jony neuemonic posted:e/n incoming i get this - especially if you're in a larger company where a lot of the work is extension and addition. some tips * think backwards. who's the customer of this? what do they actually want? Once you have an idea of what they want, you can start figuring out how to get them it * Come up with the set of constraints you're working under. Try and really pick the constraints that have to absolutely be fulfilled * Talk to your coworkers about your idea. Rubber ducking helps but getting a fresh pair of brain hemispheres helps more * Be conservative. Assume that your group is going to have to own this, and that every new concept you bring in is yet more cognitive load. The clearest example of this is bringing in a new language that nothing else uses or knows. * Write out a design. Take notes, do some prototyping, come up with your data model and interactions. Write up a design doc that hits these 1. What is this all for? Often times you know how exactly what you mean when you say "Frothing Bit Reaper" but unsuprisingly a lot of your peers won't. Explaining what this is and why we're doing this is important for context 2. Remember those constraints from that other bullet? Add these in too. Without those, someone reading your doc will think you're making the wrong decision because they lack the context of the constraints you're operating under. 3. Go into medium-level detail. Be specific enough that you could hand the doc off to someone else to code it up, but general enough that you haven't literally done all the work It turns out that "measure twice, cut once" is very applicable to software development, and having a document on hand that explains the what, why, and how of the project is really helpful for the actual implementation of said project
|
# ? Oct 7, 2017 01:27 |
|
quiggy posted:no templates ¯\_(ツ)_/¯ quiggy posted:dynamic_casting Action pointers to learn their types, but that's too slow one, I'd be careful of what you ask for as I doubt full reflection (and boxing/unboxing values) would be faster than dynamic_cast, two, you could look into typeid as an alternative, and three you've basically done everything that can be done. I doubt even post-c++03 could help you in any way
|
# ? Oct 7, 2017 02:00 |
|
quiggy posted:boy c++ it sure would be nice if you had literally any reflection at all no see according to stroustrup such things are unproven and if they can't be done in a way that adds no overhead whatsoever for code that doesn't actively use it then they shouldn't be part of his language while in the audience at the Q&A where he said that—about both reflection and dynamic linkage standards—I did some measurement; ObjC2's metadata only adds about 10-15% to binary size, most of which (other than selectors) isn't paged in until used eschaton fucked around with this message at 02:29 on Oct 7, 2017 |
# ? Oct 7, 2017 02:24 |
|
i miss the amiga library's wacky linked list inheritance inheritance scheme on the jaguar
|
# ? Oct 7, 2017 03:12 |
|
eschaton posted:no see according to stroustrup such things are unproven and if they can't be done in a way that adds no overhead whatsoever for code that doesn't actively use it then they shouldn't be part of his language yes, and meanwhile apple recommends switching to Swift, which doesn't have the dynamic dispatch overhead or the process startup delay
|
# ? Oct 7, 2017 03:36 |
|
thanks for the advice, all. this thread rules.
|
# ? Oct 7, 2017 03:38 |
|
let c++ be c++. if you want to use objective c instead of c++ (or together with it, like with objective c++), do it, what's stopping you except a trillion practical issues
|
# ? Oct 7, 2017 03:39 |
|
jony neuemonic posted:e/n incoming practice it's mostly about avoiding the pitfalls than getting things right first time the worst code is always an extensible mess, that requires changing things all over the code base, to support some need that never materialised quote:i think i'm pretty good at working with existing stuff and i haven't had much trouble walking into some pretty gnarly projects and getting a handle on things, but whenever i get asked to build something from scratch i panic and deliver (imo) pretty bad work. welcome to the other end of the sewer quote:it's real demoralizing because i don't want to do bad work, and it makes what should be a good opportunity (no more legacy code!) into a huge source of stress. bad code gets fixed, good code rots, but lovely code lasts forever
|
# ? Oct 7, 2017 04:18 |
|
the best advice i could give would end up rephrasing this effort post i made in this or the other thread, ages ago http://programmingisterrible.com/post/139222674273/write-code-that-is-easy-to-delete-not-easy-to but really, it's still the same old stuff i keep banging on about
|
# ? Oct 7, 2017 04:23 |
|
oh my god there's an open source java library that adds await for completeablefutures and it's from electronic arts of all people??? https://github.com/electronicarts/ea-async
|
# ? Oct 7, 2017 06:15 |
|
Luigi Thirty posted:i miss the amiga library's wacky linked list inheritance inheritance scheme on the jaguar implement your own version of it, you know you want to, and people totally do that sort of thing my friend wrote most of a SEGA Genesis game that never shipped using Apple's "OO assembly" macros that were mainly intended to provide interoperability between high-performance assembly code and MacApp application-layer code written in Object Pascal and I wrote most of an Objective-C runtime for 68K and PowerPC on the classic Mac OS when CodeWarrior added ObjC support to their compilers way before Mac OS X was ever released
|
# ? Oct 7, 2017 06:20 |
|
speaking of the forums… maybe I should restart my little project to write an NNTP server in Common Lisp
|
# ? Oct 7, 2017 06:22 |
|
if dynamic cast would be optimal but it isn't efficient enough you can very easily hack up your own dynamic cast based on either virtual calls or (probably better) information you store in the base class. if your boss is dead-set against templates, well, be thankful that you only have four cases to support. something likeC++ code:
this is basically what we do pervasively in llvm/clang/swift where we care a lot about casting and generally don't want to pay for v-tables
|
# ? Oct 7, 2017 08:39 |
|
contributing to the ghost post war
|
# ? Oct 7, 2017 12:01 |
|
ah I get it, ghost posts break the offset feature of Awful.app (where it only loads the new posts)
|
# ? Oct 7, 2017 12:03 |
Maluco Marinero posted:ah I get it, ghost posts break the offset feature of Awful.app (where it only loads the new posts) initially we had last unread post being show as read. then thread began pointing to non-existent post at n+1, causing page load issues on the last post of the page since it then points at a thread that does not exist
|
|
# ? Oct 7, 2017 12:17 |
|
the terrible programmer thread is a very appropriate place for n+1 errors
|
# ? Oct 7, 2017 12:27 |
|
rjmccall posted:if dynamic cast would be optimal but it isn't efficient enough you can very easily hack up your own dynamic cast based on either virtual calls or (probably better) information you store in the base class. if your boss is dead-set against templates, well, be thankful that you only have four cases to support. something like i thought about doing it this way as well, and may end up switching over to it if i ever learn that there's more cases i need to support
|
# ? Oct 7, 2017 14:50 |
|
redleader posted:the terrible programmer thread is a very appropriate place for n+1 errors Also a good place for multiple, sightly different implementations of the same post!
|
# ? Oct 7, 2017 15:55 |
|
[quote="“CPColin”" post="“477145304”"] Also a good place for multiple, sightly different implementations of the same post! [/quote] but i thought golang was unpopular here
|
# ? Oct 7, 2017 17:47 |
if my calculations are right, there will be a 13 post window opening in microsoft thread after 3 more posts
|
|
# ? Oct 7, 2017 17:48 |
|
We need YOU to shitpost the microsoft thread back to life. *edit* and also this one Chalks fucked around with this message at 19:34 on Oct 7, 2017 |
# ? Oct 7, 2017 18:19 |
|
TIL thatJava code:
that would have been good to know before I went and twisted myself into pretzels trying to get some generics to work the way I wanted them to. Sapozhnik fucked around with this message at 20:54 on Oct 7, 2017 |
# ? Oct 7, 2017 20:52 |
|
eschaton posted:implement your own version of it, you know you want to, and people totally do that sort of thing sounds good to me, time to do some 68K magic code:
e: oh cool it does pre:AmigaList is at 0x74960 head node is at 0x749a0 head->ln_Succ is at 0x74a00 head node's name is Node1 head->ln_Succ node's name is Node2 head->ln_Succ->ln_Succ node's name is Node3 tail node's name is Node3 Luigi Thirty fucked around with this message at 05:25 on Oct 8, 2017 |
# ? Oct 8, 2017 03:25 |
|
Serendipity has made it official. I'm done with my task at hand I've been working on refactoring the build system at work. It was pretty poo poo a few weeks ago - coders had to `make clean` before every build. Gradually I improved it, and a few days ago I thought it done, but not feeling satisfied I pressed on, inventing and testing new ways of improving the system. Things that nobody will probably ever use or appreciate, but damnit those things mattered, because the less you have to gently caress with Makefiles the better. Thus I toiled throughout the nights and weekend days, determined to leave the system at nothing less than optimal. Well just a few mere minutes ago I believe I reached that point was nothing could be thought of to to add or remove. Now I usually like to let my playlist run on shuffle while I work. As I made my final mass sed replacement, a soothing crescendo of synthetic horns - unrecognized to me but nonetheless pleasant - made its way through my speakers. A few moments of reviewing the effects of the sed command, I was ready to test those final changes. No sooner had I entered 'bash test_make_all.sh' into my shell and the familiar spewing of the compiler commands begun scrolling through the console than those soothing horns led into - I poo poo you not - the unmistakable opening chords from the loving theme of loving chariots of fire.. So I watched in awe as over 20 different `make -j sometarget &` processes simultaneously spewed their outputs to the console and wept a tear of joy and danced a giddy dance as serendipity of the moment overwhelmed my soul with the purest joy. Gentlemen, I'm done.
|
# ? Oct 8, 2017 13:50 |
|
cool now port the build to meson and groan at how much time you could have saved
|
# ? Oct 8, 2017 16:39 |
|
Still undecided on typescript vs flow for this reactjs side-project. I rather wish this rift didn't exist tbh Flow: - Written by a bunch of guys who love javascript so much they wrote a type checker for it in ocaml. - poo poo performance under windows. Supposedly. - The main IDE is Atom. What the gently caress even is Atom. How do I do anything beyond notepad.exe's capabilities with this goddamn bullshit. - Yeah you can kind of use it from VSCode but the integration is third-party and really crappy and you have to rip out half of VSCode to make it work so wtf is the point. - I erroneously wrote "import type * as types from 'whatever'" and this sent it into a crash loop. One crash loop per CPU core, as a matter of fact. - There are already two incompatible versions in wide use. - Facebook's whole dev tooling landscape in general is really vertically integrated and keeps wanting to drag in other poo poo of theirs. + Works with create-react-app out of the box (misnomer: this is a canned build system for react projects with sane defaults). + Facebook is stuck with this poo poo so they have to keep React and Immutable and all their other crap sort-of working with it. + Supposedly a stronger type system, and was in fact developed in response to perceived weaknesses in the design and objectives of TS. TypeScript: - Not a first-party solution: poo poo will break and I have to hope that people will be entertained by the process of fixing it. - Don't know the details but the type system has impedance mismatches with Redux and Immutable.js. See above. - Supposedly has a weaker type system than Flow. + I can edit it from VSCode and VSCode doesn't make me want to punch somebody + Has first-party support from redux-saga. + Has wider first-party support in general. Like there's a Protobuf library that emits TypeScript stubs, no such luck for Flow. Honestly my main problem with Flow is that I really hate Atom from what little I've seen of it.
|
# ? Oct 8, 2017 17:08 |
atom is basically like significantly slower, worse visual studio code. they recently shat an "ide" addon out through the door but it's still hot garbage clown bait
|
|
# ? Oct 8, 2017 17:11 |
imo i'd go with typescript unless type system impedance mismatches are going to wreck the ball hard or you really can't get flow in something adequate (say, webstorm)
|
|
# ? Oct 8, 2017 17:13 |
|
cinci zoo sniper posted:atom is basically like significantly slower, worse visual studio code. they recently shat an "ide" addon out through the door but it's still hot garbage clown bait how long is it gonna take y'all to learn emacs is the one true path
|
# ? Oct 8, 2017 17:14 |
Notorious b.s.d. posted:how long is it gonna take y'all to learn emacs is the one true path
|
|
# ? Oct 8, 2017 17:15 |
"computer programming tooling was solved in 1754 by otto von bismark XVIII" - notorious bsd
|
|
# ? Oct 8, 2017 17:15 |
|
Notorious b.s.d. posted:how long is it gonna take y'all to learn emacs is the one true path elisp is poo poo and vimscript is double dog hypershit. atom is unironically a potentially better editor than both emacs and vim because it's built on top of javascript. yes, javascript is bad, but enough developers are stuck in this loveless marriage that the developer community is forced to somehow make javascript itself work. modern editors are a text entry widget bolted on to a programming language, in much the same way that an A10 is an enormous gun that somebody mounted a plane onto. the choice of underlying language is crucial.
|
# ? Oct 8, 2017 17:24 |
|
typescript is better, but what would be much better is if one group would just give up. we don't need two type-definition-annotation languages for javascript
|
# ? Oct 8, 2017 17:55 |
|
Gul Banana posted:typescript is better, but what would be much better is if one group would just give up. we don't need two type-definition-annotation languages for javascript (They also have a pointless different fork of Ocaml that appears to exist purely due to bikeshedding and NIH syndrome.) mystes fucked around with this message at 18:16 on Oct 8, 2017 |
# ? Oct 8, 2017 18:14 |
|
mystes posted:(They also have a pointless different fork of Ocaml that appears to exist purely due to bikeshedding and NIH syndrome.) jfc lol oh, something else: typescript files have a .ts extension instead of .js, as you'd expect flow files have a // @flow line instead reeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
|
# ? Oct 8, 2017 18:17 |
|
both flow and typescript are completely unnecessary. just use babel and write javascript
|
# ? Oct 8, 2017 18:32 |
|
akadajet posted:both flow and typescript are completely unnecessary. just use babel and write javascript
|
# ? Oct 8, 2017 18:38 |
|
|
# ? Jun 5, 2024 06:11 |
|
if you are writing so much javascript that you need typescript to fix it, you're writing too much javascript. your javascript should really end at form validation and even that should just be the one line that adds the unobtrusive validator.
|
# ? Oct 8, 2017 19:04 |