[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

>when you write really sloppy code without bothering to release

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 49
Thread images: 1

File: oF5WWTS.png (70KB, 557x605px) Image search: [Google]
oF5WWTS.png
70KB, 557x605px
>when you write really sloppy code without bothering to release resources but it works fine because of the garbage collector

How did anyone even program back in C++ times?
>>
>>8398546
You mean back before stackoverflow gave everyone a place to copy paste from?
>>
>>8398600

Exactly senpai. Coding is so easy today, you just throw in any random shit that seems similar to the problem you're trying to solve and let the built in safety features of your modern language figure out the rest.
>>
>>8398546
>a literal CS brainlet

Memory allocation isn't hard, faggot. You literally just count up the "news" and the "deletes" in your code, and if the numbers don't match up, just add a few to the end of your main function to even it out.
>>
>>8398616

>count up the "news" and the "deletes" in your code
>not using constructors and destructors

Learn to RAII brainlet.
>>
>>8398546
>when you write really sloppy code without bothering to release resources but it works fine because of the garbage collector

This when I program Java and vb.net. I love how easily you can ask for memory in these languages. Makes development so easy, specially in a work environment where you usually want to move fast.

>How did anyone even program back in C++ times?

That said, you should probably learn real programming in C++. C++ is such a beautiful tool and it is so fundamentally different from languages like Java that it feels like doing something else.

When I'm doing my job I try to find excuses to use C++. This one time I had a function that did thousands of multiplications and even though it didn't matter, I jumped right into a C++ project and made a .dll tha handled that part in C++.

I also made a SQL Editor on C++ where I just type in the names of the columns and what goes in and then it immediately builds the code that I then copy paste into vb.net. Love it. If C++ was a girl I would fuck her.
>>
>>8398631

Believe it or not I wrote a turing complete (proved through implementing the primitive recursive functions) language / interpreter at work entirely in standard library C++. After obsessing with C++ for about a year though I realized it's a lot more enjoyable to just use C# for everything because then you don't have to think. It's similar to spending a year walking everywhere because you know it saves you lots of money and is good for your health but eventually caving in and just taking taxis everywhere instead. Even something as simple / basic as making a SQL connection and executing a query is a nightmare in C++, let alone trying to make SOAP calls.
>>
>>8398654
Yeah, that is why for everything practical I use Java and visual basic. I only use C++ in two cases:

If it is something related to computations where I will have really independent code, just a function that does additions and multiplications in C++ so that it goes a billion times faster than its visual basic equivalent.

If it is something really simple like the SQL editor I described.

Otherwise back to babby languages for me. It is all about finding a balance in practicality, enjoyment and efficiency. Babby languages provide practicality and C++ brings enjoyment and efficiency so if you mix it up you got yourself some fucking good code.
>>
>>8398546
>what are smart pointers
>>
>>8398665

Except you don't just "have some fucking good code." Switching between languages haphazardly in the same project adds needless integration and deployment complexity, and it also adds needless bloat between system modules at their interfaces.
>>
>>8398631

>copy and pasting
>thinks he's some kind of top-notch developer

I'm getting really sick of cringing so much every time I'm on this Chinese opera board.
>>
>>8398546
>when you write really sloppy code without bothering to release resources but it works fine because of the garbage collector
this doesn't make any sense
>>
>>8398654

I hope you realize that primitive recursive functions are not a sufficient condition for Turing completeness. This fact is inherent because any implementation primitive recursive function is guaranteed to halt, while the following is not true for a Turing machine.

Is everybody in this thread pulling shit out of their asses? It's no wonder CS catches shit on this board.
>>
>>8398704

Yes, it's technically the μ-recursive functions that prove it, but in practice by the time you get primitive recursion you've already done everything else.

>Is everybody in this thread pulling shit out of their asses?

No, you're just being a pedant.
>>
>>8398712

Nope, it's not. The set of primitive recursive functions is PR in computational complexity. PR is strictly contained in R, the set of all recursive languages (meaning that they are not equivalent). The function which stands as a counterexample is the Auckermann function, which is in R but not PR.

In order for your language to be Turing complete, you need to be able to simulate any Turing machine; i.e., you must be able to simulate a Turing machine deciding any language in R. Since R and PR are not equal, being able to implement the primitive recursive functions does -not- make your language Turing complete.

What will it take for you to admit that you have no idea what you're talking about?
>>
>>8398684
>Switching between languages haphazardly in the same project adds needless integration and deployment complexity,

Adding simple DLLs does not really add that much complexity, specially if you know how to keep them simple. I do no classes or anything fancy like that. Just functions that take in a couple of variables, do the heavy lifting and then send back the results.

The longest dll I've written was like 50 lines of code.

>>8398689
I copy and paste the code produced by a program I wrote... how is that something a bad programmer would do?

I have to do many SQL queries all the time and when you have to insert into tables with many columns the commands get long but you notice that they are really repetitve. SQL commands are repetitive and predictable. The only things that change are the columns and what goes inside them. So why not write a program that takes a list of columns and a list of inputs in order and then constructs the command that inserts it and update it?

It took me maybe an hour and now it has saved from having to manually write hundreds of SQL commands.
>>
>>8398721

>being able to implement the primitive recursive functions does -not- make your language Turing complete.

I specifically said it *wasn't* just primitive recursion here:

>>8398712

>Yes, it's technically the μ-recursive functions that prove it

It's part of it, not all of it. But the parts of it that aren't the primitive recursion function aren't as big of a deal to implement e.g. it's not very difficult to make the constant function:

f(x) = 0
f(10) = 0
f(48) = 0
f(72) = 0
>>
>>8398724

And what sort of code review process does your product undergo where it's acceptable to randomly decide to create arbitrary DLLs? In what way do you document the dependencies to these various DLLs? How do you manage those dependencies?

>specially

I don't really think you know anything about writing 'good code' at all.

>copy and pasting

A good programmer creates a system that doesn't require a future developer to know to copy and paste various undocumented queries generated by some ad-hoc utility. He would develop something else that makes ingestion intuitive and, above all, within the scope of documentation.
>>
>>8398735
>And what sort of code review process does your product undergo where it's acceptable to randomly decide to create arbitrary DLLs?
What makes you think people "randomly" create "arbitrary" DLLs?
>>
>>8398731

You really have absolutely zero clue what you're talking about.

>partly prove

If you've only partly proved something, you haven't proved anything. Being able to implement partially recursive functions does not imply that you can implement all μ-recursive functions.

Also, constant functions? What does that prove? That's just one of the initial recursive functions. You can implement a constant function with a DFA that has access to an output tape, and DFAs are clearly not Turing complete.
>>
>>8398740

The fact that a specific person in this thread mentioned that he likes to "mix it up" and create DLLs "even though it didn't matter."
>>
>>8398744

In order to implement the μ-recursive functions, part of what you need to do is implement primitive recursion.

>If you've only partly proved something

I never said I *only* implemented primitive recursion. I mentioned it initially because it's the part that's least obvious to figure out.
>>
>>8398735
What the fuck is going on with your posts? They get more retarded by the second. You are trying to scrutinize my methods but it makes no practical sense at all.

>And what sort of code review process does your product undergo

It doesn't go through any formal process but I do have a lot of free time almost always so I always end up re-reading code and optimizing because browsing 4chan for entire office days feels bad.

>randomly decide to create arbitrary DLLs?

I do not randomly decide to create arbitrary DLLs. I have emphasized the word 'computations' many times but I did not think I would have to get into detail.

Okay, you know how I use visual basic? Well, that shit is slow as fuck and when I have to do literal thousands of multiplications in a single procedure, the program took minutes to finish so I decided to take the part that was doing the heavy lifting, turned it into C++ and then what would previously take 2 minutes was done in 3 seconds.

I did this very late in development where everything else was done and I had to show it to clients but I realized how tedious it was to have to wait that long and simply addin a progress bar was not gonna cut it.

If your work does not involve a bunch of heavy lifting you would not get my reasoning but hopefully you get the idea of when I would choose to ask C++'s helping hand.

Also, let me tell you a secret: specially and especially are both accepted writings of the word, autist.

>A good programmer creates a system that doesn't require a future developer to know to copy and paste various undocumented queries generated by some ad-hoc utility. He would develop something else that makes ingestion intuitive and, above all, within the scope of documentation.

Do you know anything about programming? My program that generates queries is not fundamental to anything. It simply mimics what I would normally do by hand. If another programmer came in he would read the generated queries and think a human did it.
>>
>>8398746
I missed that. Pretty gay.
>>
>>8398746
>"even though it didn't matter."

It didn't matter because it made no difference if the program took 2 minutes or 2 seconds to finish a process.

But unlike other people, I am not fucking mediocre at what I do.
>>
>>8398748

>(proved through implementing the primitive recursive functions)

This is what you said, and what you said was blatantly false.

Where do you work? I'm just curious. I have a hunch that you don't work at one of the companies more renowned for their software engineering and computer science practices, but I honestly wouldn't be surprised if there are people at these companies who are faking it.
>>
>>8398755

The problem is that it does matter with respect to how 'good' the code you produce is, and the fact of the matter is that what you stated is a bad practice which leads to bad code. You should be ashamed for trying to influence others to follow suit.
>>
>>>/g/
>>
>>8398759
>the fact of the matter is that what you stated is a bad practice which leads to bad code.

It is not a bad pratice. What the hell? Do you know why physics engines are written in C++? Why most math-related libraries are in C?

Think about it for a second. You have a programming language meant to create applications. It is good at letting you create pretty windows with pretty buttons fast but when it comes to doing calculations it is pretty slow.

If you need to do something simple like multiply a couple of numbers then who cares, you do it in that language because it takes no time.

But what happens when you have a single function that takes your programming language a whole minute to process? Remember that in the eyes of your client, who is using it, this means two things:

1) Two minutes of staring at a blank screen, potentially with a green progress bar as the only thing that tells him that his program has not crashed.

2) Two minutes of not being able to work

I have to ask, what kind of software have you written in your life? I don't get how you cannot understand the NEED to use compiled languages within applications written in interpreted languages.
>>
>>8398546
>le garbage collector meme

Go back to >>>/g/ brainlet.

A garbage collector won't manage "resources" for you. It manages memory, period. You still have to take care of file descriptors, locks, sockets, threads, textures, etc. manually. Of course a Pajeet like you just couldn't be bothered with such inconveniences, and just keep shitting out spaghetti code like diarrhea.
>>
>>8398749

What's going wrong with my posts is that I'm increasingly revealing things that you either (a) haven't been exposed to, (b) have been exposed to but cannot find the attention span or intellectual means to comprehend. Everything I'm mentioning has practical relevance.

>no formal process

This is an automatic indicator of bad code. Good code undergoes thorough review (human standard) and manual testing (white-, black-, and grey-box). Even better code goes through formal verification tools. Yours meets none of the above criteria and is therefore guaranteed to be shit.

>random DLLs

You stated that you "mix it up" and create DLLs "even though it didn't matter." This and my intended interpretation of "randomly" are synonymous.

>do I know anything about programming?

Why, yes, yes I do. I hold a BS and a MS in computer science; my specialization was in software systems and theoretical computer science. Aside from graduating with honors from both of these programs, I've also published first-authored papers in my areas of specialty. In the past, I've been employed to develop large, complex (by necessity, not choice) code-bases for large FFRDCs (namely network security for critical infrastructure), and I currently work for a Google/Microsoft-tier company that I will not name for privacy reasons.
>>
>>8398756

>This is what you said, and what you said was blatantly false.

Like I wrote earlier, in my own personal experience that was the part of the μ-recursive functions that was least obvious, so it was what I cited as proving it even though there are other, less difficult parts that technically go into it.

By analogy I could say I won the world series of poker with a flush and you could argue that isn't technically true because you can't win the world series of poker with just one hand. But in making that argument you'd be taking the comment more literally than you ought to.
>>
>>8398765

I do know why physics engines are written in C++ and C. Do you understand why their code-bases don't introduce dependencies on external binaries without a well-documented reason? Do you know why the ones which are still surviving integrate those dependencies into a larger review and testing process process?

What you're not realizing is that I'm not objecting to the periodic necessity of moving between high-level interpreted languages and lower-level languages like C. I'm objecting to the rationale and development mindset where you're just going to "mix it up" "even though it doesn't[didn't] matter," and "get some fucking good code."
>>
>>8398770
>You stated that you "mix it up" and create DLLs "even though it didn't matter." This and my intended interpretation of "randomly" are synonymous.

But I explained myself quite well here. I said that you need practicality and efficiency (and enjoyment but we can ignore that here).

Easy languages like visual basic give you practicality. You get an e-mail and by tomorrow you have a completely working prototype with huge forms with a hundred of text fields and stuff. Setting that up in C++ would be a nightmare when in visual basic it is reduced to drag and drop.

Then C++ achieves efficiency by providing muscle where muscle is needed.

Everythin you think I meant, you clearly took out of content because I already explained myself.

>Good code undergoes thorough review (human standard) and manual testing

I have no one to check my code. I am trusted and for good reason. Also, Visual Studio has a tool that checks how good your code is and I get a 70/100.

The scale goes like this:
0 - 10 bad
10 - 20 okay
20 - 100 good

So I am pretty up there my man. I know what I am doing.

>Why, yes, yes I do. I hold a BS and a MS in computer science

I hold a BS in mathematics so checkmate.
>>
>>8398771

I suppose you also don't understand the gravity of the word "proved." As in, "I proved [x] by [y]." A proof is not the same as the synopsis of a game of poker.

In computer science, and in any application of computer science with any relevance, if you claim that you have proved something, you need to fully justify that claim. If you do otherwise, you will not be taken seriously, nor should you expect to be taken seriously. In even simpler terms, if you want to give somebody advice on a topic for their own growth, you need to fully justify (or give resources to obtain justification) anything you're claiming that the other person to conclude.

For both of these reasons, I am unable to take you seriously, and I sincerely hope that any person who might look to this thread for any sort of input related to this field also not take you seriously.
>>
>>8398777

>BS in mathematics
>Getting told by a person with two CS degrees that you need to fully substantiate a claim of a proof

Yeah, right. Why don't you go back to writing that code that neither you nor anybody else will review?
>>
>>8398777
>Also, Visual Studio has a tool that checks how good your code is and I get a 70/100.

Oh my god. Please move away from the computer RIGHT NOW!
>>
>>8398779

>gravity of the word

Do you know where you are right now?
>>
>>8398774
>without a well-documented reason?

But I do have well documented reasons.

My reason is that visual basic is not good enough to handle long computations. It is ridiculous, you have no idea.

> I'm objecting to the rationale and development mindset where you're just going to "mix it up" "even though it doesn't[didn't] matter," and "get some fucking good code."

Again you are taking 'it doesn't matter' and 'mix it up' in the wrong way. I already explained both sentiments.
>>
>>8398784
>>Getting told by a person with two CS degrees that you need to fully substantiate a claim of a proof

Just so you know, I am not the guy with the Turing machine. I could not care less for that shit anyways.
>>
>>8398774

You're holding him to a way higher standard than what's reasonable. Remember that literally one in five formal peer reviewed genetics papers have the same Microsoft Excel formatting error where genes are converted into datetimes. That's not even saying how many geneticists are using Excel as their database, just how many of that population who on top of using Excel as a database had their data screwed up by auto-formatting.

http://www.popularmechanics.com/science/a22577/genetics-papers-excel-errors/
>>
>>8398777

>visual basic rating 70/100
>pretty up there, my man

I'm 70% certain that you're trolling at this point.

For the record, I'm not trying to roast you for the sake of making you feel dumb. I'm trying to get you to realize that, at minimum, the descriptions and explanations you gave in this thread can be easily interpreted as something that could potentially be detrimental to somebody's career.

Nothing wrong with working for yourself, either. An hour of 4chan will turn even a well-intended criticism into what probably comes off as an attack.
>>
>>8398794
>>visual basic rating 70/100

Visual Studio, not visual basic. Look up the visual studio code review mechanism. It is actually pretty accurate and everything above 20 is marked as good but 70 is like ultra fucking good.
>>
>>8398788

Also, yeah, I can imagine that visual basic is pretty terrible. I personally tend to avoid it/have no reason to work with it in my specific domains.
>>
>>8398793

I hold everybody to a high standard. Some people might not see it as realistic, but the hope is that some of the shit I give people translates into something useful.
>>
>>8398795

My mistake; I conflate visual basic with Visual Studio because most people I know who have some reason to work with it also work in Visual Studio.

I personally don't believe in automated code review as far as the (automated verification is another issue) current state-of-the-art is concerned. It is better than nothing, though; I'll give you that.
>>
>>8398808
https://msdn.microsoft.com/en-us/library/bb385914.aspx

>Maintainability Index – Calculates an index value between 0 and 100 that represents the relative ease of maintaining the code. A high value means better maintainability. Color coded ratings can be used to quickly identify trouble spots in your code. A green rating is between 20 and 100 and indicates that the code has good maintainability. A yellow rating is between 10 and 19 and indicates that the code is moderately maintainable. A red rating is a rating between 0 and 9 and indicates low maintainability.

and this is the formula:

Maintainability Index = MAX(0,(171 – 5.2 * log(Halstead Volume) – 0.23 * (Cyclomatic Complexity) – 16.2 * log(Lines of Code))*100 / 171)

Looks pretty accurate to me. Supposedly this thing has been around since the 90s and people have been making it better and better.

By the way technology evolves, something invented in the 90s would now be absolutely perfect. The way shitty phones in the 90s are now beautiful, beautiful iphones.
>>
>>8398818

This method is basically just a combination of a measure on how 'voluminous' the vocabulary of your program is, how many lines of code there are, and the degree of branching present in possible execution paths.

It's probably an -okay- heuristic, but it's hard to automate things like standards enforcement (there are tools to assist, though), and it's just not as good at directed bug detection as a fresh pair of eyes actually combing through the code.
>>
>>8398802

>I hold everybody to a high standard.
>the hope is that some of the shit I give people translates into something useful.

You can stifle the creativity that would have otherwise lead to novel and useful things by trying to make all coding done by the books with formal team based development models with rigid change control. PHP and Python both had their starts at hobby projects written by developers with questionable coding habits. It's like musicianship in that sense. The Beatles and Jimi Hendrix didn't know how to read music and obviously didn't attend Juilliard, but you wouldn't want music to be limited to just the works of formal conservatories.
Thread posts: 49
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.