i have been trying to skip the chocolate, but... now that you excplicitly listed it...
The Big Programming Thread - Page 503
Forum Index > General Forum |
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. | ||
nunez
Norway4003 Posts
i have been trying to skip the chocolate, but... now that you excplicitly listed it... | ||
spinesheath
Germany8679 Posts
On July 26 2014 01:11 nunez wrote: ah, i walk around before i make decisions. i prefer not to make decisions. i have been trying to skip the chocolate, but... now that you excplicitly listed it... Delaying decisions is good style anyways. | ||
one-one-one
Sweden551 Posts
On July 25 2014 05:21 boon2537 wrote: Hey, guys. I'm a junior C.S. major student but I'm still a noob at everything. My first language is python, then I learned some C++ and made some basic data structure with it, and after that I mostly use java. And now, I'm making simple Unity game for fun in C#. To be more marketable, is it worth learning and getting good at C or should I just focus on C# and java? I feel besides optimizing systems, the benefit of being good at C is understanding low-level issues which most people wouldn't care. But, then again, I know nothing. What do you guys think about this? In general, when deciding which languages to learn, you should prioritize cross platform languages and languages which do not rely on proprietory IDEs or licenses, preferably open source ones. Skills in C have proven to be very useful throughout the entire history of computer programming, a very rare thing in this discipline. Study all the C you can. It will be time well spent. Python is also a very solid language. The more you can study it the better. My thinking is that Python and C complements each other very well. Java skills are also useful, but I would prefer Python. Especially since you stated that Python was your "first" language. Don't bother about learning C#. It is far more likely that the languages mentioned above will still be useful in 10 years. For all you know, C# might be completely obsolete then. Ignore the tips about learning Scala and Haskell. Anyone suggesting that to you does not know what he is talking about. | ||
spinesheath
Germany8679 Posts
| ||
one-one-one
Sweden551 Posts
On July 26 2014 03:03 spinesheath wrote: Don't learn languages, learn programming. An empty statement. Of course, learning to program is one of the goals. Another obvious goal is to know a set of languages which makes you a competitive and employable programmer. You can "learn to program" in QBASIC, Delphi and Javascript if you want, but you might run in to trouble when you try to find a job. | ||
Shield
Bulgaria4824 Posts
On July 26 2014 03:25 one-one-one wrote: An empty statement. Of course, learning to program is one of the goals. Another obvious goal is to know a set of languages which makes you a competitive and employable programmer. You can "learn to program" in QBASIC, Delphi and Javascript if you want, but you might run in to trouble when you try to find a job. Not an empty statement at all. For example, OOP principles are language independent, thus it doesn't matter if you use Java, C++'s OOP, Python, etc. Besides, a lot of fuctionality has the same or similar syntax in various languages. switch case, for loop to name a few. Of course, you'll have to, at one point, get familiar with a language's API. | ||
one-one-one
Sweden551 Posts
On July 26 2014 03:34 darkness wrote: Not an empty statement at all. For example, OOP principles are language independent, thus it doesn't matter if you use Java, C++'s OOP, Python, etc. Besides, a lot of fuctionality has the same or similar syntax in various languages. switch case, for loop to name a few. Of course, you'll have to, at one point, get familiar with a language's API. I agree that a lot of concepts are language independent. But you'll be better off if you also learn to implement those concepts in a relevant language. My argument is that since you have to learn OOP, procedural programming , functional programming and what have you, you might as well do it in a language that is useful in the industry. I don't really understand why we debate such an obvious thing. The guy asked for specific advice. Give him that. | ||
spinesheath
Germany8679 Posts
C# isn't going to go away for the next couple of years, so it's as good of a starting point as any language. Learning functional languages like haskell and scala is a good investment into the future. Functional programming is on the rise for very solid reasons. Multithreaded environments being the major one. Generally, languages are volatile and you might want to switch to a completely new language a year or two down the road. Especially now that commonplace large scale multithreading is on the horizon, which few current languages are particluarly good at. | ||
one-one-one
Sweden551 Posts
On July 26 2014 04:49 spinesheath wrote: It really doesn't matter a whole lot what language you learn. Your focus is what matters, and your focus certainly shouldn't be on language-specific stuff. C# isn't going to go away for the next couple of years, so it's as good of a starting point as any language. Learning functional languages like haskell and scala is a good investment into the future. Functional programming is on the rise for very solid reasons. Multithreaded environments being the major one. Generally, languages are volatile and you might want to switch to a completely new language a year or two down the road. Especially now that commonplace large scale multithreading is on the horizon, which few current languages are particluarly good at. It does indeed matter which language you learn. Even if your knowledge about concepts is super duper awesome there is still a certain depth in any language you chose. It is all the little things you only learn by using the language a lot and studying best practices. With good fundamentals you can reach medium proficiency in most programming language by using it for some time while reading a good book about the language. Mastering a language requires good fundamentals _and_ time. If you want to have a competitive edge on your profile I suggest that you start mastering a few languages as soon as you can. Preferably languages that's gonna stay relevant. Recommending C# is risky. This is gonna lock you into a Microsoft ecosystem and might also not be applicable at all if you wanna do embedded systems or other areas where .NET is not deployed. Learn Java instead if this type of language appeals to you. Python is a good choice since it is a multi paradigm language. In version 3.x the functional aspects of the language are made even more powerful. When it comes to parallel programming Python has good bindings to OpenCL which is a very useful API to know. Also, coding OpenCL kernels is done in C, so there is an example of a good Python - C synergy. Given the limitations caused by physics on chip design, CPUs are gonna stay cache heavy with < 16 cores for the foreseeable future, limiting the need for languages like scala. Hardware with >> 16 cores are gonna be GPU like and therefor only be capable of running a very simple set of instructions and have a lot of limitations imposed on them such as not supporting recursive function calls. OpenCL with kernels in C is what is gonna be used to program these. | ||
Manit0u
Poland17046 Posts
On July 26 2014 02:51 one-one-one wrote: Ignore the tips about learning Scala and Haskell. Anyone suggesting that to you does not know what he is talking about. Hey, I never told him to learn Scala. I just mentioned it as an option after he learns Java so that he can get into another paradigm and expand his skillset (and since Scala can use Java libraries and runs on JVM it's a much easier leap than C# -> Haskell for example). All being said, I still think that Lisp (and its numerous dialects) is king, but there are little chances of finding a job in that department (unless you're very very good, which takes a lot of time). It might be good to learn it at one point though, just to change the way you think about programming. I mean, just read this piece of loveware and tell me it's not magnificent... And an extra quote for emphasis: Eric Raymond wrote: Lisp is worth learning for the profound enlightenment experience you will have when you finally get it; that experience will make you a better programmer for the rest of your days, even if you never actually use Lisp itself a lot. And an obligatory link: http://www-formal.stanford.edu/jmc/recursive.html How many other programming languages can show you the academic paper in which they were designed/defined? (it's an awesome read if you want to get "behind the scenes" on programming language logic) | ||
RoyGBiv_13
United States1275 Posts
On July 25 2014 12:39 broodbucket wrote: I'm writing a shell. Anyone have any advice on how to handle foreground/background processes? Pipes and redirection seem pretty easy. Hi broodbucket, No one addressed your question yet, so I figure I'll give it a shot. It's understandable why, very few people have written shells, and those that have probably gave up at around the exact same point. It's important to gauge where you are so far. Do you have a threading/process spawning library implemented at all, or are you just starting running processes? In the foreground case, you'll either want to fork your shell process to exec the program, or just exec from the shell process. Both have merits and cases that could cause issues. Once you have a thread spawned from fork, you'll need to wait for a signal in the original thread before continuing, though, so it's easiest to just "exec()" from the parent if you don't want to handle that. The background case is similarly full of pitfalls. If you recognize the "&" as the final character, you'll need to spawn a new process.Once the process is created, before you exec into the program running, you'll need to setup your signal handling and redirection. You'll need to be careful to watch for the end of the process in the parent process so that you can clean up any zombie tasks, or bring the task to the foreground if you want (via redirection). If you're doing this as part of an OS class, then hopefully this sort of programming is fresh on your mind so it's not too much trouble. Please do let me know (via pm or in this thread) where you're at so far so I can give a more direct response. Any example code is appreciated. | ||
icystorage
Jollibee19343 Posts
bad code debugging in a nutshell | ||
Blisse
Canada3710 Posts
On July 24 2014 13:09 phar wrote: You might want to first ask why you need some parts of your code to know about the logging from other parts of your code. idk, i'm not designing an enterprise system, i want my viewmodels to write logs in an abstract manner so anything listening can just listen for logs without caring what the object is. and i want to minimize code duplication and not constantly rewrite a bunch of helper methods just to log something. i don't think it's reasonable to have me reconsider why i have the logging system in the first place, i just want it to, and from my perspective these are reasonable problems. i could just make my viewmodelbase implement the logger and for the most part i would be done, but i want to know how i could implement methods on an interface-like structure so that deriving classes already have implementations of the interface, but the structure doesn't incur multiple inheritance. also i want to emphasize again it's not a priority for me to finish the project, i'm really doing most of this to just learn about how to design systems and stuff, idea being if *you* were to design something with unlimited time, how would you do it. (refactor system completely?) | ||
obesechicken13
United States10467 Posts
Should you use the user's id or username to match their post details? One of my groupmembers linked two tables with username and I feel like there's something wrong with this but can't say why. I tried googling but that didn't return the right results. Table1 Users ID username 1 Blisse 2 icystorage 5 obesechicken13 7 RoyGBiv_13 Table Posts ID User_ID Thread Post 1 1 Big%20Programming%20Thread blah%20blah%20blah 2 1 ... 3 2 ... 4 5 ... Or ID Username Thread Post 1 Blisse Big%20Programming%20Thread blah%20blah%20blah 2 Blisse ... 3 icystorage ... 4 obesechicken13 ... ? I guess it'd be faster to use user_id but I don't think that'd be noticeable for a small project. And when a user changes their username, the posts would all have to change too. | ||
Nesserev
Belgium2760 Posts
| ||
obesechicken13
United States10467 Posts
On July 27 2014 13:05 Nesserev wrote: All of your remarks are valid: It's way more efficient (lookup times, comparisons, storage, ... : int vs string) and practical (cleaner,, more dynamic, etc.) to link everything to ID's. In general, it's good practice to keep a separate table for everything that has an ID, and link via ID's only; it's just so much cleaner that way. That said, if you haven't yet (and it's relevant), get a separate table for your threads too. Yeah, the forum thing was just an example and is not really what we're building. By separate table do you mean relational tables like only these columns? UserID ThreadID PostID I had to make these for ER model diagrams but never really saw the need for them. And was never asked to make a table with all the IDs because that didn't really fit in the ER model diagram. | ||
Blisse
Canada3710 Posts
On July 27 2014 13:05 Nesserev wrote: All of your remarks are valid: It's way more efficient (lookup times, comparisons, storage, ... : int vs string) and practical (cleaner, more dynamic, etc.) to link everything to ID's. In general, it's good practice to keep a separate table for everything that has an ID, and link via ID's only; it's just so much cleaner that way. That said, if you haven't yet (and it's relevant), get a separate table for your threads too. So, you should get something like:
looool edit for more content: i bought a kinect v2.0 for windows, any ideas on what i should program for it? | ||
raNazUra
United States9 Posts
| ||
Nesserev
Belgium2760 Posts
| ||
Mr. Wiggles
Canada5894 Posts
On July 27 2014 14:56 raNazUra wrote: Question: Do you guys have any recommendations for coding competition websites? I realize a lot of people don't really care about them, so this may be a miss, but I've done the Google Code Jam for the last few years and really enjoyed it as for-fun algorithms puzzles, but it only rolls around once a year. http://uva.onlinejudge.org/ Contains a ton of problems. It has all (lots of?) the problems used in the ACM ICPC. They range from easy to exceptionally hard. | ||
| ||