|
AFAIK the memory "metadata" (its current size, the current array capacity, the pointer to the array, and any other bookkeeping) for the Vector is allocated statically. typically the actual data part of the Vector is going to be stored in an array that is dynamically allocated on the heap. the location and size of this dynamically allocated array on the heap can change as you add elements.
|
# ¿ Mar 8, 2017 13:59 |
|
|
# ¿ May 9, 2024 21:45 |
|
the vector as used above will not cause memory leaks. using a static vector doesn't cause memory leaks just because it is static. a static vector won't ever be "freed" AFAIK (maybe there's special rules on program exit? I have no clue) if you're new to C++, you have to be aware of the memory unsafety pitfalls of using vectors. look up reference invalidation and iterator invalidation with vectors. the golden rule of thumb is to not hold any reference to the data while doing any operation that could invalidate references. using an iterator is equivalent to holding a reference to the data. operations that can invalidate references will include adding to the vector, compacting the vector, clearing the vector, removing elements from the vector, etc. basically anything that could invalidate a reference by marking that memory as freed. you could think of it as "mutating" the array. an illustrative example of use after free of potentially terrible things happening: https://monoinfinito.wordpress.com/2015/04/14/c-invalidating-references-to-elements-in-a-vector/ code:
comedyblissoption fucked around with this message at 15:12 on Mar 8, 2017 |
# ¿ Mar 8, 2017 14:35 |
|
Bloody posted:c++ is like the last row in that brain enlightenment meme
|
# ¿ Mar 8, 2017 23:57 |
|
St Evan Echoes posted:never use the vs git client, it is so so bad
|
# ¿ Mar 14, 2017 17:27 |
|
use sourcetree instead
|
# ¿ Mar 14, 2017 17:27 |
|
MALE SHOEGAZE posted:i wrote this scala function and it's so perfect and beautiful i wish i could share it. in my world a function is considered not good. you must create and instantiate an object that wraps the function. then you have to use dynamic reflection to inject it into another instantiated object as a dependency. then you have to make sure the object implements an interface. then depending on the flavor of kool-aid you have to create a mock of any other functions wrapped in objects implementing interfaces your function might depend on. this is considered best practices. lol kill me and our industry
|
# ¿ Mar 18, 2017 02:53 |
|
MALE SHOEGAZE posted:i have been looking at and messing with this mongo data model for a few hours now and i just don't get it at all.
|
# ¿ Mar 21, 2017 03:21 |
|
any editor can do what any other editor can do in theory. it's more about what you emphasize. emacs emphasizes text-based interfaces over gui widgets. you don't end up with text embedded in UI elements that you can't navigate or search or copy. you don't have to hunt for poo poo in nested gui menus. almost everything is just plain old text and you can manipulate this in universal ways. emacs emphasizes ergonomic use of the computer. ergonomic in this case means using primarily a home row hand position and not constantly having to shift your hands to the arrow keys or mouse. this can enable very fast workflows for text editing. you can think of it like the difference between playing an RTS game using only the mouse and playing an RTS game while using all the hotkeys. if you don't care about this emacs is not for you. this approach has a disadvantage of a large up-front learning cost. emacs emphasizes less visual clutter. you tend to have just the relevant information you want with everything else removed. i think these basic principles give emacs a certain aesthetic and user experience that can't be matched by other editors that rely primarily on GUI-based and mouse based interactions. as an example, managing multiple files in emacs and recalling the ones you want is way more manageable than fiddling with unsearchable tabs in visual studio that overflow the top of the screen. there are pros/cons with any approach. youre not gonna be an ubermensch by using emacs, but if its principles appeal to you youre gonna have a more pleasant time. if another editor has much better code support than emacs for a particular language, you should still use that. I still use visual studio for C#. comedyblissoption fucked around with this message at 11:01 on Mar 21, 2017 |
# ¿ Mar 21, 2017 10:26 |
|
spacemacs is a good batteries included emacs. you can also use holy mode (like i do) if you don't like vi modal editing.
comedyblissoption fucked around with this message at 10:34 on Mar 21, 2017 |
# ¿ Mar 21, 2017 10:31 |
|
gonadic io posted:Thanks for summing up the problem with keyboard interfaces
|
# ¿ Mar 21, 2017 23:51 |
|
Bloody posted:keyboard interfaces struggle from generally having terrible discovery. fun fact: all that poo poo you complain about being buried in an ide's menus somewhere is also accessible via keyboard commands a gui editor could in theory allow itself to be discoverable and keyboard driven in the way emacs is, but the difference in philosophy puts their emphasis elsewhere. typically gui editors don't expose potential keybindings in the universal way emacs does for almost all its functionality. the amount of key bindings is generally incomplete. the keybindings for text navigation and editing is also typically really lovely, and the defaults often use arrow keys for text navigation which is terrible ergonomically. the benefit you are getting here with non-gui discoverability is the screen looks aesthetically minimalist instead of having a giant amounts of bells and whistles and text that is irrelevant the vast majority of the time. this is mostly a preference thing though.
|
# ¿ Mar 22, 2017 00:03 |
|
a trackpad is insanely worse than a good mouse
|
# ¿ Mar 22, 2017 00:04 |
|
Bloody posted:ya theres a mismatch between "workin in an editor" and "workin in an ide" but its mostly self-inflicted. i find vim to be superior for text manipulation than visual studio's text editor. i find the rest of visual studio dramatically better for software development than any imaginable combination of command-line tools and text editor plug-ins. i prefer to make the tradeoff towards the ide, as i personally do not find the text editing portion of software development to be the long pole in the tent. when there is no ide available, as is the case with fpga development, then i will use a good text editor with plug-ins as a next-best thing. the text editing part of the experience improves, but the experience on the whole is inferior due to the lack of tight semantic integration. you have to remember that emacs is still GUI but with primarily text-based interfaces. it's not just a raw terminal editor. it can have squigglies under text showing errors and graphics in the margins and poo poo. the main issue with emacs is it's typically volunteer driven and so it doesn't have the same resources for code-based tooling that companies backing GUI-based IDEs can throw at the problem.
|
# ¿ Mar 22, 2017 00:09 |
|
anthonypants posted:this sounds insanely bad from a usability perspective also it's good for functionality that isn't used often but I still use from time to time. as an example, i can just hit m-x occur and find what i want and it will let me regexp search my current text buffer and then spit it out to another window with all the matching lines. i don't need to remember a dedicated keybinding for that. the alternative typically provided in a gui based editor is context switching to the mouse and taking a few seconds to find where the functionality is. comedyblissoption fucked around with this message at 00:15 on Mar 22, 2017 |
# ¿ Mar 22, 2017 00:10 |
|
Bloody posted:go is bad http://sitr.us/2017/02/21/changes-i-would-make-to-go.html
|
# ¿ Mar 22, 2017 00:16 |
|
intellj sounds cool on accomodating keyboard-driven usage
|
# ¿ Mar 22, 2017 03:17 |
|
Wheany posted:are you describing "find?" my main point is that i don't have to remember a hotkey for it or where it sits in some nested gui somewhere under "advanced". i can just type the functionality i want and execute it.
|
# ¿ Mar 22, 2017 18:25 |
|
HoboMan posted:here's something i never understand: in emacs all the commands get notated like "M-x" what does that mean? press m then x? press m and x at the same time? shift + m + x? shift + M then x? or is it one of the first two except M stands for coMmand or something dumb like that? something completely different? pressing control and the key x is C-x pressing shift and the key x is just notated as X pressing control and alt and the key x is C-M-x this notation is explained in the emacs tutorial and used in the documentation some of the terminology is historical baggage because emacs is ancient. M stands for meta which used to be a key on certain ancient keyboards.
|
# ¿ Mar 22, 2017 18:30 |
|
liking modal editing vs key chords is probably based on personal preference and how your hand is built. some people have a hard time using ctrl key combinations and rebind ctrl but for me it's very easy.
|
# ¿ Mar 22, 2017 18:30 |
|
my coworkers are hopped up on creating .net microservices just because can someone kill the cottage industry making up these buzzwords and fashion trends
|
# ¿ Mar 24, 2017 01:46 |
|
Maluco Marinero posted:it's concerning how much stock developers put into not understanding css. or at least, they want a framework to 'take the pain of css away', missing that most frameworks aren't nice clean abstractions of CSS and thus don't really obviate the need to actually understand CSS unless you follow their examples. a lot of the "css frameworks" like bootstrap are a blessing because they help get you some basic layouts without having to learn absurd hacks. even flexbox alone isn't good enough for general purpose layout afaik region based layouts are still experimental poo poo
|
# ¿ Mar 24, 2017 23:30 |
|
what im saying is people would probably in general be more open to properly learning css if it wasn't historically such a steaming pile of poo poo. idk if it's actually gotten any better (i have low hopes)
|
# ¿ Mar 24, 2017 23:35 |
|
if youre writing tests make sure the only things you ever mock are interfaces external to your program (e.g. file system, network calls). mocking too much and having a bunch of useless tests is a very common trap someone told me that you shouldn't even mock at all and design your program so it's easy to test everything w/o even calling out to external systems. i dont have experience w/ this at all but maybe he's right.
|
# ¿ Mar 25, 2017 22:27 |
|
fleshweasel posted:this sometimes works. all you do is write a deterministic function that does your business logic, then write a wrapper function that does I/O or network poo poo and then runs your business logic on the stuff that come from disk or network. it falls short when you conditionally need to do a fetch based on the results of another fetch, etc. because you either have to just fetch everything upfront or do some kind of sequencing in your function that directly touches I/O that pretty much turns it into a business logic function. rust doesnt really have a mocking library afaik and i was wondering how people do tests in rust. i guess the best you can do is passing in a test version that mocks a trait and try to limit this to the outermost shell of your program.
|
# ¿ Mar 25, 2017 23:24 |
|
it's okay to let things fall over to the next sprint for whatever reason. your velocity will self-adjust. someone who isn't sick can just pick up something else from the backlog and not have to close out that story. of course i know people (e.g. business stakeholders) instead want to follow a process that doesn't align with reality at all and want everything committed to in a sprint to be finished in a sprint which causes all kinds of absurd issues. but yah pushing to the remote at the end of day in a branch if you have anything is a good practice
|
# ¿ Mar 29, 2017 05:11 |
|
Arcsech posted:Had a meeting today to propose moving to a better branching model than "let's have 60 developers clusterfuck master"
|
# ¿ Jul 26, 2017 09:29 |
|
|
# ¿ May 9, 2024 21:45 |
|
Notorious b.s.d. posted:how long is it gonna take y'all to learn emacs is the one true path
|
# ¿ Oct 9, 2017 09:46 |