• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

Programming |OT| C is better than C++! No, C++ is better than C

Chris R

Member
I recently got an internship and I got hired despite not knowing anything about C# and .net stuff. They said they expect to do a lot of self learning to catch up which is fine. What is the best and clearest tutorial/free class online to get myself caught up on C# and .net?

I fooled around with the one VS generated for you to understand a basic web page and that's the only thing I have ever done with C# & .Net.
Well...

What kind of stuff are you going to be doing with C# and .Net?
 
Well...

What kind of stuff are you going to be doing with C# and .Net?
I haven't really gotten briefed exactly what myself and another intern will be doing but I got the overview of the system today. But for the most part, I believe my work load will consist of back end stuff of designing a web system, ASP.net Web applications w/ MVC to be precise. Some SQL server communication is going to be required as well.
 

Tristam

Member
Jesus mixing PHP and HTML is such a mess. I wanted to go with the route of throwing in php whenever I needed it instead of wrapping the whole file in it but between indentation and syntax highlighting is a clusterf in Sublime.

Does anyone have any advice on this? Does an IDE like PHPstorm alleviate this issue?

Edit: Apparently I just need to look into Heredoc?

I would recommend separating your presentation layer from your logic layer. Your HTML should reside in templates and I recommend keeping as minimal as possible the control flow (via PHP) that you insert into your templates. PHP has good MVC frameworks, like Laravel, to assist you in achieving this separation.

I know this doesn't directly address your concern, but in a well-designed application you don't need to concern yourself with your IDE syntax highlighting/indentation rules because your PHP and HTML would be 99% separate.
 

Koren

Member
Does someone the best way to create PDF forms (fillable PDF with text box, radio buttons and list boxes) that allow validation?

By validation, I mean I don't want something else than a value in the list for list boxes, mostly, and if possible, I'd like to be able to check whether the values aren't obviously invalid for dates in text boxes. Dream situation, I can check that two list boxes don't contain the same value.

I managed to create PDF forms that work with Libreoffice Writer, it's just that it allows me to fill anything in the list boxes, that's annoying :/ Maybe I missed something (Writer is not really helpful when you design forms for the first time...).

For information, I'd like to do application forms (that I can parse later with a script, but PDFMiner in Python seems to do the trick). Granted, a form on a webpage may be easier to validate, but there's security concerns and I'm not able to deal with server security.

a=b=0 works in lots of other languages too where assignment is an expression (most C-like languages), which probably why it works in Python as well (you're assigning "a" the result of "b=0" which is 0). I generally prefer a, b = 0, 0 because it's much clearer.
Yes it is, and Python says you should try to make things clearer. I don't understand why they choosed to allow this syntax (to do the same as other languages, obviously, but they got rid of plently of other syntaxes). To me, "a=b=0" suggests that "b=0" returns 0, which is totally false in Python (doesn't work in function calls, since it'll be handled as named arguments, and neither in expressions, where you'll get a syntax error)

I think it's also inconsistent, since
Code:
def f(x, y) :
    return x+y

f(x=y=0)
returns a syntax error too.

The Rust subreddit is doing an April Fool's thing again and it's glorious:
https://www.reddit.com/r/rust/
Seems there were a lot of April fool stuff... What are you talking about?
 
Seems there were a lot of April fool stuff... What are you talking about?

.
m7JtDhU.png
 

Makai

Member
Does anyone know how to render a bitmap to a window in Cocoa? I have a software renderer that makes a bitmap, then blits it to the screen. It's all working on Windows, but I can't figure out how to do that on Mac. Here's a simplified version of what I have so far - it's in Rust, but should be readable to a Swift programmer:

Code:
use cocoa::base::nil;
use cocoa::foundation::{
    NSPoint, NSAutoreleasePool, NSProcessInfo, NSString
};
use cocoa::appkit::{
    NSApplication, NSWindow, NSTitledWindowMask, NSBackingStoreBuffered, NSMenu, NSMenuItem,
    NSRunningApplication, NSApplicationActivateIgnoringOtherApps
};
use parse::Data;

pub struct Window {
    width: u16,
    height: u16,
}

impl Window {
    pub fn new(width: u16, height: u16) -> Self {
        unsafe {
            let _ = NSAutoreleasePool::new(nil);
            let app = ::cocoa::appkit::NSApp();

            app.setActivationPolicy_(::cocoa::appkit::NSApplicationActivationPolicyRegular);

            let menu_bar = NSMenu::new(nil).autorelease();
            let menu_item = NSMenuItem::new(nil).autorelease();

                menu_bar.addItem_(menu_item);
                app.setMainMenu_(menu_bar);

            let app_menu = NSMenu::new(nil).autorelease();

            let quit_item = {
                let title = {
                    let prefix = NSString::alloc(nil).init_str("Quit");

                    prefix.stringByAppendingString_(NSProcessInfo::processInfo(nil).processName())
                };
                let action = ::cocoa::base::selector("terminate:");
                let key = NSString::alloc(nil).init_str("q");

                NSMenuItem::alloc(nil).initWithTitle_action_keyEquivalent_(title, action, key).autorelease()
            };

            app_menu.addItem_(quit_item);
            menu_item.setSubmenu_(app_menu);

            let window = {
                let rect = {
                    let point = NSPoint::new(0., 0.);
                    let size = ::cocoa::foundation::NSSize::new(width as f64, height as f64);

                    ::cocoa::foundation::NSRect::new(point, size)
                };

                NSWindow::alloc(nil)
                .initWithContentRect_styleMask_backing_defer_(rect, NSTitledWindowMask as u64, NSBackingStoreBuffered, ::cocoa::base::NO)
                .autorelease()
            };

            window.cascadeTopLeftFromPoint_(NSPoint::new(20., 20.));
            window.center();

            let title = NSString::alloc(nil).init_str("Bulletfield");

            window.setTitle_(title);
            window.makeKeyAndOrderFront_(nil);

            let current_app = NSRunningApplication::currentApplication(nil);

            current_app.activateWithOptions_(NSApplicationActivateIgnoringOtherApps);
            app.run();
        }

        Self {
            width: width,
            height: height,
        }
    }

    pub fn update(&mut self, _: &Data) {
        let total_pixels = (self.width * self.height) as usize;
        let mut memory = vec![200_000_000, total_pixels];

        // TODO draw
    }
}

Just need to display a unique bitmap every frame - no layering or anything like that.
 
I've had the bizarrest experience with SetThreadExecutionState from the WinApi on a Surface Book and am hoping someone can help.

I've used it with System_Required | Continous both from a PowerShell script and within Python , powercfg -requests shows the System lock is requested but the Surface Book still sleeps after the Sleep timer goes off and the program is paused. However if I add Display_Required it works (ie the display is held on and the system doesn't sleep). What is going on here ?

Does System_Required have some very specific meaning that still results in programs doing I/O getting slept despite having it set ?

NB: I hate Microsofts overly aggressive power saving so much. Its counterproductive since it results in me disabling the power save features.
 
I've had the bizarrest experience with SetThreadExecutionState from the WinApi on a Surface Book and am hoping someone can help.

I've used it with System_Required | Continous both from a PowerShell script and within Python , powercfg -requests shows the System lock is requested but the Surface Book still sleeps after the Sleep timer goes off and the program is paused. However if I add Display_Required it works (ie the display is held on and the system doesn't sleep). What is going on here ?

Does System_Required have some very specific meaning that still results in programs doing I/O getting slept despite having it set ?

NB: I hate Microsofts overly aggressive power saving so much. Its counterproductive since it results in me disabling the power save features.

Not that it should make a difference, but I'd try it from C first to make sure
 

Koren

Member
I don't have a C setup installed on Windows atm, I tend to use Linux when I'm writing C (or pretty much anything low level honestly). What is the usual open source C setup for Windows these days ?
MinGW, I'd say (that's what I use more and more in replacement of Cygwin). Assuming you don't need POSIX.
 

Koren

Member
Thanks. I wouldn't need POSIX for this purpose I think.
I really doubt it, but I wanted to add it since it's the main reason to go to Cygwin instead of MinGW.

Just a warning, I almost never do specific Windows software, but IIRC, you need to download the WinAPI from MinGW website beside the compiler suite, because MinGW only come with headers by default, I think.
 

Somnid

Member
When designing a public API, is it useful to wrap certain classes to hide certain functionality?

Generally yes. Most traditionalist will say to build defensively and hide everything except exactly what you mean to expose and so if you are working in C++/C#/Java etc that will be the expectation. Coming from someone who works a lot in Javascript land where source is visible and private state isn't a part of the language I take a more relaxed approach (it also helps when your code is functions and models and not OO classes). Basically I expose anything unless I have a good reason not to (performance hacks etc), you simply don't know how the user will want to use what you built and they might need more than you actually gave them. Of course a lot of people depend on autocomplete so if you expose certain things it's more surface area for them to search through. If something is internal but exposed it's also a good idea to at least warranty tag it "if you use this, I'm not responsible for what happens" with an obvious naming convention.

Never make something sealed/final. That's just a dick move.
 

HelloMeow

Member
Generally yes. Most traditionalist will say to build defensively and hide everything except exactly what you mean to expose and so if you are working in C++/C#/Java etc that will be the expectation. Coming from someone who works a lot in Javascript land where source is visible and private state isn't a part of the language I take a more relaxed approach (it also helps when your code is functions and models and not OO classes). Basically I expose anything unless I have a good reason not to (performance hacks etc), you simply don't know how the user will want to use what you built and they might need more than you actually gave them. Of course a lot of people depend on autocomplete so if you expose certain things it's more surface area for them to search through. If something is internal but exposed it's also a good idea to at least warranty tag it "if you use this, I'm not responsible for what happens" with an obvious naming convention.

Never make something sealed/final. That's just a dick move.

I am familiar with that. Maybe I should have explained what I'm doing. I'm working on a modding API for my game. There's this one class called EventProvider that can provide customized events for certain systems. I want this functionality to be available in the modding API, but don't want to expose all of it, because that would mean I would have to expose all of these systems as well.

What I'm doing now is I wrap the modding API's EventProvider around an interface. So the game has an EventProvider class that implements this interface, and the modding API has an EventProvider that wraps around this interface. It does what I want, but I'd like to know if there's a better or a right way to do this.
 
I don't have a C setup installed on Windows atm, I tend to use Linux when I'm writing C (or pretty much anything low level honestly). What is the usual open source C setup for Windows these days ?

Visual Studio Community Edition.

Please don't use MinGW for anything. Ever.

If you really don't want an IDE, then download VS anyway and then use clang-cl (clang-cl requires headers and tools from the Visual Studio installation to run).

BTW, one reason I suggest trying this in C before jumping to any conclusions is because it's possible that the Python runtime and/or Powershell runtime are implicitly calling SetThreadExecutinoState() behind the scenes without you knowing about it, and overwriting your changes.
 

Somnid

Member
I am familiar with that. Maybe I should have explained what I'm doing. I'm working on a modding API for my game. There's this one class called EventProvider that can provide customized events for certain systems. I want this functionality to be available in the modding API, but don't want to expose all of it, because that would mean I would have to expose all of these systems as well.

What I'm doing now is I wrap the modding API's EventProvider around an interface. So the game has an EventProvider class that implements this interface, and the modding API has an EventProvider that wraps around this interface. It does what I want, but I'd like to know if there's a better or a right way to do this.

It depends. How much do you want to document? How much of your own mess do you want to hide? If you take something away/change something who are you going to piss off? Is your audience power users or novices? I don't think there's one-size fits all.
 

Koren

Member
Visual Studio Community Edition.

Please don't use MinGW for anything. Ever.
We will never agree on this ^_^

But you're wrong, he said open source, VC don't qualify. ;)

I'll grant you clang is often better than GCC (especially in the first days of C11), but t works perfectly well with MinGW...
 

hampig

Member
Hello all, I'm hoping to ask for a little bit of help.

I just got off a first interview with a place that seems really great. I think my skill set matches what they're looking for, and I honestly think I can do the job that they're asking. The thing is, I choke when it comes to interviews unless I really study up and reaffirm things before the interview.

The main things they seem to be interested in are C# and the .NET framework, SQL, some Database stuff, and some networking (physical and non) stuff.

Anyone have good recommendations for places to go just for quick refreshers on any of these topics for a intermediate? I have about a week.
 
We will never agree on this ^_^

But you're wrong, he said open source, VC don't qualify. ;)

I'll grant you clang is often better than GCC (especially in the first days of C11), but t works perfectly well with MinGW...

MinGW does not produce binaries that conform to the Microsoft ABI. I don't really see how one can make a stronger argument than that :-/ They are PE files, but they are not native Win32 executables. They aren't going to interoperate well when mixed with actual win32 executables. They aren't going to work with any standard windows tools for profiling or debugging. There are certain aspects of the Windows API you will *never* be able to use.

It's just wrong in every sense of the word, especially when there are free alternatives that work perfectly well.

And yes, he said open source, but I presume he meant "free".
 
MinGW does not produce binaries that conform to the Microsoft ABI. I don't really see how one can make a stronger argument than that :-/ They are PE files, but they are not native Win32 executables. They aren't going to interoperate well when mixed with actual win32 executables. They aren't going to work with any standard windows tools for profiling or debugging. There are certain aspects of the Windows API you will *never* be able to use.

It's just wrong in every sense of the word, especially when there are free alternatives that work perfectly well.

And yes, he said open source, but I presume he meant "free".

Nah, I meant suitable for open source production. I was hoping for something more native than Cygwin / MinGW and less Microsoft than VS but for an experiment like this it shouldn't matter much. I coulda sworn there was something back in 2004.

I'm not expecting a change here since neither Python nor PowerShell doing STES behind the scenes makes sense, for different reasons (Python because it largely avoids platform specific dependencies like that and PowerShell because its purpose as an administrative scripting tool means doing undocumented power management would be bizarre).
 
Nah, I meant suitable for open source production. I was hoping for something more native than Cygwin / MinGW and less Microsoft than VS but for an experiment like this it shouldn't matter much. I coulda sworn there was something back in 2004.

I'm not expecting a change here since neither Python nor PowerShell doing STES behind the scenes makes sense, for different reasons (Python because it largely avoids platform specific dependencies like that and PowerShell because its purpose as an administrative scripting tool means doing undocumented power management would be bizarre).

clang-cl seems like it fits the bill. More native than MinGW, less Microsoft than VS :)

I agree it would be weird if the behavior changed, but on the other hand, the more variables you can remove from the equation the better. Another possibility is that you have some other piece of software is injecting DLLs in your process and messing with your programs' behaviors. Motherboard utilities, AV software, etc. You can catch stuff like this by running your program under MSVC debugger and watch the DLL load notification messages in the Output window.

Edit: You might also try RegisterPowerSettingNotification and then registering for every possible notification, so that you can log the events leading up to your system entering sleep.
 
clang-cl seems like it fits the bill. More native than MinGW, less Microsoft than VS :)

I agree it would be weird if the behavior changed, but on the other hand, the more variables you can remove from the equation the better. Another possibility is that you have some other piece of software is injecting DLLs in your process and messing with your programs' behaviors. Motherboard utilities, AV software, etc. You can catch stuff like this by running your program under MSVC debugger and watch the DLL load notification messages in the Output window.

Edit: You might also try RegisterPowerSettingNotification and then registering for every possible notification, so that you can log the events leading up to your system entering sleep.

I suspect it's the USB drive, I think ES_SYSTEM only keeps the specific process awake and doesn't allow implied overriding of the USB being powered down, and that I should use AWAY MODE for this. Its the only reason I can see that Display works and System doesn't.
 

Koren

Member
MinGW does not produce binaries that conform to the Microsoft ABI.
Protecting the ABI with patents won't help...

I don't really see how one can make a stronger argument than that :-/ They are PE files, but they are not native Win32 executables. They aren't going to interoperate well when mixed with actual win32 executables. They aren't going to work with any standard windows tools for profiling or debugging. There are certain aspects of the Windows API you will *never* be able to use.
Well, yes... At the end of the day, it's a matter of priorities. I can see why it can be useful, but I just don't care. I value more the advantages of staying away from VS.

clang-cl seems like it fits the bill. More native than MinGW, less Microsoft than VS :)
There's a bunch of Clang, and I suspect we don't use the same ;)

Out of curiosity, do you know why clang-cl need some VS bits, and how that works in terms of strict copyright / licensing? I guess they tried to remain open-source (and that's the reason it doesn't support the full ABI) but I haven't spent time in this yet...
 
Protecting the ABI with patents won't help...
I don't know of any patents on the ABI. It's simply undocumented. Are you sure you're not referring to the debug info format, i.e. PDB files? There definitely are some patents surrounding that, but Microsoft has opened up quite a bit and published enough source code that one could generate their own PDBs from scratch by reading that source code. And the source code is BSD licensed, with comments indicating that they are trying to help LLVM / Clang generate PDBs. And LLVM / clang has been actively adding source code over the past few months to read / write the raw bits of PDB files. So, while I'm not going to comment on the legal aspects of patent issues, you are free to draw your own conclusions here.

Out of curiosity, do you know why clang-cl need some VS bits, and how that works in terms of strict copyright / licensing? I guess they tried to remain open-source (and that's the reason it doesn't support the full ABI) but I haven't spent time in this yet...

Just to be clear, when I talk about "The Microsoft ABI", I am talking about the rules governing the binary code produced by the compiler. Function prologues and epilogues, record layout, name mangling, object file format (i.e. section names etc), and things like that.

Based on this, clang-cl does support the full Microsoft ABI. It's 100% compatible, short of bugs (which you should report here). There are some non-ABI related differences, such as that it uses all of clang's diagnostics engine, supports the same set of C++ features that clang supports, etc. I think also there are a few really obscure Microsoft extensions that are not supported (although all of the more common / useful MS extensions are supported). And the reason they're not supported is because they're bad and/or unnecessary, not because of patents. Otherwise, clang-cl is intended to produce binary compatible object files and executables.

For example, you can generate a bunch of .obj files with clang-cl, then link them with Microsoft's linker.

So just to make sure we're on the same page, it does support the full ABI. (If you have a specific example in mind though, feel free to mention it and I'll try to address it).

With that out of the way, I haven't answered yet why clang-cl needs some VS bits. When you install VS you get, among other things, the following:

1. CRT and STL headers and libraries (e.g. <stdio.h>, <vector>, msvcrt.lib, etc)
2. Windows headers and libraries (e.g. <windows.h>, kernel32.lib, etc)
3. Various other support SDKs (e.g. DIA SDK for reading PDB files)
4. The compiler (cl.exe)
5. The linker (link.exe)
6. Various other tools (mt.exe, rc.exe, midl.exe, ml.exe, ml64.exe, etc)


1, 2, and 3 are almost certainly covered by something, but IANAL so I won't speculate on what. In any case, this isn't a big impediment because creating hermetic toolchains is a solved problem, so it seems reasonable to think that someone who already has a license for VS (which, btw, is free and permissive), could copy these files from a valid installation to another machine.

4 is already addressed by clang-cl and is, for all intents and purposes, 100% compatible.

5 is a work in progress. The LLVM linker (lld) is already about 80% compatible with the Microsoft linker. Where it still lacks is in support for generating PDB files, and LTO / PGO. All of those things are actively being developed, and given that Microsoft has opened up on the PDB format (mentioned earlier), there's no reason to think this won't happen with the same level of fidelity as has been achieved with the compiler.

6 is currently the big missing piece. There are 4 primary tools here.

mt.exe is the manifest tool. It takes a block of xml called an Application Manifest, and sticks it into the EXE.

rc.exe is the resource compiler. It takes a resource file, which is human readable/editable, compiles it into binary format, and sticks that into the EXE. This isn't just for GUI apps despite its name. Things like the executable's version number, publisher information, icon, etc are all resources, and you need a resource file for these things to work.

midl.exe is the "IDL compiler". It's used for creating and interacting with certain types of COM objects. It takes an IDL file, parses it, and then generates C++ header files that you can just #include to easily interact with COM objects.

ml.exe is MASM (Microsoft Macro Assembler). It's pretty much what it sounds like.

All that needs to happen to be 100% complete is to re-write these 4 tools (maybe even just the first 3, it seems reasonable to just say "we don't support MASM, it's not *that* different from the assembly dialect that clang already supports, just re-write your assembly code"). None of them is particularly complicated, and in fact work is beginning soon to do exactly that. Currently the VS bits are needed because without llvm versions of these tools, clang-cl has no choice but to shell out to the one that is installed with VS.

Once that happens, you will be able to build any Win32 executable on any platform (even a big endian system!) provided you have the headers and libraries (e.g. numbers 1, 2, and 3 above) available on that machine.
 

Koren

Member
cpp_is_king > First, I'd like to thank you for the long and interesting reply... Useful, too.

I don't know of any patents on the ABI.
Well, I'm not a specialist, but isn't there a couple of things like structured exceptions that Clang has trouble to implement because of patents, like Borland's? Even if I think their expiration could help soon, though.

It's simply undocumented.
True enough, but that's not better :/ And that's something Microsoft could solve more easily.

Once that happens, you will be able to build any Win32 executable on any platform (even a big endian system!) provided you have the headers and libraries (e.g. numbers 1, 2, and 3 above) available on that machine.
That may be the time I switch to clang-cl... (provided the license for the remaining files is clear enough).

The problem is that I'm not a lawyer either. Alternatives may not be Win32, but usually it's not an issue for me. The biggest problem would be shared objects... I've yet to experience a nasty cross-application bug that would require a Win32 debugger. I just want to be able to turn code into working executable for my own use, executable I can distribute to anyone that is interested. If non-Win32 is not good enough for them, they're welcome to do deal with the hassle themselves.

I fully understand your point... which is probably sane from a windows developper point of view. But to me, if Microsoft want a more homogeneus environment, they should just open-source the whole chain (or at least the full specs) and sell support instead of licenses.
 
cpp_is_king > First, I'd like to thank you for the long and interesting reply... Useful, too.


Well, I'm not a specialist, but isn't there a couple of things like structured exceptions that Clang has trouble to implement because of patents, like Borland's? Even if I think their expiration could help soon, though.

I don't know if SEH has any patents on it. In any case, clang-cl has full support for Win32 SEH (and for the record, it was extremely difficult to implement)
 
This is out of date?
https://clang.llvm.org/docs/MSVCCompatibility.html

If so, that's good to know... I'm dehind the times, I've lacked the time to follow the development of clang-cl recently...

Actually, no, I think that's pretty accurate. Most of the things where it says "mostly complete" if you read between the lines are "we think it's complete, but we occasionally get bug reports". So I would consider those complete with bugs (but then again, everything has bugs).

I forgot about the asynchronous exceptions though. That's only referring to hardware interrupt type of exceptions though, like divide by 0, etc. Note that you can still handle those by using AddVectoredExceptionHandler, and the limitation in clang-cl is only when the exception is generated in the same frame as the calling try.
 

Jokab

Member
I need career advice programming-GAF. I'm about to receive my M.Sc in Software Engineering this summer and am interviewing for jobs. I came across a company that seems attractive close to me who are hiring a lot of new graduates so that seems good. My background is mainly in Java and Python, so since they liked me in the first interview they put me in touch with a Java team at the company. Turns out they're working a lot with legacy systems and specifically they're porting an old COBOL backend (which also uses the very first relational database constructed) to new Java. The manager of this team also told me (in confidence, but I think it's fine since I'm not naming the company) that this porting has failed multiple times, which is why there is a bunch of Java 4/5 code in the system as well that is part of the old rewrites. On top of this, there's only one guy in the team that actually knows COBOL and he's retiring this summer. This is also not the only task this team has - they're accomodating customers for new features as well, written in new Java. Everyone in this team is also well over 35, three of them over 50 (out of 7). I'm 24...

So this is the first team I met with - they're the only Java team at the company. The rest are mainly C# with .NET stack. The recruiter that put me in touch with the company told me it's fine if I want to meet with C# team instead. I'm figuring since I know Java, picking up C# (never used it but from what I've read it's very close to Java) for backend work should not be a problem, right?

It feels like the Java team is having some real issues and the tasks might not be that attractive, along with that .NET seems a lot more fresh than Java. Or maybe I'm wrong and porting a legacy system is actually very fun and a good learning experience? Help me out here.
 

Somnid

Member
I need career advice programming-GAF. I'm about to receive my M.Sc in Software Engineering this summer and am interviewing for jobs. I came across a company that seems attractive close to me who are hiring a lot of new graduates so that seems good. My background is mainly in Java and Python, so since they liked me in the first interview they put me in touch with a Java team at the company. Turns out they're working a lot with legacy systems and specifically they're porting an old COBOL backend (which also uses the very first relational database constructed) to new Java. The manager of this team also told me (in confidence, but I think it's fine since I'm not naming the company) that this porting has failed multiple times, which is why there is a bunch of Java 4/5 code in the system as well that is part of the old rewrites. On top of this, there's only one guy in the team that actually knows COBOL and he's retiring this summer. This is also not the only task this team has - they're accomodating customers for new features as well, written in new Java. Everyone in this team is also well over 35, three of them over 50 (out of 7). I'm 24...

So this is the first team I met with - they're the only Java team at the company. The rest are mainly C# with .NET stack. The recruiter that put me in touch with the company told me it's fine if I want to meet with C# team instead. I'm figuring since I know Java, picking up C# (never used it but from what I've read it's very close to Java) for backend work should not be a problem, right?

It feels like the Java team is having some real issues and the tasks might not be that attractive, along with that .NET seems a lot more fresh than Java. Or maybe I'm wrong and porting a legacy system is actually very fun and a good learning experience? Help me out here.

Converting old systems is often painful and annoying. Usually the underlying system does a bazillion things nobody remembers until the new one doesn't do it leading to rewrites on top of rewrites when requirements change. If it was well planned they wouldn't have these issues. I'd join the C# team, you'll pick it up quickly and it's honestly a much more pleasant language than Java despite the similarities.
 

Jokab

Member
Converting old systems is often painful and annoying. Usually the underlying system does a bazillion things nobody remembers until the new one doesn't do it leading to rewrites on top of rewrites when requirements change. If it was well planned they wouldn't have these issues. I'd join the C# team, you'll pick it up quickly and it's honestly a much more pleasant language than Java despite the similarities.

Yeah this was sort of my line of thinking. One friend put for the perspective that porting an old system could be a good learning experience, but I'm not so sure. I asked to meet the C# team now, we'll see how it goes. (Only thing is the C# teams and the Java team sit right next to each other - I'll meet the C# team and walk past the Java team being like "oh hey sorry but I'm going with these guys lol")
 
man old J2EE 1.2/1.3 code really is the new COBOL. In five year's time working knowledge of that stack is going to feel extant-yeah you might know the language constructs just fine (like COBOL, which is easy to read) but command the stuff around the language (runtime environments, etc.) is going to be super rare.

The manager of this team also told me (in confidence, but I think it's fine since I'm not naming the company) that this porting has failed multiple times, which is why there is a bunch of Java 4/5 code in the system as well that is part of the old rewrites.

I think you should ask why those efforts failed earlier. Would give a lot of insight to company culture.
 

phisheep

NeoGAF's Chief Barrister
Yeah this was sort of my line of thinking. One friend put for the perspective that porting an old system could be a good learning experience, but I'm not so sure. I asked to meet the C# team now, we'll see how it goes. (Only thing is the C# teams and the Java team sit right next to each other - I'll meet the C# team and walk past the Java team being like "oh hey sorry but I'm going with these guys lol")

It can be a good learning experience, that's for sure. It is something of an acquired taste though and not everybody takes to it (I love it, but that's maybe that for many years I had to love it). It's perhaps more to the point that it isn't something that ever looks particularly impressive on your CV, especially if the project has failed multiple times and is maybe likely to fail again - which as the junior on the team you may not be able to prevent.

I'd be wary of working for this company though. Once you are in there there's every chance you'll get drafted into the legacy team next time the project goes phut, like it or not.
 

ferr

Member
Any best practices for handling versioning in a microservices/features architectures?

I have been releasing system updates as Major.minor.patch like semver.

But! I have broken out and isolated code features so that some files may not even need to be modified during a version update. I think where my issue lies is that I now have semver associated with each feature. For example,

/core-v1.4.1.js
/report-engine-v1.4.1.js
/utilities-v1.3.1.js

This is not exactly microservices, but it uses the same idea where features can be isolated and updates can be performed independently at the service/feature level.

If I have an update solely to /report-engine-v1.4.1.js which increments its version to 1.4.2 -- that kind of throws a wrench in my release method. In that case, should the next update to core be labeled 1.4.3? That's weird. I guess the idea is that the version implies versioning for just that feature/file -- but it can be misleading.

Am I right to use semver on a per-feature basis or should I be keeping all of these file versions lined up to the same version corresponding to their "overall release" ?
 
per-feature is what I would do there. Use major/minor feature syncs to tamp down confusion, but you shouldn't update patch level lockstep with the other modules.

(This assumes that there's no consumption of the modules by other programs or tools, in which case you want to completely split off versioning from the top-level module version)
 

Jokab

Member
It can be a good learning experience, that's for sure. It is something of an acquired taste though and not everybody takes to it (I love it, but that's maybe that for many years I had to love it). It's perhaps more to the point that it isn't something that ever looks particularly impressive on your CV, especially if the project has failed multiple times and is maybe likely to fail again - which as the junior on the team you may not be able to prevent.

I'd be wary of working for this company though. Once you are in there there's every chance you'll get drafted into the legacy team next time the project goes phut, like it or not.

Hm, I guess there's a possiblity of that happening. Then again my school is the only university in town and every programming program teaches Java as the primary language, so every graduate will know it for sure. This company is also looking to hire 10 graduates (compared to the ~100 employed devs) so there'll be plenty to go around.
 

PantsuJo

Member
Hi GAF, I need to write a Python project based on thread concurrency, for academic reasons. I already know how to create threads and manage them.

I need a project based on a "real world" situation, not simple code taken from books or slides.

I'm searching valid ideas for a python software; any topic, any application, any interesting project worth of being developed with threads.

Can you help me some cool ideas?

I trust you, GAF. Thanks in advance!
 

Moosichu

Member
I am having a really weird issue with Unity, and I am trying to optimize performance by removing unnecessary heap allocations.

Here's the issue, the profiler is being incredibly inconsistent.

Here's an example:

Code:
        Profiler.BeginSample("Outside For Loop");
        for (int i = 0; i < heightMap.Length; i++)
        {
            Profiler.BeginSample("Inside For Loop");
            heightMap[i] = new Color(0, 0, 0, 1);
            Profiler.EndSample();
        }
        Profiler.EndSample();

However, according to Unity's profiler, "Outside For Loop" has 2.6mb of GC allocations per frame while "Inside For Loop" has none.

And AFAIK they should both not being allocating anything as Color is a struct not a class.

What am I doing incorrectly?
 
Hi GAF, I need to write a Python project based on thread concurrency, for academic reasons. I already know how to create threads and manage them.

I need a project based on a "real world" situation, not simple code taken from books or slides.

I'm searching valid ideas for a python software; any topic, any application, any interesting project worth of being developed with threads.

Can you help me some cool ideas?

I trust you, GAF. Thanks in advance!

Python with threads, doesn't the GIL prevent most performance gains through threads? (unless you mean using subprocess) Anyways.. I think a neat thing would be a command-line based application to download multiple files in parallel. Think wget, but download multiple files at once and potentially with multiple connections per file.
 
Top Bottom